Ignore:
Timestamp:
Dec 22, 2010, 3:52:27 PM (15 years ago)
Author:
garnier
Message:

geant4 tag 9.4

Location:
trunk/source/processes/hadronic
Files:
309 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/hadronic/cross_sections/History

    r1340 r1347  
    1515     ---------------------------------------------------------------
    1616
    17 24 October 2010 Vladimir Ivanchenko (hadr-cross-V09-03-12)
     17 9 December 2010 Dennis Wright (hadr-cross-V09-03-21)
     18-----------------------------------------------------
     19- G4ElectroNuclearCrossSection::GetEquivalentPhotonEnergy() : remove
     20  initialization of array Y[]. This forced expensive re-calculation
     21  at each call.
     22 
     2326 November 2010 Vladimir Ivanchenko (hadr-cross-V09-03-20)
     24----------------------------------------------------------
     25- G4BGGPionElasticXS, G4BGGNucleonElasticXS,G4BGGNucleonInelasticXS
     26        fixed low-energy (E < 20 MeV) models
     27- G4TripathiLightCrossSection - J.M.Quesada fix for threshold shape
     28
     2923 November 2010 Vladimir Ivanchenko (hadr-cross-V09-03-19)
     30----------------------------------------------------------
     31- added G4CrossSectionInelastic and G4CrossSectionElastic - wrappers
     32        for components
     33
     3419 November 2010 Gunter Folger       (hadr-cross-V09-03-18)
     35- replace leftover calls to GetIsoZACrossSection by  GetZandACrossSection, and
     36   IsZAApplicable by IsIsoApplicable.
     37
     3818 November 2010 Vladimir Ivanchenko (hadr-cross-V09-03-17)
     39----------------------------------------------------------
     40- G4NeutronCaptureXS, G4NeutronElasticXS, G4NeutronInelasticXS - do
     41  not use G4Element, only G4NistManager
     42- G4ComponentAntiNuclNuclearXS - new class (A.Galoyan)
     43
     4413 November 2010 Gunter Folger (hadr-cross-V09-03-16)
     45------------------------------------------------------
     46- Fix bug from Integer A&Z transition:
     47  - G4VCrossSectionDataSet.cc:
     48  make new methods (IsIsoApplicable, GetZandACrossSection) forward to old
     49  methods (IsZAApplicable, GetIsoZACrossSection); old methods print a obsolete
     50   warning once.
     51  - G4CrossSectionDataStore.cc: use new methods only.
     52
     5312 November 2010  Gunter Folger (hadr-cross-V09-03-15)
     54------------------------------------------------------
     55- Add new class G4CrossSectionPairGG to extend a given cross-section with
     56   a scaled G4GlauberGribovCrossSection. Scaling result in smooth transition.
     57
     5811 November 2010  Dennis Wright (hadr-cross-V09-03-14)
     59------------------------------------------------------
     60Back out memory leak fixes of G4NeutronElasticXS.cc and G4NeutronInelasticXS.cc
     61Not a memory leak after all.
     62
     6310 November 2010  Dennis Wright (hadr-cross-V09-03-13)
     64------------------------------------------------------
     65NOTE: this tag deals exclusively with fixes of CoVerity-identified
     66bugs
     67
     68- G4HadronCrossSections.hh : fix uninitialized variable prevElement in ctor
     69
     70- Initialize arrays theGlauberFac and theCoulombFac in ctors of
     71  G4BGGNucleonElasticXS.cc, G4BGGNucleonInelasticXS.cc, G4BGGPionElasticXS.cc,
     72  G4BGGPionInelasticXS.cc
     73
     74- Initialize all elements of array Y[nE] to 0.0 in
     75  G4ElectroNuclearCrossSection::GetEquivalentPhotonEnergy()
     76
     77- Initialize fTotalXsc, fElasticXsc, fInelasticXsc, fProductionXsc,
     78  fDiffractionXsc, fHadronNucleonXsc to 0.0 in ctors of
     79  G4GlauberGribovCrossSection.cc, G4GGNuclNuclCrossSection.cc
     80
     81- Initialize fTotalXsc, fElasticXsc, fInelasticXsc, fHadronNucleonXsc to 0.0
     82  in ctor of G4HadronNucleonXsc, 
     83
     84- fix memory leak in G4NeutronElasticXS:Initialise and
     85  G4NeutronInelasticXS:Initialise :
     86   const G4Element* Elem =
     87     G4Element* G4NistManager::FindOrBuildElement(G4int Z, G4bool isotopes)
     88  Elem goes out of scope, so delete it
     89
     90- Initialize fTotalXsc, fElasticXsc to 0.0 in ctors of
     91  G4NucleonNuclearCrossSection.cc, G4PiNuclearCrossSection.cc
     92
     93- Initialize array theFac in ctors of
     94  G4UElasticCrossSection.cc, G4UInelasticCrossSection.cc
     95
     96
     9709 November 2010 Vladimir Ivanchenko (hadr-cross-V09-03-12)
     98-----------------------------------------------------------
    1899- G4VComponentCrossSection - use G4ParticleDefinition and kinetic
    19100   energy instead of G4DynamicParticle
     101- G4EMDissociationCrossSection - is now applicable for Hydrogen but
     102   cross section for Hydrogen is zero
     103
    20104
    2110520 October 2010 Gunter Folger (hadr-cross-V09-03-11)
     106----------------------------------------------------
    22107- add missing inline for GetCrossSection in G4BGGPionElasticXS.hh
     108
    23109
    2411015 October 2010 Dennis Wright (hadr-cross-V09-03-10)
  • trunk/source/processes/hadronic/cross_sections/src/G4EMDissociationCrossSection.cc

    r1340 r1347  
    5656// Beta release
    5757//
    58 // 30. May 2005, J.P. Wellisch removed a compilation warning on gcc 3.4 for
     58// 30 May 2005, J.P. Wellisch removed a compilation warning on gcc 3.4 for
    5959//               geant4 7.1.
     60// 09 November 2010, V.Ivanchenko make class applicable for Hydrogen but
     61//                   set cross section for Hydrogen to zero 
    6062//
    6163// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     
    9799G4bool
    98100G4EMDissociationCrossSection::IsIsoApplicable(const G4DynamicParticle* theDynamicParticle,
    99                                               G4int /*ZZ*/, G4int AA)
     101                                              G4int /*ZZ*/, G4int/* AA*/)
    100102{
    101103//
     
    107109//
    108110  if (G4ParticleTable::GetParticleTable()->GetIonTable()->
    109     IsIon(theDynamicParticle->GetDefinition()) && AA > 1)
     111      IsIon(theDynamicParticle->GetDefinition()) /*&& AA > 1*/)
    110112    return true;
    111113  else
     
    127129  G4int nIso = theElement->GetNumberOfIsotopes();
    128130  G4double crossSection = 0;
     131
     132  // VI protection for Hydrogen
     133  if(theElement->GetZ() < 1.5) { return crossSection; }
    129134     
    130135  if (nIso) {
     
    156161                                                   G4int ZZ, G4int AA, G4double /*temperature*/)
    157162{
     163  // VI protection for Hydrogen
     164  if(ZZ <= 1) { return 0.0; }
     165
    158166//
    159167// Get relevant information about the projectile and target (A, Z) and
  • trunk/source/processes/hadronic/cross_sections/src/G4GGNuclNuclCrossSection.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    2726// 24.11.08 V. Grichine - first implementation
    2827//
     
    3635
    3736
    38 ///////////////////////////////////////////////////////////////////////////////
    39 //
    40 //
    41 
    4237G4GGNuclNuclCrossSection::G4GGNuclNuclCrossSection()
    4338: fUpperLimit( 100000 * GeV ),
    4439  fLowerLimit( 0.1 * MeV ),
    45   fRadiusConst( 1.08*fermi )  // 1.1, 1.3 ?
     40  fRadiusConst( 1.08*fermi ),  // 1.1, 1.3 ?
     41  fTotalXsc(0.0), fElasticXsc(0.0), fInelasticXsc(0.0), fProductionXsc(0.0),
     42  fDiffractionXsc(0.0), fHadronNucleonXsc(0.0)
    4643{
    4744  theProton   = G4Proton::Proton();
     
    4946}
    5047
    51 ///////////////////////////////////////////////////////////////////////////////
    52 //
    53 //
    5448
    5549G4GGNuclNuclCrossSection::~G4GGNuclNuclCrossSection()
    5650{}
    57 
    58 ///////////////////////////////////////////////////////////////////////////////
    59 //
    60 //
    6151
    6252
  • trunk/source/processes/hadronic/cross_sections/src/G4GlauberGribovCrossSection.cc

    r1340 r1347  
    3737#include "G4ParticleDefinition.hh"
    3838
    39 //////////////////////////////////////////////////////////////////////////////////////
    40 //
     39///////////////////////////////////////////////////////////////////////////////
    4140//
    4241
     
    218217
    219218
    220 
    221 
    222 ////////////////////////////////////////////////////////////////////////////////
    223 //
     219//////////////////////////////////////////////////////////////////////////////
    224220//
    225221
     
    227223: fUpperLimit( 100000 * GeV ),
    228224  fLowerLimit( 3 * GeV ),
    229   fRadiusConst( 1.08*fermi )  // 1.1, 1.3 ?
     225  fRadiusConst( 1.08*fermi ),  // 1.1, 1.3 ?
     226  fTotalXsc(0.0), fElasticXsc(0.0), fInelasticXsc(0.0), fProductionXsc(0.0),
     227  fDiffractionXsc(0.0), fHadronNucleonXsc(0.0)
    230228{
    231229  theGamma    = G4Gamma::Gamma();
  • trunk/source/processes/hadronic/cross_sections/src/G4HadronNucleonXsc.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    2726// 14.03.07 V. Grichine - first implementation
    2827//
     
    3837G4HadronNucleonXsc::G4HadronNucleonXsc()
    3938: fUpperLimit( 10000 * GeV ),
    40   fLowerLimit( 0.03 * MeV )
     39  fLowerLimit( 0.03 * MeV ),
     40  fTotalXsc(0.0), fElasticXsc(0.0), fInelasticXsc(0.0), fHadronNucleonXsc(0.0)
    4141{
    4242  theGamma    = G4Gamma::Gamma();
     
    7272}
    7373
    74 ///////////////////////////////////////////////////////////////////////////////////////
    75 //
    76 //
    7774
    7875G4HadronNucleonXsc::~G4HadronNucleonXsc()
    7976{}
    80 
    81 
    82 ////////////////////////////////////////////////////////////////////////////////////////
    83 //
    84 //
    8577
    8678
  • trunk/source/processes/hadronic/cross_sections/src/G4IonsKoxCrossSection.cc

    r1340 r1347  
    107107    G4int ZZ = G4lrint(anElement->GetZ());
    108108    G4int AA = G4lrint(anElement->GetN());
    109     xsection = GetIsoZACrossSection(aParticle, ZZ, AA, temperature);
     109    xsection = GetZandACrossSection(aParticle, ZZ, AA, temperature);
    110110  }
    111111   
  • trunk/source/processes/hadronic/cross_sections/src/G4IonsShenCrossSection.cc

    r1340 r1347  
    109109      ZZ = (*isoVector)[i]->GetZ();
    110110      AA = (*isoVector)[i]->GetN();
    111       sig = GetIsoZACrossSection(aParticle, ZZ, AA, temperature);
     111      sig = GetZandACrossSection(aParticle, ZZ, AA, temperature);
    112112      xsection += sig*abundVector[i];
    113113    }
     
    116116    G4int ZZ = G4lrint(anElement->GetZ());
    117117    G4int AA = G4lrint(anElement->GetN());
    118     xsection = GetIsoZACrossSection(aParticle, ZZ, AA, temperature);
     118    xsection = GetZandACrossSection(aParticle, ZZ, AA, temperature);
    119119  }
    120120 
  • trunk/source/processes/hadronic/cross_sections/src/G4IonsSihverCrossSection.cc

    r1340 r1347  
    7373      ZZ = (*isoVector)[i]->GetZ();
    7474      AA = (*isoVector)[i]->GetN();
    75       sig = GetIsoZACrossSection(aParticle, ZZ, AA, temperature);
     75      sig = GetZandACrossSection(aParticle, ZZ, AA, temperature);
    7676      xsection += sig*abundVector[i];
    7777    }
     
    8080    G4int ZZ = G4lrint(anElement->GetZ());
    8181    G4int AA = G4lrint(anElement->GetN());
    82     xsection = GetIsoZACrossSection(aParticle, ZZ, AA, temperature);
     82    xsection = GetZandACrossSection(aParticle, ZZ, AA, temperature);
    8383  }
    8484   
  • trunk/source/processes/hadronic/cross_sections/src/G4NucleonNuclearCrossSection.cc

    r1340 r1347  
    449449
    450450///////////////////////////////////////////////////////////////////////////////
    451 //
    452 //
    453451
    454452G4NucleonNuclearCrossSection::G4NucleonNuclearCrossSection()
     453 :fTotalXsc(0.0), fElasticXsc(0.0)
    455454{
    456455  theNeutron = G4Neutron::Neutron();
  • trunk/source/processes/hadronic/cross_sections/src/G4PiNuclearCrossSection.cc

    r1340 r1347  
    301301  1970, 1980, 1950, 1978, 1830, 1780};
    302302
    303  G4PiNuclearCrossSection::
    304  G4PiNuclearCrossSection()
     303
     304G4PiNuclearCrossSection::G4PiNuclearCrossSection()
     305  : fTotalXsc(0.0), fElasticXsc(0.0)
    305306 {
    306307   thePimData.push_back(new G4PiData(he_t,   he_in,  e1, 38));
  • trunk/source/processes/hadronic/cross_sections/src/G4TripathiCrossSection.cc

    r1340 r1347  
    169169    G4int ZZ = G4lrint(anEle->GetZ());
    170170    G4int AA = G4lrint(anEle->GetN());
    171     xsection = GetIsoZACrossSection(aPart, ZZ, AA, temperature);
     171    xsection = GetZandACrossSection(aPart, ZZ, AA, temperature);
    172172  }
    173173
  • trunk/source/processes/hadronic/cross_sections/src/G4TripathiLightCrossSection.cc

    r1340 r1347  
    5555// 15 March 2004, P R Truscott, QinetiQ Ltd, UK
    5656// Beta release
     57//
     58// J. M. Quesada 24 November 2010 bug fixed in X_m
     59//(according to eq. 14 in  R.K. Tripathi et al. Nucl. Instr. and Meth. in Phys. Res. B 155 (1999) 349-356)
    5760//
    5861// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     
    247250  }
    248251  G4double S_L = 1.2 + 1.6*(1.0-std::exp(-E/15.0));
    249   G4double X_m = 1.0 - X1*std::exp(-E/X1*S_L);
     252//JMQ 241110 bug fixed
     253//  G4double X_m = 1.0 - X1*std::exp(-E/X1*S_L);
     254  G4double X_m = 1.0 - X1*std::exp(-E/(X1*S_L));
    250255//
    251256//
     
    341346    G4int ZZ = G4lrint(theTarget->GetZ());
    342347    G4int AA = G4lrint(theTarget->GetN());
    343     xsection = GetIsoZACrossSection(theProjectile, ZZ, AA, theTemperature);
     348    xsection = GetZandACrossSection(theProjectile, ZZ, AA, theTemperature);
    344349  }
    345350   
  • trunk/source/processes/hadronic/cross_sections/src/G4UElasticCrossSection.cc

    r1340 r1347  
    3030// 06.03.07 V.Ivanchenko - add Initialise function
    3131//
    32 //
    33 
    3432
    3533#include "G4UElasticCrossSection.hh"
     
    4846#include "G4NistManager.hh"
    4947
    50 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    5148
    5249G4UElasticCrossSection::G4UElasticCrossSection(const G4ParticleDefinition*)
     
    5552  hasGlauber = false;
    5653  thEnergy   = 90.*GeV;
     54  for (G4int i = 0; i < 93; i++) theFac[i] = 0.0;
    5755  fGlauber   = new G4GlauberGribovCrossSection();
    5856  fGheisha   = G4HadronCrossSections::Instance();
     
    6159}
    6260
    63 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    6461
    6562G4UElasticCrossSection::~G4UElasticCrossSection()
     
    7572                                              const G4Element*  elm)
    7673{
    77   return IsZAApplicable(dp, elm->GetZ(), elm->GetN());
     74  return IsIsoApplicable(dp, G4lrint(elm->GetZ()), G4lrint(elm->GetN()));
    7875}
    7976
     
    186183  G4int A = G4lrint(nist->GetAtomicMassAmu(2));
    187184
    188   if(fGlauber->IsZAApplicable(&dp, 2.0, A)) {
     185  if(fGlauber->IsIsoApplicable(&dp, 2, A)) {
    189186    hasGlauber = true;
    190187
  • trunk/source/processes/hadronic/cross_sections/src/G4UInelasticCrossSection.cc

    r1340 r1347  
    3030// 06.03.07 V.Ivanchenko - add Initialise function
    3131//
    32 //
    3332
    3433
     
    4847#include "G4NistManager.hh"
    4948
    50 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    5149
    5250G4UInelasticCrossSection::G4UInelasticCrossSection(const G4ParticleDefinition*)
     
    5553  hasGlauber = false;
    5654  thEnergy   = 90.*GeV;
     55  for (G4int i = 0; i < 93; i++) theFac[i] = 0.0;
    5756  fGlauber   = new G4GlauberGribovCrossSection();
    5857  fGheisha   = G4HadronCrossSections::Instance();
     
    6160}
    6261
    63 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    6462
    6563G4UInelasticCrossSection::~G4UInelasticCrossSection()
     
    7573                                              const G4Element*  elm)
    7674{
    77   return IsZAApplicable(dp, elm->GetZ(), elm->GetN());
     75  return IsIsoApplicable(dp, G4lrint(elm->GetZ()), G4lrint(elm->GetN()));
    7876}
    7977
     
    102100  G4int Z = G4lrint(elm->GetZ());
    103101  G4int N = G4lrint(elm->GetN());
    104   return GetIsoZACrossSection(dp, Z, N, temp);
     102  return GetZandACrossSection(dp, Z, N, temp);
    105103}
    106104
     
    121119      cross = theFac[Z]*fGlauber->GetInelasticGlauberGribov(dp, Z, A);
    122120    } else {
    123       cross = fNucleon->GetIsoZACrossSection(dp, Z, A);
     121      cross = fNucleon->GetZandACrossSection(dp, Z, A);
    124122    }
    125123
     
    195193      // proton and neutron
    196194      if(fNucleon) {
    197         csdn = fNucleon->GetIsoZACrossSection(&dp, iz, A);
     195        csdn = fNucleon->GetZandACrossSection(&dp, iz, A);
    198196
    199197        // pions
  • trunk/source/processes/hadronic/management/History

    r1340 r1347  
    1515     ---------------------------------------------------------------
    1616
     1730 November 2010  Dennis Wright  (hadr-man-V09-03-06)
     18-----------------------------------------------------
     19- G4HadronicProcess.cc : in PostStepDoIt, check cross section value
     20  before calling ApplyYourself.  If less than or equal to zero, return
     21  track unchanged.
     22
     2321 November 2010  Dennis Wright  (hadr-man-V09-03-05)
     24-----------------------------------------------------
     25- G4EnergyRangeManager: initialize theHadronicInteractionCounter
     26  and ptr theHadronicInteraction as per CoVerity
     27
    172817 August 2010  Vladimir Ivanchenko (hadr-man-V09-03-04)
    18 ------------------------------------------------
     29--------------------------------------------------------
    1930- G4HadronicProcess - use const GetParticleDefinition method of
    2031                      G4DynamicParticle
  • trunk/source/processes/hadronic/models/abla/History

    r1340 r1347  
    44     Geant4 - an Object-Oriented Toolkit for Physics Simulation
    55     ==========================================================
    6 $Id: History,v 1.1 2008/02/27 18:31:10 miheikki Exp $
     6$Id: History,v 1.2 2010/11/11 02:13:12 dennis Exp $
    77---------------------------------------------------------------------
    88
     
    1717   ---------------------------------------------------------------
    1818
     1910 November 2010  Dennis Wright
     20-------------------------------
     21- the code in this directory is not used as of this date
     22
    192327 February 2008 - Pekka Kaitaniemi
    2024-----------------------------------
  • trunk/source/processes/hadronic/models/abrasion/History

    r1340 r1347  
    1414     ---------------------------------------------------------------
    1515
     1612-Nov-2010, Dennis Wright                  (had-abrasion-V09-03-01)
     17--------------------------------------------------------------------
     18- G4WilsonAbrasionModel.cc : initialize r0sq in ctor (CoVerity)
     19- G4NuclearAbrasionGeometry::GetExcitationEnergyOfTarget :
     20   fix memory leak by deleting revAbrasionGeometry  (CoVerity)
     21
    162208-Sep-2010, Gunter Folger                  (had-abrasion-V09-03-00)
     23--------------------------------------------------------------------
    1724- G4WilsonAbrasionModel.cc: remove several unused #includes
    1825
  • trunk/source/processes/hadronic/models/abrasion/src/G4NuclearAbrasionGeometry.cc

    r819 r1347  
    194194  return Es;
    195195}
    196 //////////////////////////////////////////////////////////////////////////////////////
    197 //
     196
     197
    198198G4double G4NuclearAbrasionGeometry::GetExcitationEnergyOfTarget ()
    199199{
    200 //
    201 //
    202 // This member function declares a new G4NuclearAbrasionGeometry object but with the
    203 // projectile and target exchanged to determine the values for F and P.  Determination
    204 // of the excess surface area and excitation energy is as above.
    205 //
    206   G4NuclearAbrasionGeometry *revAbrasionGeometry =
     200  // This member function declares a new G4NuclearAbrasionGeometry object
     201  // but with the projectile and target exchanged to determine the values
     202  // for F and P.  Determination of the excess surface area and excitation
     203  // energy is as above.
     204
     205  G4NuclearAbrasionGeometry* revAbrasionGeometry =
    207206    new G4NuclearAbrasionGeometry(AT, AP, r);
    208207  G4double F1 = revAbrasionGeometry->F();
     
    212211  Es = 0.95 * MeV * 4.0 * pi * rT*rT/fermi/fermi *
    213212       (1.0+P1-std::pow(1.0-F1,2.0/3.0));
     213
    214214//  if (rP < rT && r < rT-rP)
    215   if ((r-rT)/rP < rth)
    216   {
     215  if ((r-rT)/rP < rth) {
    217216    G4double omega = 0.0;
    218217    if      (AT < 12.0)  omega = 1500.0;
     
    225224  else if (Es > B * AT)
    226225    Es = B * AT;
     226
     227  delete revAbrasionGeometry;
     228
    227229  return Es;
    228230}
    229 ////////////////////////////////////////////////////////////////////////////////
    230 //
  • trunk/source/processes/hadronic/models/abrasion/src/G4WilsonAbrasionModel.cc

    r1340 r1347  
    3434// ********************************************************************
    3535//
    36 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     36// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    3737//
    3838// MODULE:              G4WilsonAbrasionModel.cc
     
    4545// Contract:            17191/03/NL/LvH
    4646//
    47 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     47// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    4848//
    4949// CHANGE HISTORY
     
    7272// Additional clauses have been included in
    7373//    G4WilsonAbrasionModel::GetNucleonInducedExcitation
    74 // Previously it was possible to get sqrt of negative number as Wilson algorithm
    75 // not properly defined if either:
     74// Previously it was possible to get sqrt of negative number as Wilson
     75// algorithm not properly defined if either:
    7676//    rT > rP && rsq < rTsq - rPsq) or (rP > rT && rsq < rPsq - rTsq)
    7777//
    78 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    79 ////////////////////////////////////////////////////////////////////////////////
    80 //
     78// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     79///////////////////////////////////////////////////////////////////////////////
     80
    8181#include "G4WilsonAbrasionModel.hh"
    8282#include "G4WilsonRadius.hh"
     
    9999#include "G4IonTable.hh"
    100100#include "globals.hh"
    101 ////////////////////////////////////////////////////////////////////////////////
    102 //
     101
     102
    103103G4WilsonAbrasionModel::G4WilsonAbrasionModel (G4bool useAblation1)
    104104  :G4HadronicInteraction("G4WilsonAbrasion")
    105105{
    106 //
    107 //
    108 // Send message to stdout to advise that the G4Abrasion model is being used.
    109 //
     106  // Send message to stdout to advise that the G4Abrasion model is being used.
    110107  PrintWelcomeMessage();
    111 //
    112 //
    113 // Set the default verbose level to 0 - no output.
    114 //
     108
     109  // Set the default verbose level to 0 - no output.
    115110  verboseLevel = 0;
    116111  useAblation  = useAblation1;
    117 //
    118 //
    119 // No de-excitation handler has been supplied - define the default handler.
    120 //
     112
     113  // No de-excitation handler has been supplied - define the default handler.
     114
    121115  theExcitationHandler  = new G4ExcitationHandler;
    122116  theExcitationHandlerx = new G4ExcitationHandler;
     
    146140    theExcitationHandlerx->SetMaxAandZForFermiBreakUp(12, 6);
    147141  }
    148 //
    149 //
    150 // Set the minimum and maximum range for the model (despite nomanclature, this
    151 // is in energy per nucleon number). 
    152 //
     142
     143  // Set the minimum and maximum range for the model (despite nomanclature,
     144  // this is in energy per nucleon number). 
     145
    153146  SetMinEnergy(70.0*MeV);
    154147  SetMaxEnergy(10.1*GeV);
    155148  isBlocked = false;
    156 //
    157 //
    158 // npK, when mutiplied by the nuclear Fermi momentum, determines the range of
    159 // momentum over which the secondary nucleon momentum is sampled.
    160 //
    161   npK              = 5.0;
    162   B                = 10.0 * MeV;
    163   third            = 1.0 / 3.0;
    164   fradius          = 0.99;
    165   conserveEnergy   = false;
     149
     150  // npK, when mutiplied by the nuclear Fermi momentum, determines the range of
     151  // momentum over which the secondary nucleon momentum is sampled.
     152
     153  r0sq = 0.0;
     154  npK = 5.0;
     155  B = 10.0 * MeV;
     156  third = 1.0 / 3.0;
     157  fradius = 0.99;
     158  conserveEnergy = false;
    166159  conserveMomentum = true;
    167160}
    168 ////////////////////////////////////////////////////////////////////////////////
    169 //
     161
     162
    170163G4WilsonAbrasionModel::G4WilsonAbrasionModel (G4ExcitationHandler *aExcitationHandler)
    171164{
  • trunk/source/processes/hadronic/models/binary_cascade/History

    r1340 r1347  
    1313     * Please list in reverse chronological order (last date on top)
    1414     ---------------------------------------------------------------
     15
     1611 Nov 2010, G.Folger                    had-binary-V09-03-05
     17- fix compilation errors and warnings in G4BinaryCascade.
     18
     1910 Nov 2010, G.Folger                    had-binary-V09-03-04
     20- *** lower CaptureThreshold in G4GeneratorPrecompoundInterface.cc
     21       from 80 to 10 MeV.
     22- G4BinaryCascade: disable G4Exception in StepParticlesOut() introduced in
     23   previous tag. Need to investigate why this happens first.
     24   
     253 Nov 2010,  G.Folger                    had-binary-V09-03-03
     26- Fix coverity warnings
     27   - in Propagate(), mem leak for products
     28   - in StepParticlesOut, check return code of GetSphereInter....
     29   - Scatter1H1(0 always check secs
    1530
    16318 Sep 2010, G.Folger                     had-binary-V09-03-02
     
    5166  1. Shift of particle's formation times that the min. time=0.
    5267
    53   2. Including of captured particles (Due to absend of the options there
    54      were
    55      a large energy-non-conservation).
     68  2. Including of captured particles (Due to absence of the options there
     69     were a large energy-non-conservation).
    5670
    5771  3. GetExcitationEnergy() - correction for the case when all nucleons are
  • trunk/source/processes/hadronic/models/binary_cascade/include/G4BinaryCascade.hh

    r1228 r1347  
    8585  G4int GetTotalCharge(std::vector<G4KineticTrack *> & aV)
    8686  {
    87 G4cout<<"GetTotalCharge(std::vector<G4KineticTrack *> & aV)"<<G4endl; // Uzhi
    8887    G4int result = 0;
    8988    std::vector<G4KineticTrack *>::iterator i;
     
    9190    {
    9291       result += G4lrint((*i)->GetDefinition()->GetPDGCharge());
    93 G4cout<<(*i)->GetDefinition()->GetParticleName()<<" "<<(*i)->GetDefinition()->GetPDGCharge()<<G4endl; // Uzhi
     92    }
     93    return result;
     94  }
     95  G4int GetTotalBaryonCharge(std::vector<G4KineticTrack *> & aV)
     96  {
     97    G4int result = 0;
     98    std::vector<G4KineticTrack *>::iterator i;
     99    for(i = aV.begin(); i != aV.end(); ++i)
     100    {
     101       if ( (*i)->GetDefinition()->GetBaryonNumber() != 0 ){
     102             result += G4lrint((*i)->GetDefinition()->GetPDGCharge());
     103       }
    94104    }
    95105    return result;
  • trunk/source/processes/hadronic/models/binary_cascade/src/G4BinaryCascade.cc

    r1340 r1347  
    152152{
    153153  static G4int eventcounter=0;
     154 
     155//   if ( eventcounter == 0 ) {
     156//      SetEpReportLevel(3);   // report non conservation with model etc.
     157//      G4double relativeLevel = 1*perCent;
     158//      G4double absoluteLevel = 2*MeV;
     159//      SetEnergyMomentumCheckLevels(relativeLevel,absoluteLevel);
     160//   }
     161 
    154162  //if(eventcounter == 100*(eventcounter/100) )
    155163  eventcounter++;
     
    278286   G4cout << "G4BinaryCascade Propagate starting -------------------------------------------------------" <<G4endl;
    279287#endif
     288
     289   // *GF* FIXME ? in propagate mode this test is wrong! Could be in Apply....
     290  if(nucleus->GetMassNumber() == 1) // 1H1 is special case
     291  {
     292      #ifdef debug_BIC_Propagate
     293          G4cout << " special case 1H1.... " << G4endl;
     294      #endif
     295     return Propagate1H1(secondaries,nucleus);
     296  }
     297
    280298  G4ReactionProductVector * products = new G4ReactionProductVector;
    281299  the3DNucleus = nucleus;
     
    289307  ClearAndDestroy(&theFinalState);
    290308  std::vector<G4KineticTrack *>::iterator iter;
    291 
    292    // *GF* FIXME ? in propagate mode this test is wrong! Could be in Apply....
    293   if(nucleus->GetMassNumber() == 1) // 1H1 is special case
    294   {
    295       #ifdef debug_BIC_Propagate
    296           G4cout << " special case 1H1.... " << G4endl;
    297       #endif
    298      return Propagate1H1(secondaries,nucleus);
    299   }
    300309
    301310  BuildTargetList();
     
    10681077     PrintKTVector(&target_collection,std::string("... targets"));
    10691078//*GF*     throw G4HadronicException(__FILE__, __LINE__, "G4BinaryCasacde::ApplyCollision()");
    1070 #else
     1079#endif
    10711080     return false;
    1072 #endif
    10731081  }
    10741082
     
    11171125  G4KineticTrackVector * products=0;
    11181126  products = collision->GetFinalState();
     1127
     1128  G4bool lateParticleCollision= (!haveTarget) && products && products->size() == 1;
    11191129
    11201130  #ifdef debug_BIC_ApplyCollision
     
    11391149           PrintKTVector(&collision->GetTargetCollection(),std::string(" Target particles"));
    11401150      } 
    1141    #endif
    1142      G4bool lateParticleCollision= (!haveTarget) && products && products->size() == 1;
    11431151        //  if ( lateParticleCollision ) G4cout << " Added late particle--------------------------"<<G4endl;
    11441152        //  if ( lateParticleCollision && products ) PrintKTVector(products, " reaction products");
     1153   #endif
    11451154//**************************************** 
    11461155
     
    15611570      {
    15621571          nsec++;
    1563           G4double tStep(0), tdummy(0);
    1564           ((G4RKPropagation*)thePropagator)->GetSphereIntersectionTimes(kt,tdummy,tStep);
     1572          G4double tStep(0), tdummy(0);
     1573          G4bool intersect =
     1574               ((G4RKPropagation*)thePropagator)->GetSphereIntersectionTimes(kt,tdummy,tStep);
    15651575#ifdef debug_BIC_StepParticlesOut
    15661576          G4cout << " minTimeStep, tStep Particle " <<minTimeStep << " " <<tStep
    15671577                 << " " <<kt->GetDefinition()->GetParticleName()
    15681578                 << " 4mom " << kt->GetTrackingMomentum()<<G4endl;
    1569 #endif
    1570           if(tStep<minTimeStep && tStep> 0 )
     1579          if ( ! intersect );
     1580          {
     1581             PrintKTVector(&theSecondaryList, std::string(" state ERROR....."));
     1582             throw G4HadronicException(__FILE__, __LINE__, "G4BinaryCascade::StepParticlesOut() particle not in nucleus");
     1583          }
     1584#endif
     1585          if(intersect && tStep<minTimeStep && tStep> 0 )
    15711586          {
    15721587            minTimeStep = tStep;
     
    24622477    }
    24632478    size_t current(0);
    2464     for(current=0; current<secs->size(); current++)
     2479    for(current=0; secs && current<secs->size(); current++)
    24652480    {
    24662481      if((*secs)[current]->GetDefinition()->IsShortLived())
     
    27082723                                          G4KineticTrackVector * products)
    27092724{
    2710   G4RKPropagation * RKprop=(G4RKPropagation *)thePropagator;
    27112725
    27122726  G4KineticTrackVector debug1;
     
    27162730  PrintKTVector(products,std::string(" Scatterer products"));
    27172731 
     2732#ifdef dontUse
    27182733  G4double thisExcitation(0);
    27192734//  excitation energy from this collision
     
    27222737  G4KineticTrack * kt=collision->GetPrimary();
    27232738  initial +=  kt->Get4Momentum().e();
     2739
     2740  G4RKPropagation * RKprop=(G4RKPropagation *)thePropagator;
    27242741 
    27252742  initial +=  RKprop->GetField(kt->GetDefinition()->GetPDGEncoding(),kt->GetPosition());
     
    27892806         << G4endl;
    27902807   currentInitialEnergy-=final; 
    2791 
     2808#endif
    27922809}
    27932810
  • trunk/source/processes/hadronic/models/cascade/History

    r1340 r1347  
    1 $Id: History,v 1.203 2010/10/22 20:41:05 mkelsey Exp $
     1$Id: History,v 1.206 2010/11/24 21:16:17 mkelsey Exp $
    22-------------------------------------------------------------------
    33
     
    1515     * Please list in reverse chronological order (last date on top)
    1616     ---------------------------------------------------------------
     17
     1824 November 2010 Michael Kelsey (hadr-casc-V09-03-87)
     19-----------------------------------------------------
     20- G4InuclCollider.cc:  Delete local "zbullet" before exiting.  Fixes memory
     21  leak reported for 9.4 cand-01.
     22
     2319 November 2010 Michael Kelsey (hadr-casc-V09-03-86)
     24-----------------------------------------------------
     25- G4NucleiModel.cc:  Put messages related to negative-path-length and
     26  zero-interaction-partners behind verbosity flag.
     27
     2829 October 2010 Michael Kelsey (hadr-casc-V09-03-85)
     29----------------------------------------------------
     30- G4NucleiModel:  Bring tagged version kelsey-20101020 (refactoring) to HEAD
     31  and tag for 9.4 release.  This is the last substantive modification to be
     32  included; validated by direct |diff|ing of output vs. V09-03-84 code.
    1733
    183422 October 2010 Michael Kelsey (hadr-casc-V09-03-84)
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4Analyser.hh

    r1340 r1347  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
    25 // $Id: G4Analyser.hh,v 1.10 2010/10/14 20:55:10 mkelsey Exp $
     25//
     26// $Id: G4Analyser.hh,v 1.11 2010/12/15 07:39:28 gunter Exp $
    2627//
    2728// 20101010  M. Kelsey -- Migrate to integer A and Z
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4ExitonConfiguration.hh

    r1340 r1347  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
    25 // $Id: G4ExitonConfiguration.hh,v 1.7 2010/09/24 06:26:06 mkelsey Exp $
     25//
     26// $Id: G4ExitonConfiguration.hh,v 1.8 2010/12/15 07:39:50 gunter Exp $
    2627//
    2728// 20100909  Add function to reset values to zero
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4FissionStore.hh

    r1340 r1347  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
    25 // $Id: G4FissionStore.hh,v 1.11 2010/10/19 21:33:58 mkelsey Exp $
     25//
     26// $Id: G4FissionStore.hh,v 1.12 2010/12/15 07:39:52 gunter Exp $
    2627//
    2728// 20100728  Move ::addConfig() to .cc file, add setVerboseLevel(), clear()
  • trunk/source/processes/hadronic/models/cascade/cascade/src/G4CascadeKminusNChannel.cc

    r1340 r1347  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
    25 // $Id: G4CascadeKminusNChannel.cc,v 1.5 2010/08/04 05:28:24 mkelsey Exp $
     25//
     26// $Id: G4CascadeKminusNChannel.cc,v 1.6 2010/12/15 07:40:17 gunter Exp $
    2627//
    2728// 20100804  M. Kelsey -- Add name string to ctor
  • trunk/source/processes/hadronic/models/cascade/cascade/src/G4CascadeKminusPChannel.cc

    r1340 r1347  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
    25 // $Id: G4CascadeKminusPChannel.cc,v 1.5 2010/08/04 05:28:24 mkelsey Exp $
     25//
     26// $Id: G4CascadeKminusPChannel.cc,v 1.6 2010/12/15 07:40:19 gunter Exp $
    2627//
    2728// 20100804  M. Kelsey -- Add name string to ctor
  • trunk/source/processes/hadronic/models/cascade/cascade/src/G4CascadeKplusNChannel.cc

    r1340 r1347  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
    25 // $Id: G4CascadeKplusNChannel.cc,v 1.5 2010/08/04 05:28:24 mkelsey Exp $
     25//
     26// $Id: G4CascadeKplusNChannel.cc,v 1.6 2010/12/15 07:40:21 gunter Exp $
    2627//
    2728// 20100804  M. Kelsey -- Add name string to ctor
  • trunk/source/processes/hadronic/models/cascade/cascade/src/G4CascadeKplusPChannel.cc

    r1340 r1347  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
    25 // $Id: G4CascadeKplusPChannel.cc,v 1.5 2010/08/04 05:28:24 mkelsey Exp $
     25//
     26// $Id: G4CascadeKplusPChannel.cc,v 1.6 2010/12/15 07:40:23 gunter Exp $
    2627//
    2728// 20100804  M. Kelsey -- Add name string to ctor
  • trunk/source/processes/hadronic/models/cascade/cascade/src/G4CascadeKzeroBarPChannel.cc

    r1340 r1347  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
    25 // $Id: G4CascadeKzeroBarPChannel.cc,v 1.5 2010/08/04 05:28:24 mkelsey Exp $
     25//
     26// $Id: G4CascadeKzeroBarPChannel.cc,v 1.6 2010/12/15 07:40:25 gunter Exp $
    2627//
    2728// 20100804  M. Kelsey -- Add name string to ctor
  • trunk/source/processes/hadronic/models/cascade/cascade/src/G4CascadeKzeroNChannel.cc

    r1340 r1347  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
    25 // $Id: G4CascadeKzeroNChannel.cc,v 1.5 2010/08/04 05:28:24 mkelsey Exp $
     25//
     26// $Id: G4CascadeKzeroNChannel.cc,v 1.6 2010/12/15 07:40:27 gunter Exp $
    2627//
    2728// 20100804  M. Kelsey -- Add name string to ctor
  • trunk/source/processes/hadronic/models/cascade/cascade/src/G4CascadeKzeroPChannel.cc

    r1340 r1347  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
    25 // $Id: G4CascadeKzeroPChannel.cc,v 1.5 2010/08/04 05:28:24 mkelsey Exp $
     25//
     26// $Id: G4CascadeKzeroPChannel.cc,v 1.6 2010/12/15 07:40:29 gunter Exp $
    2627//
    2728// 20100804  M. Kelsey -- Add name string to ctor
  • trunk/source/processes/hadronic/models/cascade/cascade/src/G4CascadeLambdaNChannel.cc

    r1340 r1347  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
    25 // $Id: G4CascadeLambdaNChannel.cc,v 1.5 2010/08/04 05:28:24 mkelsey Exp $
     25//
     26// $Id: G4CascadeLambdaNChannel.cc,v 1.6 2010/12/15 07:40:31 gunter Exp $
    2627//
    2728// 20100804  M. Kelsey -- Add name string to ctor
  • trunk/source/processes/hadronic/models/cascade/cascade/src/G4CascadeLambdaPChannel.cc

    r1340 r1347  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
    25 // $Id: G4CascadeLambdaPChannel.cc,v 1.5 2010/08/04 05:28:24 mkelsey Exp $
     25//
     26// $Id: G4CascadeLambdaPChannel.cc,v 1.6 2010/12/15 07:40:33 gunter Exp $
    2627//
    2728// 20100804  M. Kelsey -- Add name string to ctor
  • trunk/source/processes/hadronic/models/cascade/cascade/src/G4CascadeSigmaMinusNChannel.cc

    r1340 r1347  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
    25 // $Id: G4CascadeSigmaMinusNChannel.cc,v 1.5 2010/08/04 05:28:24 mkelsey Exp $
     25//
     26// $Id: G4CascadeSigmaMinusNChannel.cc,v 1.6 2010/12/15 07:40:37 gunter Exp $
    2627//
    2728// 20100804  M. Kelsey -- Add name string to ctor
  • trunk/source/processes/hadronic/models/cascade/cascade/src/G4CascadeSigmaMinusPChannel.cc

    r1340 r1347  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
    25 // $Id: G4CascadeSigmaMinusPChannel.cc,v 1.5 2010/08/04 05:28:24 mkelsey Exp $
     25//
     26// $Id: G4CascadeSigmaMinusPChannel.cc,v 1.6 2010/12/15 07:40:39 gunter Exp $
    2627//
    2728// 20100804  M. Kelsey -- Add name string to ctor
  • trunk/source/processes/hadronic/models/cascade/cascade/src/G4CascadeSigmaPlusNChannel.cc

    r1340 r1347  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
    25 // $Id: G4CascadeSigmaPlusNChannel.cc,v 1.6 2010/08/04 05:28:24 mkelsey Exp $
     25//
     26// $Id: G4CascadeSigmaPlusNChannel.cc,v 1.7 2010/12/15 07:40:41 gunter Exp $
    2627//
    2728// 20100804  M. Kelsey -- Add name string to ctor
  • trunk/source/processes/hadronic/models/cascade/cascade/src/G4CascadeSigmaPlusPChannel.cc

    r1340 r1347  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
    25 // $Id: G4CascadeSigmaPlusPChannel.cc,v 1.5 2010/08/04 05:28:24 mkelsey Exp $
     25//
     26// $Id: G4CascadeSigmaPlusPChannel.cc,v 1.6 2010/12/15 07:40:43 gunter Exp $
    2627//
    2728// 20100804  M. Kelsey -- Add name string to ctor
  • trunk/source/processes/hadronic/models/cascade/cascade/src/G4CascadeSigmaZeroNChannel.cc

    r1340 r1347  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
    25 // $Id: G4CascadeSigmaZeroNChannel.cc,v 1.5 2010/08/04 05:28:24 mkelsey Exp $
     25//
     26// $Id: G4CascadeSigmaZeroNChannel.cc,v 1.6 2010/12/15 07:40:45 gunter Exp $
    2627//
    2728// 20100804  M. Kelsey -- Add name string to ctor
  • trunk/source/processes/hadronic/models/cascade/cascade/src/G4CascadeSigmaZeroPChannel.cc

    r1340 r1347  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
    25 // $Id: G4CascadeSigmaZeroPChannel.cc,v 1.5 2010/08/04 05:28:24 mkelsey Exp $
     25//
     26// $Id: G4CascadeSigmaZeroPChannel.cc,v 1.6 2010/12/15 07:40:47 gunter Exp $
    2627//
    2728// 20100804  M. Kelsey -- Add name string to ctor
  • trunk/source/processes/hadronic/models/cascade/cascade/src/G4CascadeXiMinusNChannel.cc

    r1340 r1347  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
    25 // $Id: G4CascadeXiMinusNChannel.cc,v 1.5 2010/08/04 05:28:24 mkelsey Exp $
     25//
     26// $Id: G4CascadeXiMinusNChannel.cc,v 1.6 2010/12/15 07:40:52 gunter Exp $
    2627//
    2728// 20100804  M. Kelsey -- Add name string to ctor
  • trunk/source/processes/hadronic/models/cascade/cascade/src/G4CascadeXiMinusPChannel.cc

    r1340 r1347  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
    25 // $Id: G4CascadeXiMinusPChannel.cc,v 1.5 2010/08/04 05:28:24 mkelsey Exp $
     25//
     26// $Id: G4CascadeXiMinusPChannel.cc,v 1.6 2010/12/15 07:40:54 gunter Exp $
    2627//
    2728// 20100804  M. Kelsey -- Add name string to ctor
  • trunk/source/processes/hadronic/models/cascade/cascade/src/G4CascadeXiZeroNChannel.cc

    r1340 r1347  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
    25 // $Id: G4CascadeXiZeroNChannel.cc,v 1.5 2010/08/04 05:28:24 mkelsey Exp $
     25//
     26// $Id: G4CascadeXiZeroNChannel.cc,v 1.6 2010/12/15 07:40:56 gunter Exp $
    2627//
    2728// 20100804  M. Kelsey -- Add name string to ctor
  • trunk/source/processes/hadronic/models/cascade/cascade/src/G4CascadeXiZeroPChannel.cc

    r1340 r1347  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
    25 // $Id: G4CascadeXiZeroPChannel.cc,v 1.5 2010/08/04 05:28:24 mkelsey Exp $
     25//
     26// $Id: G4CascadeXiZeroPChannel.cc,v 1.6 2010/12/15 07:40:59 gunter Exp $
    2627//
    2728// 20100804  M. Kelsey -- Add name string to ctor
  • trunk/source/processes/hadronic/models/cascade/cascade/src/G4FissionStore.cc

    r1340 r1347  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
    25 // $Id: G4FissionStore.cc,v 1.16 2010/10/19 21:33:58 mkelsey Exp $
     25//
     26// $Id: G4FissionStore.cc,v 1.17 2010/12/15 07:41:05 gunter Exp $
    2627//
    2728// 20100728  Move ::addConfig() implementation to .cc file
  • trunk/source/processes/hadronic/models/cascade/cascade/src/bindingEnergy.cc

    r1340 r1347  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
    25 // $Id: bindingEnergy.cc,v 1.10 2010/09/14 17:51:36 mkelsey Exp $
     25//
     26// $Id: bindingEnergy.cc,v 1.11 2010/12/15 07:41:25 gunter Exp $
    2627//
    2728// 20100622 M. Kelsey -- Replace all functionally with call-through to
  • trunk/source/processes/hadronic/models/cascade/cascade/src/nucleiLevelDensity.cc

    r1340 r1347  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
    25 // $Id: nucleiLevelDensity.cc,v 1.8 2010/09/14 17:51:36 mkelsey Exp $
     25//
     26// $Id: nucleiLevelDensity.cc,v 1.9 2010/12/15 07:41:27 gunter Exp $
    2627//
    2728// 20100914  M. Kelsey -- Migrate to integer A and Z; simplify code
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/History

    r1340 r1347  
    1818
    1919<<<<<<< History (please, make changes only with Mikhail.Kossov@cern.ch approval)
     20
     2121-Nov-2010 Dennis Wright                       (hadr-chips-V09-03-09)
     22----------------------------------------------------------------------
     23Overall CHIPS tag which includes integer Z and A conversion and some
     24correction of CoVerity errors
    2025
    212625-Jun-2010 M.Kosov                             (hadr-chips-V09-03-08)
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/History

    r1340 r1347  
    1717     -----------------------------------------------------------------
    1818
    19 23-Jun-2010 M.Kosov                           (hadr-chips-body-V09-03-13)
     1911 Nov 2010 Dennis Wright                   (hadr-chips-body-V09-03-15)
     20-----------------------------------------------------------------------
     21- G4QContent.cc : fix bug 1131 by removing dead code in quark ctor
     22  and remove dead code indicated by CoVerity in method MakePartonPair.
     23  Remove dead code due to efFlag being set permanently false.
     24- G4QNucleus.cc - remove dead code
     25- G4QEnvironment.cc - remove dead code
     26
     2710 Nov 2010 Dennis Wright                   (hadr-chips-body-V09-03-14)
     28-----------------------------------------------------------------------
     29Bring up to geant4-09-03-ref-09 and tag
     30 
     3123-Jun-2010 M.Kosov                         (hadr-chips-body-V09-03-13)
    2032-----------------------------------------------------------------------
    2133Using HARP data a big bug is fixed, which influences CHIPS physics
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/fragmentation/History

    r1337 r1347  
    44       ==========================================================
    55
    6 History file for  hadronic/models/chiral_inv_phase_space/fragmentation  directory.
     6History file for  hadronic/models/chiral_inv_phase_space/fragmentation 
     7directory.
    78       
    89Summarize all code modifications & keep track of all tags in this file.
     
    1314     -----------------------------------------------------------------
    1415
     1610 Nov 2010  Dennis Wright                  (hadr-chips-frag-V09-03-07)
     17-----------------------------------------------------------------------
     18Previous tag was already used - retag
     19
     2010 Nov 2010  Dennis Wright                       (hadr-chips-V09-03-07)
     21-----------------------------------------------------------------------
     22Bring up to geant4-09-03-ref-09 and tag
     23
    152419-Jun-2010 M.Kosov                             (hadr-chips-V09-03-06)
    16 -----------------------------------------------------------------------
     25----------------------------------------------------------------------
    1726Mutual CHIPS tag for the G4-9-4-beta debugging
    1827
    19 11-Jun-2010 M.Kosov                           (hadr-chips-frag-V09-03-05)
    20 --------------------------------------------------------------------------
     2811-Jun-2010 M.Kosov                         (hadr-chips-frag-V09-03-05)
     29-----------------------------------------------------------------------
    2130Trap and cure for the bug: return to vacuum what appeared from vacuum
    2231
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/History

    r1340 r1347  
    1212     * Please list in reverse chronological order (last date on top)
    1313     ---------------------------------------------------------------
     14
     1518-Nov-2010 J.Apostolakis                      (hadr-chips-inter-V09-03-03)
     16---------------------------------------------------------------------------
     17- G4ChiralInvariantPhaseSpace.cc: Change to use integer value of Z and A.
     18
     1910-Nov-2010 V.Ivanchenko                       (hadr-chips-inter-V09-03-02)
     20---------------------------------------------------------------------------
     21- G4ElectroNuclearReaction - cross section classes are included by pointer
     22  and not by value, this should not change any result but providing
     23  clear siquence of removel of cross sections after execution
     24  (fixed old problem reported in HyperNews)
    1425
    152613-Sep-2010 A. Dotti                           (hadr-chips-inter-V09-03-01)
  • trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/src/G4ChiralInvariantPhaseSpace.cc

    r1340 r1347  
    7272 
    7373  //target properties needed in constructor of quasmon
    74   G4int targetZ = G4int(aTargetNucleus.GetZ()+0.5);
    75   G4int targetA = G4int(aTargetNucleus.GetN()+0.5);
     74  G4int targetZ = aTargetNucleus.GetZ_asInt();
     75  G4int targetA = aTargetNucleus.GetA_asInt();
    7676  G4int targetPDGCode = 90000000 + 1000*targetZ + (targetA-targetZ);
    7777  // NOT NECESSARY ______________
  • trunk/source/processes/hadronic/models/coherent_elastic/History

    r1340 r1347  
    1414     * Please list in reverse chronological order (last date on top)
    1515     ---------------------------------------------------------------
     16
     1719 November 2010 - V.Ivanchenko (hadr-cohe-V09-03-07)
     18------------------------------------------------------
     19- G4WHadronElasticProcess, G4VHadronElastic, G4HadronElastic,
     20  G4ChargeExchange - fixed bug introduced in the previous tag -
     21    use now GetA_asInt() method instead of GetN_asInt()
     22
     2318 November 2010 - V.Ivanchenko (hadr-cohe-V09-03-06)
     24------------------------------------------------------
     25- G4NuclNuclDiffuseElastic - new model
     26- Use integer Z and A in other classes
    1627
    172828 September 2010 - G.Cosmo (hadr-cohe-V09-03-05)
  • trunk/source/processes/hadronic/models/de_excitation/History

    r1340 r1347  
    1414     * Please list in reverse chronological order (last date on top)
    1515     ---------------------------------------------------------------
     16
     1723 October 2010 Vladimir Ivanchenko (hadr-deex-V09-03-27)
     18----------------------------------------------------------
     19- G4Evaporation, G4EvaporationChannel, G4EvaporationProbability -
     20  improved computation of minimal and maximal evaporation energy
     21- G4E1Probability, G4PhotonEvaporation - fixed probability
     22
     2319 October 2010 Vladimir Ivanchenko (hadr-deex-V09-03-26)
     24----------------------------------------------------------
     25- G4ParaFissionModel - use GetA_asInt()
     26
     2718 October 2010 Vladimir Ivanchenko (hadr-deex-V09-03-25)
     28----------------------------------------------------------
     29G4GEMChannel - cleanup: integer Z,A; G4Pow; use the same formulas as in
     30  G4GEMProbability class
     31
     3217 October 2010 Vladimir Ivanchenko (hadr-deex-V09-03-24)
     33----------------------------------------------------------
     34- photon_evaporation, fission - integer Z and A, constructors
     35   moved to src, usage of G4Pow, general cleanup
     36- G4ContiniumGammaTransition - use exponential law for sampling of
     37                               decay time
     38- removed unused classes: G4DummyProbability, G4E1ProbabilityXXX,
     39  G4E1SingleProbabilityXXX, where XXX=001,01,1,10,100 - these classes
     40  are the same as the one really used but a scale factor for the
     41  probability is different, scale factor may be applied in the main
     42  class if needed
     43
     4417 October 2010 Vladimir Ivanchenko (hadr-deex-V09-03-23)
     45----------------------------------------------------------
     46- utils, management, evaporation - integer Z and A, constructors
     47   moved to src, usage of G4Pow, general cleanup
     48- G4EvaporationChannel - removed new and delete of probability objects
     49  at each to the class, use instead local G4EvaporationProbability
     50  of the channel
     51
     5229 October 2010 Vladimir Ivanchenko (hadr-deex-V09-03-22)
     53----------------------------------------------------------
     54- Fixed problems reported by the Coveruty tool (mainly pedantic
     55  initialisation); moved constructors and destructors to source
     56
     5712 October 2010 Dennis Wright (hadr-deex-V09-03-21)
     58---------------------------------------------------
     59- add Luciano Pandola's README file explaining the photo-evaporation
     60  data files
    1661
    176211 October 2010 Vladimir Ivanchenko (hadr-deex-V09-03-20)
  • trunk/source/processes/hadronic/models/de_excitation/ablation/src/G4WilsonAblationModel.cc

    r1228 r1347  
    150150  OPTxs   = 3;
    151151  useSICB = false;
     152  fragmentVector = 0;
    152153}
    153154////////////////////////////////////////////////////////////////////////////////
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/include/G4AlphaEvaporationChannel.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4AlphaEvaporationChannel.hh,v 1.8 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4AlphaEvaporationChannel.hh,v 1.9 2010/11/17 12:14:59 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
    3131// by V. Lara (Nov. 1999)
    3232//
     33// 17-11-2010 V.Ivanchenko moved constructor and destructor to source and cleanup
    3334
    3435#ifndef G4AlphaEvaporationChannel_h
     
    4344public:
    4445  // only available constructor
    45   G4AlphaEvaporationChannel() : G4EvaporationChannel(4,2,"alpha",
    46                                                      &theEvaporationProbability,&theCoulombBarrier) {};
     46  G4AlphaEvaporationChannel();
    4747
    4848  // destructor
    49   ~G4AlphaEvaporationChannel() {};
     49  virtual ~G4AlphaEvaporationChannel();
    5050
    5151private:
     
    5454  G4AlphaEvaporationChannel(const G4AlphaEvaporationChannel & right);
    5555
    56 
    57 public:
    5856  G4bool operator==(const G4AlphaEvaporationChannel & right) const;
    5957  G4bool operator!=(const G4AlphaEvaporationChannel & right) const;
    60 
    61 private:
    6258
    6359  G4AlphaCoulombBarrier theCoulombBarrier;     
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/include/G4AlphaEvaporationProbability.hh

    r962 r1347  
    2424// ********************************************************************
    2525//
    26 //J.M. Quesada (August2008). Based on:
     26// $Id: G4AlphaEvaporationProbability.hh,v 1.14 2010/11/17 11:06:03 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
     28//
     29// J.M. Quesada (August2008). Based on:
    2730//
    2831// Hadronic Process: Nuclear De-excitations
    2932// by V. Lara (Oct 1998)
     33//
     34// Modified:
     35// 17-11-2010 V.Ivanchenko integer Z and A
    3036//
    3137#ifndef G4AlphaEvaporationProbability_h
     
    4248  G4AlphaEvaporationProbability();
    4349
    44   ~G4AlphaEvaporationProbability() {}
     50  virtual ~G4AlphaEvaporationProbability();
     51
    4552private: 
    4653  // Copy constructor
     
    5158  G4bool operator!=(const G4AlphaEvaporationProbability &right) const;
    5259
    53 
    5460private:
    5561
    56   virtual G4double CrossSection(const  G4Fragment & fragment, const  G4double K);
     62  virtual G4double CrossSection(const  G4Fragment & fragment, G4double K);
    5763
    58   G4double GetOpt0(const G4double K);
    59   G4double GetOpt12(const G4double K);
    60   G4double GetOpt34(const G4double K);
     64  G4double GetOpt0(G4double K);
     65  G4double GetOpt12(G4double K);
     66  G4double GetOpt34(G4double K);
     67 
     68  virtual G4double CalcAlphaParam(const G4Fragment & fragment) ;
     69 
     70  virtual G4double CalcBetaParam(const G4Fragment & fragment)  ;
     71 
     72  G4double CCoeficient(G4int aZ) ;
     73 
     74  //data members
     75   
     76  G4AlphaCoulombBarrier theCoulombBarrier;
    6177
    62  
    63  virtual G4double CalcAlphaParam(const G4Fragment & fragment) ;
    64  
    65  virtual G4double CalcBetaParam(const G4Fragment & fragment)  ;
    66  
    67   G4double CCoeficient(const G4double aZ) ;
    68  
    69 //data members
    70    
    71       G4AlphaCoulombBarrier theCoulombBarrier;
    72 
    73       G4double ResidualA;
    74       G4double ResidualZ;
    75       G4double theA;
    76       G4double theZ;
    77       G4double ResidualAthrd;
    78       G4double FragmentA;
    79       G4double FragmentAthrd;
    80 
     78  G4int ResidualA;
     79  G4int ResidualZ;
     80  G4int theA;
     81  G4int theZ;
     82  G4double ResidualAthrd;
     83  G4int FragmentA;
     84  G4double FragmentAthrd;
    8185
    8286};
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/include/G4DeuteronEvaporationChannel.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4DeuteronEvaporationChannel.hh,v 1.8 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4DeuteronEvaporationChannel.hh,v 1.9 2010/11/17 12:14:59 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
    3131// by V. Lara (Nov. 1999)
    3232//
     33// 17-11-2010 V.Ivanchenko moved constructor and destructor to source and cleanup
    3334
    3435#ifndef G4DeuteronEvaporationChannel_h
     
    4344public:
    4445  // only available constructor
    45   G4DeuteronEvaporationChannel() : G4EvaporationChannel(2,1,"deuteron",
    46                                                         &theEvaporationProbability,&theCoulombBarrier) {};
     46  G4DeuteronEvaporationChannel();
    4747
    4848  // destructor
    49   ~G4DeuteronEvaporationChannel() {};
     49  virtual ~G4DeuteronEvaporationChannel();
    5050
    5151private:
     
    5454  G4DeuteronEvaporationChannel(const G4DeuteronEvaporationChannel & right);
    5555
    56 public:
    5756  G4bool operator==(const G4DeuteronEvaporationChannel & right) const;
    5857  G4bool operator!=(const G4DeuteronEvaporationChannel & right) const;
    59 
    60 private:
    6158
    6259  G4DeuteronCoulombBarrier theCoulombBarrier;
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/include/G4DeuteronEvaporationProbability.hh

    r962 r1347  
    2424// ********************************************************************
    2525//
    26 //J.M. Quesada (August2008). Based on:
     26// $Id: G4DeuteronEvaporationProbability.hh,v 1.14 2010/11/17 11:06:03 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
     28//
     29// J.M. Quesada (August2008). Based on:
    2730//
    2831// Hadronic Process: Nuclear De-excitations
    2932// by V. Lara (Oct 1998)
     33//
     34// Modified:
     35// 17-11-2010 V.Ivanchenko integer Z and A
    3036//
    3137
     
    4349  G4DeuteronEvaporationProbability();
    4450
    45   ~G4DeuteronEvaporationProbability() {}
     51  virtual ~G4DeuteronEvaporationProbability();
     52
    4653private: 
    4754  // Copy constructor
     
    5562private:
    5663
    57   virtual G4double CrossSection(const  G4Fragment & fragment, const  G4double K);
     64  virtual G4double CrossSection(const  G4Fragment & fragment, G4double K);
    5865
    59   G4double GetOpt0(const G4double K);
    60   G4double GetOpt12(const G4double K);
    61   G4double GetOpt34(const G4double K);
     66  G4double GetOpt0(G4double K);
     67  G4double GetOpt12(G4double K);
     68  G4double GetOpt34(G4double K);
    6269
     70  virtual G4double CalcAlphaParam(const G4Fragment & fragment) ;
     71 
     72  virtual G4double CalcBetaParam(const G4Fragment & fragment) ;
     73 
     74  G4double CCoeficient(G4int aZ) ;
    6375 
    64  virtual G4double CalcAlphaParam(const G4Fragment & fragment) ;
    65  
    66  virtual G4double CalcBetaParam(const G4Fragment & fragment) ;
    67  
    68   G4double CCoeficient(const G4double aZ) ;
    69  
    70 //data members
     76  //data members
    7177
    72       G4DeuteronCoulombBarrier theCoulombBarrier;
     78  G4DeuteronCoulombBarrier theCoulombBarrier;
    7379
    74       G4double ResidualA;
    75       G4double ResidualZ;
    76       G4double theA;
    77       G4double theZ;
    78       G4double ResidualAthrd;
    79       G4double FragmentA;
    80       G4double FragmentAthrd;
    81 
    82 
     80  G4int ResidualA;
     81  G4int ResidualZ;
     82  G4int theA;
     83  G4int theZ;
     84  G4double ResidualAthrd;
     85  G4int FragmentA;
     86  G4double FragmentAthrd;
    8387};
    8488
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/include/G4Evaporation.hh

    r1340 r1347  
    2626//
    2727// $Id: G4Evaporation.hh,v 1.12 2010/05/11 11:34:09 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/include/G4EvaporationChannel.hh

    r962 r1347  
    2424// ********************************************************************
    2525//
     26// $Id: G4EvaporationChannel.hh,v 1.11 2010/11/17 12:19:08 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
     28//
     29//
    2630//J.M. Quesada (August2008). Based on:
    2731//
     
    2933// by V. Lara (Oct 1998)
    3034//
    31 
     35// 17-11-2010 V.Ivanchenko in constructor replace G4VEmissionProbability by
     36//            G4EvaporationProbability and do not new and delete probability
     37//            object at each call; use G4Pow
    3238
    3339#ifndef G4EvaporationChannel_h
     
    3541
    3642#include "G4VEvaporationChannel.hh"
    37 #include "G4VEmissionProbability.hh"
    3843#include "G4EvaporationProbability.hh"
    39 #include "G4NeutronEvaporationProbability.hh"
    40 #include "G4ProtonEvaporationProbability.hh"
    41 #include "G4DeuteronEvaporationProbability.hh"
    42 #include "G4TritonEvaporationProbability.hh"
    43 #include "G4He3EvaporationProbability.hh"
    44 #include "G4AlphaEvaporationProbability.hh"
    45 #include "G4VLevelDensityParameter.hh"
    4644#include "G4VCoulombBarrier.hh"
    47 #include "G4EvaporationLevelDensityParameter.hh"
    48 #include "G4NucleiProperties.hh"
    49 #include "Randomize.hh"
    50 #include "G4ParticleTable.hh"
    51 #include "G4IonTable.hh"
    5245
     46class G4EvaporationLevelDensityParameter;
    5347
    5448class G4EvaporationChannel : public G4VEvaporationChannel
     
    5650public:
    5751  // constructor
    58 
    59 
    60   G4EvaporationChannel(const G4int theA, const G4int theZ, const G4String & aName,
    61                        G4VEmissionProbability * aEmissionStrategy,
     52  G4EvaporationChannel(G4int theA, G4int theZ, const G4String & aName,
     53                       G4EvaporationProbability * aEmissionStrategy,
    6254                       G4VCoulombBarrier * aCoulombBarrier);
    6355public:
    6456  // destructor
    65   ~G4EvaporationChannel();
     57  virtual ~G4EvaporationChannel();
    6658 
    67   void SetEmissionStrategy(G4VEmissionProbability * aEmissionStrategy)
     59  inline void SetEmissionStrategy(G4EvaporationProbability * aEmissionStrategy)
    6860  {theEvaporationProbabilityPtr = aEmissionStrategy;}
    6961
    70   void SetCoulombBarrierStrategy(G4VCoulombBarrier * aCoulombBarrier)
     62  inline void SetCoulombBarrierStrategy(G4VCoulombBarrier * aCoulombBarrier)
    7163  {theCoulombBarrierPtr = aCoulombBarrier;}
    72  
    73 
    74  
     64   
    7565protected:
    7666  // default constructor
    77   G4EvaporationChannel() {};
     67  G4EvaporationChannel();
    7868 
    7969private:
     
    9383  G4FragmentVector * BreakUp(const G4Fragment & theNucleus);
    9484
    95   // void SetLevelDensityParameter(G4VLevelDensityParameter * aLevelDensity);
    96  
    9785public:
    98 
    9986
    10087  inline G4double GetEmissionProbability(void) const
    10188  {return EmissionProbability;}
    102  
    103  
     89   
    10490  inline G4double GetMaximalKineticEnergy(void) const
    10591  { return MaximalKineticEnergy; }
     
    10894 
    10995  // Calculate Binding Energy for separate fragment from nucleus
    110   G4double CalcBindingEnergy(const G4int anA, const G4int aZ);
     96  G4double CalcBindingEnergy(G4int anA, G4int aZ);
    11197
    11298  // Calculate maximal kinetic energy that can be carried by fragment (in MeV)
    113   G4double CalcMaximalKineticEnergy(const G4double U);
     99  G4double CalcMaximalKineticEnergy(G4double U);
    114100
    115101  // Samples fragment kinetic energy.
    116     G4double  GetKineticEnergy(const G4Fragment & aFragment);
     102  G4double  GetKineticEnergy(const G4Fragment & aFragment);
    117103
    118104  // This has to be removed and put in Random Generator
    119   G4ThreeVector IsotropicVector(const G4double Magnitude  = 1.0);
     105  G4ThreeVector IsotropicVector(G4double Magnitude  = 1.0);
    120106
    121107        // Data Members
     
    132118  G4int theZ;
    133119
     120  G4double EvaporatedMass;
     121  G4double ResidualMass;
    134122
    135123  // For evaporation probability calcualation
    136   G4VEmissionProbability * theEvaporationProbabilityPtr;
     124  G4EvaporationProbability * theEvaporationProbabilityPtr;
    137125
    138126  // For Level Density calculation
    139  // G4bool MyOwnLevelDensity;
     127  // G4bool MyOwnLevelDensity;
    140128  G4VLevelDensityParameter * theLevelDensityPtr;
    141 
    142129
    143130  // For Coulomb Barrier calculation
    144131  G4VCoulombBarrier * theCoulombBarrierPtr;
    145132  G4double CoulombBarrier;
    146  
    147  
     133   
    148134  //---------------------------------------------------
    149135
     
    161147  G4double EmissionProbability;
    162148
    163 
    164149  // Maximal Kinetic Energy that can be carried by fragment
    165150  G4double MaximalKineticEnergy;
    166 
    167151
    168152};
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/include/G4EvaporationDefaultGEMFactory.hh

    r1340 r1347  
    2626//
    2727// $Id: G4EvaporationDefaultGEMFactory.hh,v 1.1 2009/07/27 10:20:13 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/include/G4EvaporationFactory.hh

    r1340 r1347  
    2626//
    2727// $Id: G4EvaporationFactory.hh,v 1.4 2010/04/27 11:43:16 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/include/G4EvaporationProbability.hh

    r962 r1347  
    2424// ********************************************************************
    2525//
     26// $Id: G4EvaporationProbability.hh,v 1.13 2010/11/17 11:06:03 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
     28//
    2629//J.M. Quesada (August2008). Based on:
    2730//
     
    4447public:
    4548  // Only available constructor
    46   G4EvaporationProbability(const G4int anA, const G4int aZ, const G4double aGamma,G4VCoulombBarrier * aCoulombBarrier) :
    47     theA(anA),
    48     theZ(aZ),
    49     Gamma(aGamma)
    50 ,  theCoulombBarrierptr(aCoulombBarrier)
    51   {
    52     theEvapLDPptr = new G4EvaporationLevelDensityParameter;
     49  G4EvaporationProbability(G4int anA, G4int aZ, G4double aGamma,
     50                           G4VCoulombBarrier * aCoulombBarrier);
    5351
    54    
    55   }
     52  virtual ~G4EvaporationProbability();
    5653
    57   ~G4EvaporationProbability()
    58   {
    59     if (theEvapLDPptr != 0) delete theEvapLDPptr;
    60 
    61   }
    62 
    63 
     54  inline G4int GetZ(void) const { return theZ; }
    6455       
    65   G4double GetZ(void) const { return theZ; }
    66        
    67   G4double GetA(void) const { return theA;}
     56  inline G4int GetA(void) const { return theA;}
    6857
    6958protected:
    7059 
    7160  // Default constructor
    72   G4EvaporationProbability() {}
     61  G4EvaporationProbability();
    7362
    7463private:
     
    8271public:
    8372
    84  G4double ProbabilityDistributionFunction( const G4Fragment & aFragment, const G4double K);
     73  G4double ProbabilityDistributionFunction( const G4Fragment & aFragment, G4double K);
    8574
    86  G4double EmissionProbability(const G4Fragment & fragment, const G4double anEnergy);
     75  G4double EmissionProbability(const G4Fragment & fragment, G4double anEnergy);
    8776
    8877private:
    8978
    90   G4double CalculateProbability(const G4Fragment & fragment, const G4double MaximalKineticEnergy );
     79  G4double CalculateProbability(const G4Fragment & fragment, G4double MaximalKineticEnergy );
    9180
    92   G4double IntegrateEmissionProbability(const G4Fragment & aFragment, const G4double & Low, const G4double & Up );
     81  G4double IntegrateEmissionProbability(const G4Fragment & aFragment,
     82                                        const G4double & Low, const G4double & Up );
    9383
    9484protected:
    9585
    96  virtual G4double CrossSection( const  G4Fragment & fragment, const G4double K )= 0; 
     86 virtual G4double CrossSection( const  G4Fragment & fragment, G4double K )= 0; 
    9787
    9888 virtual G4double CalcAlphaParam(const G4Fragment & fragment)=0 ;
     
    10292private:
    10393
    104   // Data Members
    105 
    106   G4VLevelDensityParameter * theEvapLDPptr;
    107        
     94  // Data Members       
    10895  G4int theA;
    10996  G4int theZ;
     
    113100  G4double Gamma;
    114101
    115 //The Coulomb Barrier
    116          G4VCoulombBarrier * theCoulombBarrierptr;
    117 
     102  //The Coulomb Barrier
     103  G4VCoulombBarrier * theCoulombBarrierptr;
    118104
    119105};
    120106
    121 
    122 
    123 
    124107#endif
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/include/G4He3EvaporationChannel.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4He3EvaporationChannel.hh,v 1.8 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4He3EvaporationChannel.hh,v 1.9 2010/11/17 12:14:59 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
    3131// by V. Lara (Nov. 1999)
    3232//
     33// 17-11-2010 V.Ivanchenko moved constructor and destructor to source and cleanup
    3334
    3435#ifndef G4He3EvaporationChannel_h
     
    4344public:
    4445  // only available constructor
    45   G4He3EvaporationChannel() : G4EvaporationChannel(3,2,"He3",
    46                                                    &theEvaporationProbability,&theCoulombBarrier) {};
     46  G4He3EvaporationChannel();
    4747
    4848  // destructor
    49   ~G4He3EvaporationChannel() {};
     49  virtual ~G4He3EvaporationChannel();
    5050
    5151private:
     52
    5253  const G4He3EvaporationChannel & operator=(const G4He3EvaporationChannel & right); 
    5354
    5455  G4He3EvaporationChannel(const G4He3EvaporationChannel & right);
    5556
    56 public:
    5757  G4bool operator==(const G4He3EvaporationChannel & right) const;
    5858  G4bool operator!=(const G4He3EvaporationChannel & right) const;
    5959
    60 private:
    61 
    62     G4He3CoulombBarrier theCoulombBarrier;
     60  G4He3CoulombBarrier theCoulombBarrier;
    6361       
    6462  G4He3EvaporationProbability theEvaporationProbability;
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/include/G4He3EvaporationProbability.hh

    r962 r1347  
    2424// ********************************************************************
    2525//
    26 //J.M. Quesada (August2008). Based on:
     26// $Id: G4He3EvaporationProbability.hh,v 1.14 2010/11/17 11:06:03 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
     28//
     29// J.M. Quesada (August2008). Based on:
    2730//
    2831// Hadronic Process: Nuclear De-excitations
    2932// by V. Lara (Oct 1998)
     33//
     34// Modified:
     35// 17-11-2010 V.Ivanchenko integer Z and A
    3036//
    3137#ifndef G4He3EvaporationProbability_h
     
    4248  G4He3EvaporationProbability();
    4349
    44   ~G4He3EvaporationProbability() {}
     50  virtual ~G4He3EvaporationProbability();
     51
    4552private: 
    4653  // Copy constructor
     
    5158  G4bool operator!=(const G4He3EvaporationProbability &right) const;
    5259
    53 
    5460private:
    5561
    56   virtual G4double CrossSection(const  G4Fragment & fragment, const  G4double K);
     62  virtual G4double CrossSection(const  G4Fragment & fragment, G4double K);
    5763
    58   G4double GetOpt0(const G4double K);
    59   G4double GetOpt12(const G4double K);
    60   G4double GetOpt34(const G4double K);
     64  G4double GetOpt0(G4double K);
     65  G4double GetOpt12(G4double K);
     66  G4double GetOpt34(G4double K);
    6167
     68  virtual G4double CalcAlphaParam(const G4Fragment & fragment) ;
     69 
     70  virtual G4double CalcBetaParam(const G4Fragment & fragment) ;
     71 
     72  G4double CCoeficient(G4int aZ) ;
    6273 
    63  virtual G4double CalcAlphaParam(const G4Fragment & fragment) ;
    64  
    65  virtual G4double CalcBetaParam(const G4Fragment & fragment) ;
    66  
    67   G4double CCoeficient(const G4double aZ) ;
    68  
    69 //data members
     74  //data members
    7075   
    71       G4He3CoulombBarrier theCoulombBarrier;
     76  G4He3CoulombBarrier theCoulombBarrier;
    7277
    73       G4double ResidualA;
    74       G4double ResidualZ;
    75       G4double theA;
    76       G4double theZ;
    77       G4double ResidualAthrd;
    78       G4double FragmentA;
    79       G4double FragmentAthrd;
    80 
    81 
     78  G4int ResidualA;
     79  G4int ResidualZ;
     80  G4int theA;
     81  G4int theZ;
     82  G4double ResidualAthrd;
     83  G4int FragmentA;
     84  G4double FragmentAthrd;
    8285};
    8386
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/include/G4NeutronEvaporationChannel.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4NeutronEvaporationChannel.hh,v 1.8 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4NeutronEvaporationChannel.hh,v 1.9 2010/11/17 12:14:59 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
    3131// by V. Lara (Nov. 1999)
    3232//
     33// 17-11-2010 V.Ivanchenko moved constructor and destructor to source and cleanup
    3334
    3435#ifndef G4NeutronEvaporationChannel_h
     
    4344public:
    4445  // only available constructor
    45   G4NeutronEvaporationChannel() : G4EvaporationChannel(1,0,"neutron",
    46                                                        &theEvaporationProbability,&theCoulombBarrier) {};
     46  G4NeutronEvaporationChannel();
    4747
    4848  // destructor
    49   ~G4NeutronEvaporationChannel() {};
     49  virtual ~G4NeutronEvaporationChannel();
    5050
    5151private:
     52
    5253  const G4NeutronEvaporationChannel & operator=(const G4NeutronEvaporationChannel & right); 
    5354
    5455  G4NeutronEvaporationChannel(const G4NeutronEvaporationChannel & right);
    5556
    56 public:
    5757  G4bool operator==(const G4NeutronEvaporationChannel & right) const;
    5858  G4bool operator!=(const G4NeutronEvaporationChannel & right) const;
    5959
    60 private:
    61 
    62  G4NeutronCoulombBarrier theCoulombBarrier;
     60  G4NeutronCoulombBarrier theCoulombBarrier;
    6361       
    6462  G4NeutronEvaporationProbability theEvaporationProbability;
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/include/G4NeutronEvaporationProbability.hh

    r962 r1347  
    2424// ********************************************************************
    2525//
    26 //J.M. Quesada (August2008). Based on:
     26// $Id: G4NeutronEvaporationProbability.hh,v 1.15 2010/11/17 11:06:03 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
     28//
     29// J.M. Quesada (August2008). Based on:
    2730//
    2831// Hadronic Process: Nuclear De-excitations
    2932// by V. Lara (Oct 1998)
     33//
     34// Modified:
     35// 17-11-2010 V.Ivanchenko integer Z and A
    3036//
    3137
     
    4349  G4NeutronEvaporationProbability();
    4450               
    45   ~G4NeutronEvaporationProbability() {}
     51  virtual ~G4NeutronEvaporationProbability();
     52
    4653private: 
    4754 
     
    5461private:
    5562
    56   virtual G4double CrossSection(const  G4Fragment & fragment, const  G4double K);
     63  virtual G4double CrossSection(const  G4Fragment & fragment, G4double K);
    5764
    58   G4double GetOpt12(const G4double K);
    59   G4double GetOpt34(const G4double K);
     65  G4double GetOpt12(G4double K);
     66  G4double GetOpt34(G4double K);
    6067
    61  virtual G4double CalcAlphaParam(const G4Fragment & fragment);
     68  virtual G4double CalcAlphaParam(const G4Fragment & fragment);
    6269 
    63  virtual G4double CalcBetaParam(const G4Fragment & fragment);
     70  virtual G4double CalcBetaParam(const G4Fragment & fragment);
    6471 
    65  
    66 //data members
     72  //data members
    6773
    68       G4NeutronCoulombBarrier theCoulombBarrier;
     74  G4NeutronCoulombBarrier theCoulombBarrier;
    6975
    70       G4double ResidualA;
    71       G4double ResidualZ;
    72       G4double theA;
    73       G4double theZ;
    74       G4double ResidualAthrd;
    75       G4double FragmentA;
    76       G4double FragmentAthrd;
    77 
    78 
    79 
    80 
     76  G4int ResidualA;
     77  G4int ResidualZ;
     78  G4int theA;
     79  G4int theZ;
     80  G4double ResidualAthrd;
     81  G4int FragmentA;
     82  G4double FragmentAthrd;
    8183};
    8284
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/include/G4ProtonEvaporationChannel.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4ProtonEvaporationChannel.hh,v 1.8 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4ProtonEvaporationChannel.hh,v 1.9 2010/11/17 12:14:59 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
    3131// by V. Lara (Nov. 1999)
    3232//
     33// 17-11-2010 V.Ivanchenko moved constructor and destructor to source and cleanup
    3334
    3435#ifndef G4ProtonEvaporationChannel_h
     
    4344public:
    4445  // only available constructor
    45   G4ProtonEvaporationChannel() : G4EvaporationChannel(1,1,"proton",
    46                                                       &theEvaporationProbability,&theCoulombBarrier) {};
     46  G4ProtonEvaporationChannel();
    4747
    4848  // destructor
    49   ~G4ProtonEvaporationChannel() {};
     49  virtual ~G4ProtonEvaporationChannel();
    5050
    5151private:
     52
    5253  const G4ProtonEvaporationChannel & operator=(const G4ProtonEvaporationChannel & right); 
    5354
    5455  G4ProtonEvaporationChannel(const G4ProtonEvaporationChannel & right);
    5556
    56 public:
    5757  G4bool operator==(const G4ProtonEvaporationChannel & right) const;
    5858  G4bool operator!=(const G4ProtonEvaporationChannel & right) const;
    5959
    60 
    61 private:
    62 
    63    G4ProtonCoulombBarrier  theCoulombBarrier;
     60  G4ProtonCoulombBarrier  theCoulombBarrier;
    6461 
    6562  G4ProtonEvaporationProbability  theEvaporationProbability;
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/include/G4ProtonEvaporationProbability.hh

    r962 r1347  
    2424// ********************************************************************
    2525//
    26 //J.M. Quesada (August2008). Based on:
     26// $Id: G4ProtonEvaporationProbability.hh,v 1.14 2010/11/17 11:06:03 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
     28//
     29// J.M. Quesada (August2008). Based on:
    2730//
    2831// Hadronic Process: Nuclear De-excitations
    2932// by V. Lara (Oct 1998)
     33//
     34// Modified:
     35// 17-11-2010 V.Ivanchenko integer Z and A
    3036//
    3137
     
    4349  G4ProtonEvaporationProbability();
    4450
    45   ~G4ProtonEvaporationProbability() {}
     51  virtual ~G4ProtonEvaporationProbability();
     52
    4653private: 
    4754  // Copy constructor
     
    5259  G4bool operator!=(const G4ProtonEvaporationProbability &right) const;
    5360
    54 
    5561private:
    5662
    57   virtual G4double CrossSection(const  G4Fragment & fragment, const  G4double K);
     63  virtual G4double CrossSection(const  G4Fragment & fragment, G4double K);
    5864
    59   G4double GetOpt0(const G4double K);
    60   G4double GetOpt1(const G4double K);
    61   G4double GetOpt2(const G4double K);
    62   G4double GetOpt3(const G4double K);
     65  G4double GetOpt0(G4double K);
     66  G4double GetOpt1(G4double K);
     67  G4double GetOpt2(G4double K);
     68  G4double GetOpt3(G4double K);
    6369
     70  virtual G4double CalcAlphaParam(const G4Fragment & fragment)  ;
     71 
     72  virtual G4double CalcBetaParam(const G4Fragment & fragment) ;
     73 
     74  G4double CCoeficient(G4int aZ) ;
    6475 
    65  virtual G4double CalcAlphaParam(const G4Fragment & fragment)  ;
    66  
    67  virtual G4double CalcBetaParam(const G4Fragment & fragment) ;
    68  
    69   G4double CCoeficient(const G4double aZ) ;
    70  
    71 //data members
     76  //data members
    7277
    73       G4ProtonCoulombBarrier theCoulombBarrier;
     78  G4ProtonCoulombBarrier theCoulombBarrier;
    7479
    75       G4double ResidualA;
    76       G4double ResidualZ;
    77       G4double theA;
    78       G4double theZ;
    79       G4double ResidualAthrd;
    80       G4double FragmentA;
    81       G4double FragmentAthrd;
    82       G4double U;
    83 
    84 
    85 
     80  G4int ResidualA;
     81  G4int ResidualZ;
     82  G4int theA;
     83  G4int theZ;
     84  G4double ResidualAthrd;
     85  G4int FragmentA;
     86  G4double FragmentAthrd;
     87  G4double U;
    8688
    8789};
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/include/G4TritonEvaporationChannel.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4TritonEvaporationChannel.hh,v 1.8 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4TritonEvaporationChannel.hh,v 1.9 2010/11/17 12:14:59 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
    3131// by V. Lara (Nov. 1999)
    3232//
     33// 17-11-2010 V.Ivanchenko moved constructor and destructor to source and cleanup
    3334
    3435#ifndef G4TritonEvaporationChannel_h
     
    4344public:
    4445  // only available constructor
    45   G4TritonEvaporationChannel() : G4EvaporationChannel(3,1,"triton",
    46                                                       &theEvaporationProbability,&theCoulombBarrier) {};
     46  G4TritonEvaporationChannel();
    4747
    4848  // destructor
    49   ~G4TritonEvaporationChannel() {};
     49  virtual ~G4TritonEvaporationChannel();
    5050
    5151private:
     
    5454  G4TritonEvaporationChannel(const G4TritonEvaporationChannel & right);
    5555
    56 public:
    5756  G4bool operator==(const G4TritonEvaporationChannel & right) const;
    5857  G4bool operator!=(const G4TritonEvaporationChannel & right) const;
    59 
    60 private:
    6158
    6259  G4TritonCoulombBarrier theCoulombBarrier;
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/include/G4TritonEvaporationProbability.hh

    r962 r1347  
    2424// ********************************************************************
    2525//
    26 //J.M. Quesada (August2008). Based on:
     26// $Id: G4TritonEvaporationProbability.hh,v 1.14 2010/11/17 11:06:03 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
     28//
     29// J.M. Quesada (August2008). Based on:
    2730//
    2831// Hadronic Process: Nuclear De-excitations
    2932// by V. Lara (Oct 1998)
    3033//
     34// Modified:
     35// 17-11-2010 V.Ivanchenko integer Z and A
     36
     37
    3138#ifndef G4TritonEvaporationProbability_h
    3239#define G4TritonEvaporationProbability_h 1
     
    4249  G4TritonEvaporationProbability();
    4350
    44   ~G4TritonEvaporationProbability() {}
     51  virtual ~G4TritonEvaporationProbability();
     52
    4553private: 
    4654  // Copy constructor
     
    5462private:
    5563
    56   virtual G4double CrossSection(const  G4Fragment & fragment, const G4double K);
     64  virtual G4double CrossSection(const G4Fragment & fragment, G4double K);
    5765
    58   G4double GetOpt0(const G4double K);
    59   G4double GetOpt12(const G4double K);
    60   G4double GetOpt34(const G4double K);
     66  G4double GetOpt0(G4double K);
     67  G4double GetOpt12(G4double K);
     68  G4double GetOpt34(G4double K);
    6169
    6270 
    63  virtual G4double CalcAlphaParam(const G4Fragment & fragment)  ;
     71  virtual G4double CalcAlphaParam(const G4Fragment & fragment)  ;
    6472 
    65  virtual G4double CalcBetaParam(const G4Fragment & fragment)  ;
     73  virtual G4double CalcBetaParam(const G4Fragment & fragment)  ;
    6674 
    67   G4double CCoeficient(const G4double aZ) ;
     75  G4double CCoeficient(G4int aZ) ;
    6876 
    69 //data members
     77  //data members
     78     
     79  G4TritonCoulombBarrier theCoulombBarrier;
    7080
    71      
    72       G4TritonCoulombBarrier theCoulombBarrier;
    73 
    74       G4double ResidualA;
    75       G4double ResidualZ;
    76       G4double theA;
    77       G4double theZ;
    78       G4double ResidualAthrd;
    79       G4double FragmentA;
    80       G4double FragmentAthrd;
    81 
     81  G4int ResidualA;
     82  G4int ResidualZ;
     83  G4int theA;
     84  G4int theZ;
     85  G4double ResidualAthrd;
     86  G4int FragmentA;
     87  G4double FragmentAthrd;
    8288
    8389};
    8490
    85 
    8691#endif
    8792
    88 
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/include/G4UnstableFragmentBreakUp.hh

    r1340 r1347  
    2525//
    2626// $Id: G4UnstableFragmentBreakUp.hh,v 1.2 2010/05/11 11:26:15 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2828//
    2929// -------------------------------------------------------------------
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/include/G4VEvaporation.hh

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4VEvaporation.hh,v 1.6 2010/04/27 14:00:40 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     26// $Id: G4VEvaporation.hh,v 1.8 2010/11/17 11:06:03 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2928//
    3029// Hadronic Process: Nuclear De-excitations
     
    6665  // for superimposed Coulomb Barrier for inverse cross sections       
    6766  inline void UseSICB(G4bool use) { useSICB = use; }   
     67
    6868protected:
    69    G4int OPTxs;
    70    G4bool useSICB;
     69  G4int OPTxs;
     70  G4bool useSICB;
    7171
    7272};
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/src/G4AlphaEvaporationChannel.cc

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4AlphaEvaporationChannel.cc,v 1.4 2006/06/29 20:10:17 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4AlphaEvaporationChannel.cc,v 1.5 2010/11/17 12:14:59 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
    3131// by V. Lara (Nov. 1999)
    3232//
     33// 17-11-2010 V.Ivanchenko moved constructor and destructor to source and cleanup
    3334
    3435#include "G4AlphaEvaporationChannel.hh"
    3536
     37G4AlphaEvaporationChannel::G4AlphaEvaporationChannel()
     38: G4EvaporationChannel(4,2,"alpha",&theEvaporationProbability,&theCoulombBarrier)
     39{}
    3640
    37 const G4AlphaEvaporationChannel & G4AlphaEvaporationChannel::operator=(const G4AlphaEvaporationChannel & )
    38 {
    39   throw G4HadronicException(__FILE__, __LINE__, "G4AlphaEvaporationChannel::operator= meant to not be accessable");
    40   return *this;
    41 }
     41G4AlphaEvaporationChannel::~G4AlphaEvaporationChannel()
     42{}
    4243
    43 G4AlphaEvaporationChannel::G4AlphaEvaporationChannel(const G4AlphaEvaporationChannel & ) : G4EvaporationChannel()
    44 {
    45   throw G4HadronicException(__FILE__, __LINE__, "G4AlphaEvaporationChannel::CopyConstructor meant to not be accessable");
    46 }
    47 
    48 G4bool G4AlphaEvaporationChannel::operator==(const G4AlphaEvaporationChannel &right ) const
    49 {
    50   return (this == (G4AlphaEvaporationChannel *) &right);
    51   //  return false;
    52 }
    53 
    54 G4bool G4AlphaEvaporationChannel::operator!=(const G4AlphaEvaporationChannel &right ) const
    55 {
    56   return (this != (G4AlphaEvaporationChannel *) &right);
    57   //  return true;
    58 }
    59 
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/src/G4AlphaEvaporationProbability.cc

    r1315 r1347  
    2424// ********************************************************************
    2525//
    26 //J.M. Quesada (August2008). Based on:
     26// $Id: G4AlphaEvaporationProbability.cc,v 1.18 2010/11/17 11:06:03 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
     28//
     29// J.M. Quesada (August2008). Based on:
    2730//
    2831// Hadronic Process: Nuclear De-excitations
    2932// by V. Lara (Oct 1998)
    3033//
    31 // Modif (03 September 2008) by J. M. Quesada for external choice of inverse
    32 // cross section option
     34// Modified:
     35// 03-09-2008 J.M. Quesada for external choice of inverse cross section option
     36// 17-11-2010 V.Ivanchenko integer Z and A
    3337
    3438#include "G4AlphaEvaporationProbability.hh"
     
    3640G4AlphaEvaporationProbability::G4AlphaEvaporationProbability() :
    3741    G4EvaporationProbability(4,2,1,&theCoulombBarrier) // A,Z,Gamma,&theCoumlombBarrier
    38 {
     42{}
     43
     44G4AlphaEvaporationProbability::~G4AlphaEvaporationProbability()
     45{}
     46
     47G4double G4AlphaEvaporationProbability::CalcAlphaParam(const G4Fragment & fragment) 
     48  { return 1.0 + CCoeficient(fragment.GetZ_asInt()-GetZ());}
    3949       
    40 }
    41 
    42 
    43 G4AlphaEvaporationProbability::G4AlphaEvaporationProbability(const G4AlphaEvaporationProbability &): G4EvaporationProbability()
    44 {
    45     throw G4HadronicException(__FILE__, __LINE__, "G4AlphaEvaporationProbability::copy_constructor meant to not be accessable");
    46 }
    47 
    48 
    49 
    50 
    51 const G4AlphaEvaporationProbability & G4AlphaEvaporationProbability::
    52 operator=(const G4AlphaEvaporationProbability &)
    53 {
    54     throw G4HadronicException(__FILE__, __LINE__, "G4AlphaEvaporationProbability::operator= meant to not be accessable");
    55     return *this;
    56 }
    57 
    58 
    59 G4bool G4AlphaEvaporationProbability::operator==(const G4AlphaEvaporationProbability &) const
    60 {
    61     return false;
    62 }
    63 
    64 G4bool G4AlphaEvaporationProbability::operator!=(const G4AlphaEvaporationProbability &) const
    65 {
    66     return true;
    67 }
    68 
    69 
    70  G4double G4AlphaEvaporationProbability::CalcAlphaParam(const G4Fragment & fragment) 
    71   { return 1.0 + CCoeficient(static_cast<G4double>(fragment.GetZ()-GetZ()));}
     50G4double G4AlphaEvaporationProbability::CalcBetaParam(const G4Fragment &)
     51  { return 0.0; }
     52
     53G4double G4AlphaEvaporationProbability::CCoeficient(G4int aZ)
     54{
     55  // Data comes from
     56  // Dostrovsky, Fraenkel and Friedlander
     57  // Physical Review, vol 116, num. 3 1959
     58  //
     59  // const G4int size = 5;
     60  // G4double Zlist[5] = { 10.0, 20.0, 30.0, 50.0, 70.0};
     61  //    G4double Calpha[5] = { 0.10, 0.10, 0.10, 0.08, 0.06};
     62  G4double C = 0.0;
    7263       
    73  G4double G4AlphaEvaporationProbability::CalcBetaParam(const G4Fragment &)
    74   { return 0.0; }
    75 
    76 G4double G4AlphaEvaporationProbability::CCoeficient(const G4double aZ)
    77 {
    78     // Data comes from
    79     // Dostrovsky, Fraenkel and Friedlander
    80     // Physical Review, vol 116, num. 3 1959
    81     //
    82     // const G4int size = 5;
    83     // G4double Zlist[5] = { 10.0, 20.0, 30.0, 50.0, 70.0};
    84     //  G4double Calpha[5] = { 0.10, 0.10, 0.10, 0.08, 0.06};
    85     G4double C = 0.0;
    86        
    87        
    88     if (aZ <= 30) {
    89         C = 0.10;
    90     } else if (aZ <= 50) {
    91         C = 0.1 + -((aZ-50.)/20.)*0.02;
    92     } else if (aZ < 70) {
    93         C = 0.08 + -((aZ-70.)/20.)*0.02;
    94     } else {
    95         C = 0.06;
    96     }
    97     return C;
     64  if (aZ <= 30)
     65    {
     66      C = 0.10;
     67    }
     68  else if (aZ <= 50)
     69    {
     70      C = 0.1 - (aZ-30)*0.001;
     71    }
     72  else if (aZ < 70)
     73    {
     74      C = 0.08 - (aZ-50)*0.001;
     75    }
     76  else
     77    {
     78      C = 0.06;
     79    }
     80  return C;
    9881}
    9982
     
    10487//OPT=3,4 Kalbach's parameterization
    10588//
    106 G4double G4AlphaEvaporationProbability::CrossSection(const  G4Fragment & fragment,
    107                                                      const G4double K)
     89G4double
     90G4AlphaEvaporationProbability::CrossSection(const G4Fragment & fragment, G4double K)
    10891{
    10992  theA=GetA();
    11093  theZ=GetZ();
    111   ResidualA=fragment.GetA()-theA;
    112   ResidualZ=fragment.GetZ()-theZ;
    113  
    114   ResidualAthrd=std::pow(ResidualA,0.33333);
    115   FragmentA=fragment.GetA();
    116   FragmentAthrd=std::pow(FragmentA,0.33333);
    117  
     94  ResidualA=fragment.GetA_asInt()-theA;
     95  ResidualZ=fragment.GetZ_asInt()-theZ;
     96 
     97  ResidualAthrd=fG4pow->Z13(ResidualA);
     98  FragmentA=fragment.GetA_asInt();
     99  FragmentAthrd=fG4pow->Z13(FragmentA);
    118100 
    119101  if (OPTxs==0) {std::ostringstream errOs;
     
    133115}
    134116
    135 
    136 //
    137 //********************* OPT=1,2 : Chatterjee's cross section ************************
     117//
     118//********************* OPT=1,2 : Chatterjee's cross section ********************
    138119//(fitting to cross section from Bechetti & Greenles OM potential)
    139120
    140 G4double G4AlphaEvaporationProbability::GetOpt12(const  G4double K)
    141 {
    142 // c     ** alpha from huizenga and igo
     121G4double G4AlphaEvaporationProbability::GetOpt12(G4double K)
     122{
    143123  G4double Kc=K;
    144  
    145   // JMQ xsec is set constat above limit of validity
    146   if (K>50) Kc=50;
    147  
     124
     125  // JMQ xsec is set constant above limit of validity
     126  if (K > 50*MeV) { Kc = 50*MeV; }
     127
    148128  G4double landa ,mu ,nu ,p , Ec,q,r,ji,xs;
    149  
     129
    150130  G4double     p0 = 10.95;
    151131  G4double     p1 = -85.2;
     
    160140  G4double     delta=1.2;         
    161141
    162  
    163142  Ec = 1.44*theZ*ResidualZ/(1.5*ResidualAthrd+delta);
    164143  p = p0 + p1/Ec + p2/(Ec*Ec);
    165144  landa = landa0*ResidualA + landa1;
    166   mu = mu0*std::pow(ResidualA,mu1);
    167   nu = std::pow(ResidualA,mu1)*(nu0 + nu1*Ec + nu2*(Ec*Ec));
     145  G4double resmu1 = fG4pow->powZ(ResidualA,mu1);
     146  mu = mu0*resmu1;
     147  nu = resmu1*(nu0 + nu1*Ec + nu2*(Ec*Ec));
    168148  q = landa - nu/(Ec*Ec) - 2*p*Ec;
    169149  r = mu + 2*nu/Ec + p*(Ec*Ec);
    170  
     150
    171151  ji=std::max(Kc,Ec);
    172152  if(Kc < Ec) { xs = p*Kc*Kc + q*Kc + r;}
    173153  else {xs = p*(Kc - ji)*(Kc - ji) + landa*Kc + mu + nu*(2 - Kc/ji)/ji ;}
    174                  
     154 
    175155  if (xs <0.0) {xs=0.0;}
    176  
     156             
    177157  return xs;
    178  
    179158}
    180159
    181160// *********** OPT=3,4 : Kalbach's cross sections (from PRECO code)*************
    182 G4double G4AlphaEvaporationProbability::GetOpt34(const  G4double K)
     161G4double G4AlphaEvaporationProbability::GetOpt34(G4double K)
    183162// c     ** alpha from huizenga and igo
    184163{
    185  
    186164  G4double landa, mu, nu, p , signor(1.),sig;
    187165  G4double ec,ecsq,xnulam,etest(0.),a;
    188166  G4double b,ecut,cut,ecut2,geom,elab;
    189167
    190 
    191168  G4double     flow = 1.e-18;
    192169  G4double     spill= 1.e+18;
    193170
    194   G4double       p0 = 10.95;
     171  G4double     p0 = 10.95;
    195172  G4double     p1 = -85.2;
    196173  G4double     p2 = 1146.;
     
    204181 
    205182  G4double      ra=1.20;
    206  
     183       
    207184  //JMQ 13/02/09 increase of reduced radius to lower the barrier
    208185  // ec = 1.44 * theZ * ResidualZ / (1.5*ResidualAthrd+ra);
     
    211188  p = p0 + p1/ec + p2/ecsq;
    212189  landa = landa0*ResidualA + landa1;
    213   a = std::pow(ResidualA,mu1);
     190  a = fG4pow->powZ(ResidualA,mu1);
    214191  mu = mu0 * a;
    215192  nu = a* (nu0+nu1*ec+nu2*ecsq); 
    216193  xnulam = nu / landa;
    217   if (xnulam > spill) xnulam=0.;
    218   if (xnulam >= flow) etest = 1.2 *std::sqrt(xnulam);
    219  
     194  if (xnulam > spill) { xnulam=0.; }
     195  if (xnulam >= flow) { etest = 1.2 *std::sqrt(xnulam); }
     196
    220197  a = -2.*p*ec + landa - nu/ecsq;
    221198  b = p*ecsq + mu + 2.*nu/ec;
    222199  ecut = 0.;
    223200  cut = a*a - 4.*p*b;
    224   if (cut > 0.) ecut = std::sqrt(cut);
     201  if (cut > 0.) { ecut = std::sqrt(cut); }
    225202  ecut = (ecut-a) / (p+p);
    226203  ecut2 = ecut;
    227 //JMQ 290310 for avoiding unphysical increase below minimum (at ecut)
    228 //ecut<0 means that there is no cut with energy axis, i.e. xs is set to 0 bellow minimum
    229 //  if (cut < 0.) ecut2 = ecut - 2.;
    230   if (cut < 0.) ecut2 = ecut;
    231   elab = K * FragmentA / ResidualA;
     204  //JMQ 290310 for avoiding unphysical increase below minimum (at ecut)
     205  // ecut<0 means that there is no cut with energy axis, i.e. xs is set
     206  // to 0 bellow minimum
     207  //  if (cut < 0.) ecut2 = ecut - 2.;
     208  if (cut < 0.) { ecut2 = ecut; }
     209  elab = K * FragmentA / G4double(ResidualA);
    232210  sig = 0.;
    233211 
    234212  if (elab <= ec) { //start for E<Ec
    235     if (elab > ecut2)  sig = (p*elab*elab+a*elab+b) * signor;
     213    if (elab > ecut2) { sig = (p*elab*elab+a*elab+b) * signor; }
    236214  }           //end for E<Ec
    237215  else {           //start for E>Ec
    238216    sig = (landa*elab+mu+nu/elab) * signor;
    239217    geom = 0.;
    240     if (xnulam < flow || elab < etest) return sig;
     218    if (xnulam < flow || elab < etest) { return sig; }
    241219    geom = std::sqrt(theA*K);
    242220    geom = 1.23*ResidualAthrd + ra + 4.573/geom;
     
    245223  }           //end for E>Ec
    246224  return sig;
    247  
    248 }
    249 
    250 //   ************************** end of cross sections *******************************
     225}
     226
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/src/G4DeuteronEvaporationChannel.cc

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4DeuteronEvaporationChannel.cc,v 1.4 2006/06/29 20:10:21 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4DeuteronEvaporationChannel.cc,v 1.5 2010/11/17 12:14:59 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
    3131// by V. Lara (Nov. 1999)
    3232//
     33// 17-11-2010 V.Ivanchenko moved constructor and destructor to source and cleanup
    3334
    3435#include "G4DeuteronEvaporationChannel.hh"
    3536
     37G4DeuteronEvaporationChannel::G4DeuteronEvaporationChannel()
     38: G4EvaporationChannel(2,1,"deuteron",&theEvaporationProbability,&theCoulombBarrier)
     39{}
    3640
    37 const G4DeuteronEvaporationChannel & G4DeuteronEvaporationChannel::operator=(const G4DeuteronEvaporationChannel & )
    38 {
    39     throw G4HadronicException(__FILE__, __LINE__, "G4DeuteronEvaporationChannel::operator= meant to not be accessable");
    40     return *this;
    41 }
     41G4DeuteronEvaporationChannel::~G4DeuteronEvaporationChannel()
     42{}
    4243
    43 G4DeuteronEvaporationChannel::G4DeuteronEvaporationChannel(const G4DeuteronEvaporationChannel & ) : G4EvaporationChannel()
    44 {
    45     throw G4HadronicException(__FILE__, __LINE__, "G4DeuteronEvaporationChannel::CopyConstructor meant to not be accessable");
    46 }
    47 
    48 G4bool G4DeuteronEvaporationChannel::operator==(const G4DeuteronEvaporationChannel & right) const
    49 {
    50     return (this == (G4DeuteronEvaporationChannel *) &right);
    51     //  return false;
    52 }
    53 
    54 G4bool G4DeuteronEvaporationChannel::operator!=(const G4DeuteronEvaporationChannel & right) const
    55 {
    56     return (this != (G4DeuteronEvaporationChannel *) &right);
    57     //  return true;
    58 }
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/src/G4DeuteronEvaporationProbability.cc

    r1315 r1347  
    2424// ********************************************************************
    2525//
    26 //J.M. Quesada (August2008). Based on:
     26// $Id: G4DeuteronEvaporationProbability.cc,v 1.20 2010/11/17 11:06:03 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
     28//
     29// J.M. Quesada (August2008). Based on:
    2730//
    2831// Hadronic Process: Nuclear De-excitations
    2932// by V. Lara (Oct 1998)
    3033//
    31 // Modif (03 September 2008) by J. M. Quesada for external choice of inverse
    32 // cross section option
     34// Modified:
     35// 03-09-2008 J.M. Quesada for external choice of inverse cross section option
     36// 17-11-2010 V.Ivanchenko integer Z and A
    3337
    3438
     
    3842G4DeuteronEvaporationProbability::G4DeuteronEvaporationProbability() :
    3943    G4EvaporationProbability(2,1,3,&theCoulombBarrier) // A,Z,Gamma (fixed JMQ)
    40 {       }
    41 G4DeuteronEvaporationProbability::G4DeuteronEvaporationProbability(const G4DeuteronEvaporationProbability &) : G4EvaporationProbability()
    42 {
    43     throw G4HadronicException(__FILE__, __LINE__, "G4DeuteronEvaporationProbability::copy_constructor meant to not be accessable");
    44 }
    45 
    46 
    47 const G4DeuteronEvaporationProbability & G4DeuteronEvaporationProbability::
    48 operator=(const G4DeuteronEvaporationProbability &)
    49 {
    50     throw G4HadronicException(__FILE__, __LINE__, "G4DeuteronEvaporationProbability::operator= meant to not be accessable");
    51     return *this;
    52 }
    53 
    54 
    55 G4bool G4DeuteronEvaporationProbability::operator==(const G4DeuteronEvaporationProbability &) const
    56 {
    57     return false;
    58 }
    59 
    60 
    61 G4bool G4DeuteronEvaporationProbability::operator!=(const G4DeuteronEvaporationProbability &) const
    62 {
    63     return true;
    64 }
    65 
     44{}
     45
     46G4DeuteronEvaporationProbability::~G4DeuteronEvaporationProbability()
     47{}
    6648
    6749G4double G4DeuteronEvaporationProbability::CalcAlphaParam(const G4Fragment & fragment)
    6850{
    69     return 1.0 + CCoeficient(static_cast<G4double>(fragment.GetZ()-GetZ()));
    70 }
    71 
     51  return 1.0 + CCoeficient(fragment.GetZ_asInt()-GetZ());
     52}
    7253
    7354G4double G4DeuteronEvaporationProbability::CalcBetaParam(const G4Fragment & )
    7455{
    75     return 0.0;
    76 }
    77 
    78 
    79 G4double G4DeuteronEvaporationProbability::CCoeficient(const G4double aZ)
    80 {
    81     // Data comes from
    82     // Dostrovsky, Fraenkel and Friedlander
    83     // Physical Review, vol 116, num. 3 1959
    84     //
    85     // const G4int size = 5;
    86     // G4double Zlist[5] = { 10.0, 20.0, 30.0, 50.0, 70.0};
    87     // G4double Cp[5] = { 0.50, 0.28, 0.20, 0.15, 0.10};
    88     // C for deuteron is equal to C for protons divided by 2
    89     G4double C = 0.0;
     56  return 0.0;
     57}
     58
     59G4double G4DeuteronEvaporationProbability::CCoeficient(G4int aZ)
     60{
     61  // Data comes from
     62  // Dostrovsky, Fraenkel and Friedlander
     63  // Physical Review, vol 116, num. 3 1959
     64  //
     65  // const G4int size = 5;
     66  // G4double Zlist[5] = { 10.0, 20.0, 30.0, 50.0, 70.0};
     67  // G4double Cp[5] = { 0.50, 0.28, 0.20, 0.15, 0.10};
     68  // C for deuteron is equal to C for protons divided by 2
     69  G4double C = 0.0;
    9070       
    91     if (aZ >= 70) {
    92         C = 0.10;
    93     } else {
    94         C = ((((0.15417e-06*aZ) - 0.29875e-04)*aZ + 0.21071e-02)*aZ - 0.66612e-01)*aZ + 0.98375;
    95     }
     71  if (aZ >= 70) {
     72    C = 0.10;
     73  } else {
     74    C = ((((0.15417e-06*aZ) - 0.29875e-04)*aZ + 0.21071e-02)*aZ - 0.66612e-01)*aZ + 0.98375;
     75  }
    9676       
    97     return C/2.0;
     77  return C/2.0;
    9878       
    9979}
     
    10686//OPT=3,4 Kalbach's parameterization
    10787//
    108 G4double G4DeuteronEvaporationProbability::CrossSection(const  G4Fragment & fragment, const  G4double K)
    109 {
    110        theA=GetA();
    111        theZ=GetZ();
    112        ResidualA=fragment.GetA()-theA;
    113        ResidualZ=fragment.GetZ()-theZ;
     88G4double
     89G4DeuteronEvaporationProbability::CrossSection(const  G4Fragment & fragment, G4double K)
     90{
     91  theA=GetA();
     92  theZ=GetZ();
     93  ResidualA=fragment.GetA_asInt()-theA;
     94  ResidualZ=fragment.GetZ_asInt()-theZ;
     95 
     96  ResidualAthrd=fG4pow->Z13(ResidualA);
     97  FragmentA=fragment.GetA_asInt();
     98  FragmentAthrd=fG4pow->Z13(FragmentA);
     99
     100  if (OPTxs==0) {std::ostringstream errOs;
     101  errOs << "We should'n be here (OPT =0) at evaporation cross section calculation (deuterons)!!" 
     102        <<G4endl;
     103  throw G4HadronicException(__FILE__, __LINE__, errOs.str());
     104  return 0.;}
     105  if( OPTxs==1 || OPTxs==2) return G4DeuteronEvaporationProbability::GetOpt12( K);
     106  else if (OPTxs==3 || OPTxs==4)  return G4DeuteronEvaporationProbability::GetOpt34( K);
     107  else{
     108    std::ostringstream errOs;
     109    errOs << "BAD Deuteron CROSS SECTION OPTION AT EVAPORATION!!"  <<G4endl;
     110    throw G4HadronicException(__FILE__, __LINE__, errOs.str());
     111    return 0.;
     112  }
     113}
     114
     115//
     116//********************* OPT=1,2 : Chatterjee's cross section ********************
     117//(fitting to cross section from Bechetti & Greenles OM potential)
     118
     119G4double G4DeuteronEvaporationProbability::GetOpt12(G4double K)
     120{
     121  G4double Kc = K;
     122
     123  // JMQ xsec is set constat above limit of validity
     124  if (K > 50*MeV) { Kc = 50*MeV; }
     125
     126  G4double landa ,mu ,nu ,p , Ec,q,r,ji,xs;
    114127 
    115        ResidualAthrd=std::pow(ResidualA,0.33333);
    116        FragmentA=fragment.GetA();
    117        FragmentAthrd=std::pow(FragmentA,0.33333);
    118 
    119        if (OPTxs==0) {std::ostringstream errOs;
    120          errOs << "We should'n be here (OPT =0) at evaporation cross section calculation (deuterons)!!"  <<G4endl;
    121          throw G4HadronicException(__FILE__, __LINE__, errOs.str());
    122          return 0.;}
    123        if( OPTxs==1 || OPTxs==2) return G4DeuteronEvaporationProbability::GetOpt12( K);
    124        else if (OPTxs==3 || OPTxs==4)  return G4DeuteronEvaporationProbability::GetOpt34( K);
    125        else{
    126          std::ostringstream errOs;
    127          errOs << "BAD Deuteron CROSS SECTION OPTION AT EVAPORATION!!"  <<G4endl;
    128          throw G4HadronicException(__FILE__, __LINE__, errOs.str());
    129          return 0.;
    130        }
    131 }
    132 
    133 
    134 //********************* OPT=1,2 : Chatterjee's cross section ************************
    135 //(fitting to cross section from Bechetti & Greenles OM potential)
    136 
    137 G4double G4DeuteronEvaporationProbability::GetOpt12(const  G4double K)
    138 {
    139 
    140   G4double Kc=K;
    141 
    142 // JMQ xsec is set constat above limit of validity
    143  if (K>50) Kc=50;
    144 
    145  G4double landa ,mu ,nu ,p , Ec,q,r,ji,xs;
    146 
    147  
    148  G4double    p0 = -38.21;
    149  G4double    p1 = 922.6;
    150  G4double    p2 = -2804.;
    151  G4double    landa0 = -0.0323;
    152  G4double    landa1 = -5.48;
    153  G4double    mu0 = 336.1;
    154  G4double    mu1 = 0.48;
    155  G4double    nu0 = 524.3;
    156  G4double    nu1 = -371.8;
    157  G4double    nu2 = -5.924; 
    158  G4double    delta=1.2;           
    159  
    160 
    161  Ec = 1.44*theZ*ResidualZ/(1.5*ResidualAthrd+delta);
    162  p = p0 + p1/Ec + p2/(Ec*Ec);
    163  landa = landa0*ResidualA + landa1;
    164  mu = mu0*std::pow(ResidualA,mu1);
    165  nu = std::pow(ResidualA,mu1)*(nu0 + nu1*Ec + nu2*(Ec*Ec));
    166  q = landa - nu/(Ec*Ec) - 2*p*Ec;
    167  r = mu + 2*nu/Ec + p*(Ec*Ec);
    168  
    169  ji=std::max(Kc,Ec);
    170  if(Kc < Ec) { xs = p*Kc*Kc + q*Kc + r;}
    171  else {xs = p*(Kc - ji)*(Kc - ji) + landa*Kc + mu + nu*(2 - Kc/ji)/ji ;}
     128  G4double    p0 = -38.21;
     129  G4double    p1 = 922.6;
     130  G4double    p2 = -2804.;
     131  G4double    landa0 = -0.0323;
     132  G4double    landa1 = -5.48;
     133  G4double    mu0 = 336.1;
     134  G4double    mu1 = 0.48;
     135  G4double    nu0 = 524.3;
     136  G4double    nu1 = -371.8;
     137  G4double    nu2 = -5.924; 
     138  G4double    delta=1.2;           
     139
     140  Ec = 1.44*theZ*ResidualZ/(1.5*ResidualAthrd+delta);
     141  p = p0 + p1/Ec + p2/(Ec*Ec);
     142  landa = landa0*ResidualA + landa1;
     143  G4double resmu1 = fG4pow->powZ(ResidualA,mu1);
     144  mu = mu0*resmu1;
     145  nu = resmu1*(nu0 + nu1*Ec + nu2*(Ec*Ec));
     146  q = landa - nu/(Ec*Ec) - 2*p*Ec;
     147  r = mu + 2*nu/Ec + p*(Ec*Ec);
     148
     149  ji=std::max(Kc,Ec);
     150  if(Kc < Ec) { xs = p*Kc*Kc + q*Kc + r;}
     151  else {xs = p*(Kc - ji)*(Kc - ji) + landa*Kc + mu + nu*(2 - Kc/ji)/ji ;}
    172152                 
    173  if (xs <0.0) {xs=0.0;}
    174  
    175  return xs;
    176 
    177 }
    178 
     153  if (xs <0.0) {xs=0.0;}
     154             
     155  return xs;
     156}
    179157
    180158// *********** OPT=3,4 : Kalbach's cross sections (from PRECO code)*************
    181 G4double G4DeuteronEvaporationProbability::GetOpt34(const  G4double K)
     159G4double G4DeuteronEvaporationProbability::GetOpt34(G4double K)
    182160//     ** d from o.m. of perey and perey
    183161{
    184162
    185   G4double landa, mu, nu, p , signor(1.),sig;
     163  G4double landa, mu, nu, p ,signor(1.),sig;
    186164  G4double ec,ecsq,xnulam,etest(0.),a;
    187165  G4double b,ecut,cut,ecut2,geom,elab;
    188166
    189 
    190167  G4double     flow = 1.e-18;
    191168  G4double     spill= 1.e+18;
    192 
    193169
    194170  G4double     p0 = 0.798;
     
    202178  G4double     nu1 = -474.5;
    203179  G4double     nu2 = -3.592;     
    204   
    205   G4double      ra=0.80;
     180 
     181  G4double     ra=0.80;
    206182       
    207183  //JMQ 13/02/09 increase of reduced radius to lower the barrier
    208   //  ec = 1.44 * theZ * ResidualZ / (1.5*ResidualAthrd+ra);
    209    ec = 1.44 * theZ * ResidualZ / (1.7*ResidualAthrd+ra);
    210 
     184  // ec = 1.44 * theZ * ResidualZ / (1.5*ResidualAthrd+ra);
     185  ec = 1.44 * theZ * ResidualZ / (1.7*ResidualAthrd+ra);
    211186  ecsq = ec * ec;
    212187  p = p0 + p1/ec + p2/ecsq;
    213188  landa = landa0*ResidualA + landa1;
    214   a = std::pow(ResidualA,mu1);
     189  a = fG4pow->powZ(ResidualA,mu1);
    215190  mu = mu0 * a;
    216191  nu = a* (nu0+nu1*ec+nu2*ecsq); 
    217192  xnulam = nu / landa;
    218   if (xnulam > spill) xnulam=0.;
    219   if (xnulam >= flow) etest = 1.2 *std::sqrt(xnulam);
     193  if (xnulam > spill) { xnulam=0.; }
     194  if (xnulam >= flow) { etest = 1.2 *std::sqrt(xnulam); }
    220195
    221196  a = -2.*p*ec + landa - nu/ecsq;
     
    223198  ecut = 0.;
    224199  cut = a*a - 4.*p*b;
    225   if (cut > 0.) ecut = std::sqrt(cut);
     200  if (cut > 0.) { ecut = std::sqrt(cut); }
    226201  ecut = (ecut-a) / (p+p);
    227202  ecut2 = ecut;
    228 //JMQ 290310 for avoiding unphysical increase below minimum (at ecut)
    229 //ecut<0 means that there is no cut with energy axis, i.e. xs is set to 0 bellow minimum
    230 //  if (cut < 0.) ecut2 = ecut - 2.;
    231   if (cut < 0.) ecut2 = ecut;
    232   elab = K * FragmentA / ResidualA;
     203  //JMQ 290310 for avoiding unphysical increase below minimum (at ecut)
     204  //ecut<0 means that there is no cut with energy axis, i.e. xs is set
     205  //to 0 bellow minimum
     206  //  if (cut < 0.) ecut2 = ecut - 2.;
     207  if (cut < 0.) { ecut2 = ecut; }
     208  elab = K * FragmentA / G4double(ResidualA);
    233209  sig = 0.;
    234210
    235211  if (elab <= ec) { //start for E<Ec
    236     if (elab > ecut2)  sig = (p*elab*elab+a*elab+b) * signor;
     212    if (elab > ecut2) { sig = (p*elab*elab+a*elab+b) * signor; }
    237213  }           //end for E<Ec
    238214  else {           //start for E>Ec
    239215    sig = (landa*elab+mu+nu/elab) * signor;
    240216    geom = 0.;
    241     if (xnulam < flow || elab < etest) return sig;
     217    if (xnulam < flow || elab < etest) { return sig; }
    242218    geom = std::sqrt(theA*K);
    243219    geom = 1.23*ResidualAthrd + ra + 4.573/geom;
     
    246222  }           //end for E>Ec
    247223  return sig;
    248  
    249 }
    250 
    251 //   ************************** end of cross sections *******************************
     224}
     225
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/src/G4Evaporation.cc

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4Evaporation.cc,v 1.25 2010/06/09 11:56:47 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4Evaporation.cc,v 1.26 2010/11/23 18:10:10 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    142142    G4int Z = theResidualNucleus->GetZ_asInt();
    143143    G4double abun = nist->GetIsotopeAbundance(Z, A);
    144     /*
    145     G4cout << "### G4Evaporation::BreakItUp step " << ia << " Z= " << Z
    146            << " A= " << A << " Eex(MeV)= "
    147            << theResidualNucleus->GetExcitationEnergy()
    148            << " aban= " << abun << G4endl;
    149     */
     144   
     145    // G4cout << "### G4Evaporation::BreakItUp step " << ia << " Z= " << Z
     146    //     << " A= " << A << " Eex(MeV)= "
     147    //     << theResidualNucleus->GetExcitationEnergy()
     148    //     << " aban= " << abun << G4endl;
     149   
    150150    if(theResidualNucleus->GetExcitationEnergy() <= minExcitation &&
    151151       (abun > 0.0))
     
    184184    // do evaporation chain and reset total probability
    185185    if(0.0 < totprob && probabilities[0] == totprob) {
     186      //G4cout << "Start gamma evaporation" << G4endl;
    186187      theTempResult = (*theChannels)[0]->BreakUpFragment(theResidualNucleus);
    187188      if(theTempResult) {
     
    228229    // single photon evaporation, primary pointer is kept
    229230    if(0 == i) {
     231      //G4cout << "Single gamma" << G4endl;
    230232      G4Fragment* gamma = (*theChannels)[0]->EmittedFragment(theResidualNucleus);
    231233      if(gamma) { theResult->push_back(gamma); }
     
    233235      // fission, return results to the main loop if fission is succesful
    234236    } else if(1 == i) {
     237      //G4cout << "Fission" << G4endl;
    235238      theTempResult = (*theChannels)[1]->BreakUp(*theResidualNucleus);
    236239      if(theTempResult) {
     
    248251      // other channels
    249252    } else {
     253      //G4cout << "Channel # " << i << G4endl;
    250254      theTempResult = (*theChannels)[i]->BreakUp(*theResidualNucleus);
    251255      if(theTempResult) {
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/src/G4EvaporationChannel.cc

    r962 r1347  
    2424// ********************************************************************
    2525//
     26// $Id: G4EvaporationChannel.cc,v 1.19 2010/11/24 15:30:49 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2628//
    2729//J.M. Quesada (August2008). Based on:
     
    3032// by V. Lara (Oct 1998)
    3133//
    32 // Modif (03 September 2008) by J. M. Quesada for external choice of inverse
    33 // cross section option
    34 // JMQ (06 September 2008) Also external choices have been added for
    35 // superimposed Coulomb barrier (if useSICB is set true, by default is false)
    36 
     34// Modified:
     35// 03-09-2008 J.M. Quesada for external choice of inverse cross section option
     36// 06-09-2008 J.M. Quesada Also external choices have been added for superimposed
     37//                 Coulomb barrier (if useSICB is set true, by default is false)
     38// 17-11-2010 V.Ivanchenko in constructor replace G4VEmissionProbability by
     39//            G4EvaporationProbability and do not new and delete probability
     40//            object at each call; use G4Pow
    3741
    3842#include "G4EvaporationChannel.hh"
    3943#include "G4PairingCorrection.hh"
    40 
    41 
    42 
    43 G4EvaporationChannel::G4EvaporationChannel(const G4int anA, const G4int aZ, const G4String & aName,
    44                                            G4VEmissionProbability * aEmissionStrategy,
    45                                            G4VCoulombBarrier * aCoulombBarrier):
     44#include "G4NucleiProperties.hh"
     45#include "G4Pow.hh"
     46#include "G4EvaporationLevelDensityParameter.hh"
     47#include "Randomize.hh"
     48#include "G4Alpha.hh"
     49
     50G4EvaporationChannel::G4EvaporationChannel(G4int anA, G4int aZ,
     51                                           const G4String & aName,
     52                                           G4EvaporationProbability* aEmissionStrategy,
     53                                           G4VCoulombBarrier* aCoulombBarrier):
    4654    G4VEvaporationChannel(aName),
    4755    theA(anA),
     
    5260    MaximalKineticEnergy(-1000.0)
    5361{
    54     theLevelDensityPtr = new G4EvaporationLevelDensityParameter;
    55 //    MyOwnLevelDensity = true; 
     62  ResidualA = 0;
     63  ResidualZ = 0;
     64  ResidualMass = CoulombBarrier=0.0;
     65  EvaporatedMass = G4NucleiProperties::GetNuclearMass(theA, theZ);
     66  theLevelDensityPtr = new G4EvaporationLevelDensityParameter;
     67}
     68
     69G4EvaporationChannel::G4EvaporationChannel():
     70    G4VEvaporationChannel(""),
     71    theA(0),
     72    theZ(0),
     73    theEvaporationProbabilityPtr(0),
     74    theCoulombBarrierPtr(0),
     75    EmissionProbability(0.0),
     76    MaximalKineticEnergy(-1000.0)
     77{
     78  ResidualA = 0;
     79  ResidualZ = 0;
     80  EvaporatedMass = ResidualMass = CoulombBarrier = 0.0;
     81  theLevelDensityPtr = new G4EvaporationLevelDensityParameter;
    5682}
    5783
     
    6086  delete theLevelDensityPtr;
    6187}
    62 
    63 G4EvaporationChannel::G4EvaporationChannel(const G4EvaporationChannel & ) : G4VEvaporationChannel()
    64 {
    65     throw G4HadronicException(__FILE__, __LINE__, "G4EvaporationChannel::copy_costructor meant to not be accessable");
    66 }
    67 
    68 const G4EvaporationChannel & G4EvaporationChannel::operator=(const G4EvaporationChannel & )
    69 {
    70     throw G4HadronicException(__FILE__, __LINE__, "G4EvaporationChannel::operator= meant to not be accessable");
    71     return *this;
    72 }
    73 
    74 G4bool G4EvaporationChannel::operator==(const G4EvaporationChannel & right) const
    75 {
    76     return (this == (G4EvaporationChannel *) &right);
    77     //  return false;
    78 }
    79 
    80 G4bool G4EvaporationChannel::operator!=(const G4EvaporationChannel & right) const
    81 {
    82     return (this != (G4EvaporationChannel *) &right);
    83     //  return true;
    84 }
    85 
    86 //void G4EvaporationChannel::SetLevelDensityParameter(G4VLevelDensityParameter * aLevelDensity)
    87 //  {
    88 //    if (MyOwnLevelDensity) delete theLevelDensityPtr;
    89 //    theLevelDensityPtr = aLevelDensity;
    90 //    MyOwnLevelDensity = false;
    91 //  }
    9288
    9389void G4EvaporationChannel::Initialize(const G4Fragment & fragment)
     
    9894  theEvaporationProbabilityPtr->UseSICB(useSICB);
    9995 
    100  
    101   G4int FragmentA = static_cast<G4int>(fragment.GetA());
    102   G4int FragmentZ = static_cast<G4int>(fragment.GetZ());
     96  G4int FragmentA = fragment.GetA_asInt();
     97  G4int FragmentZ = fragment.GetZ_asInt();
    10398  ResidualA = FragmentA - theA;
    10499  ResidualZ = FragmentZ - theZ;
     100  //G4cout << "G4EvaporationChannel::Initialize Z= " << theZ << " A= " << theA
     101  //     << " FragZ= " << FragmentZ << " FragA= " << FragmentA << G4endl;
    105102 
    106103  //Effective excitation energy
     
    108105    G4PairingCorrection::GetInstance()->GetPairingCorrection(FragmentA,FragmentZ);
    109106 
    110  
    111107  // Only channels which are physically allowed are taken into account
    112108  if (ResidualA <= 0 || ResidualZ <= 0 || ResidualA < ResidualZ ||
    113109      (ResidualA == ResidualZ && ResidualA > 1) || ExEnergy <= 0.0) {
    114     CoulombBarrier=0.0;
     110    CoulombBarrier = ResidualMass = 0.0;
    115111    MaximalKineticEnergy = -1000.0*MeV;
    116112    EmissionProbability = 0.0;
    117113  } else {
     114    ResidualMass = G4NucleiProperties::GetNuclearMass(ResidualA, ResidualZ);
     115    G4double FragmentMass = fragment.GetGroundStateMass();
    118116    CoulombBarrier = theCoulombBarrierPtr->GetCoulombBarrier(ResidualA,ResidualZ,ExEnergy);
    119117    // Maximal Kinetic Energy
    120     MaximalKineticEnergy = CalcMaximalKineticEnergy
    121       (G4ParticleTable::GetParticleTable()->
    122        GetIonTable()->GetNucleusMass(FragmentZ,FragmentA)+ExEnergy);
     118    MaximalKineticEnergy = CalcMaximalKineticEnergy(FragmentMass + ExEnergy);
     119    //MaximalKineticEnergy = ExEnergy + fragment.GetGroundStateMass()
     120    //  - EvaporatedMass - ResidualMass;
    123121   
    124122    // Emission probability
     
    131129      limit= CoulombBarrier;
    132130    else limit=0.;
     131    limit = std::max(limit, FragmentMass - ResidualMass - EvaporatedMass);
    133132 
    134133    // The threshold for charged particle emission must be  set to 0 if Coulomb
    135134    //cutoff  is included in the cross sections
    136     //if (MaximalKineticEnergy <= 0.0) EmissionProbability = 0.0; 
    137135    if (MaximalKineticEnergy <= limit) EmissionProbability = 0.0;
    138136    else {
     
    142140    }
    143141  }
     142  //G4cout << "G4EvaporationChannel:: probability= " << EmissionProbability << G4endl;
    144143 
    145144  return;
     
    148147G4FragmentVector * G4EvaporationChannel::BreakUp(const G4Fragment & theNucleus)
    149148{
    150   G4double EvaporatedKineticEnergy=GetKineticEnergy(theNucleus);
    151  
    152   G4double EvaporatedMass = G4ParticleTable::GetParticleTable()->GetIonTable()->
    153     GetIonMass(theZ,theA);
    154   G4double EvaporatedEnergy = EvaporatedKineticEnergy + EvaporatedMass;
    155  
     149  /*
     150  G4double Ecm = GetKineticEnergy(theNucleus) + ResidualMass + EvaporatedMass;
     151 
     152  G4double EvaporatedEnergy =
     153    ((Ecm-ResidualMass)*(Ecm+ResidualMass) + EvaporatedMass*EvaporatedMass)/(2*Ecm);
     154  */
     155  G4double EvaporatedEnergy = GetKineticEnergy(theNucleus) + EvaporatedMass;
     156
    156157  G4ThreeVector momentum(IsotropicVector
    157                          (std::sqrt(EvaporatedKineticEnergy*
    158                                     (EvaporatedKineticEnergy+2.0*EvaporatedMass))));
    159  
    160   momentum.rotateUz(theNucleus.GetMomentum().vect().unit());
     158                         (std::sqrt((EvaporatedEnergy - EvaporatedMass)*
     159                                    (EvaporatedEnergy + EvaporatedMass))));
    161160 
    162161  G4LorentzVector EvaporatedMomentum(momentum,EvaporatedEnergy);
    163   EvaporatedMomentum.boost(theNucleus.GetMomentum().boostVector());
     162  G4LorentzVector ResidualMomentum = theNucleus.GetMomentum();
     163  EvaporatedMomentum.boost(ResidualMomentum.boostVector());
    164164 
    165165  G4Fragment * EvaporatedFragment = new G4Fragment(theA,theZ,EvaporatedMomentum);
    166 #ifdef PRECOMPOUND_TEST
    167   EvaporatedFragment->SetCreatorModel(G4String("G4Evaporation"));
    168 #endif
    169   // ** And now the residual nucleus **
    170   G4double theExEnergy = theNucleus.GetExcitationEnergy();
    171   G4double theMass = G4ParticleTable::GetParticleTable()->GetIonTable()->
    172     GetNucleusMass(static_cast<G4int>(theNucleus.GetZ()),
    173                    static_cast<G4int>(theNucleus.GetA()));
    174   G4double ResidualEnergy = theMass +
    175     (theExEnergy - EvaporatedKineticEnergy) - EvaporatedMass;
    176  
    177   G4LorentzVector ResidualMomentum(-momentum,ResidualEnergy);
    178   ResidualMomentum.boost(theNucleus.GetMomentum().boostVector());
    179  
    180   G4Fragment * ResidualFragment = new G4Fragment(ResidualA, ResidualZ, ResidualMomentum );
    181  
    182 #ifdef PRECOMPOUND_TEST
    183   ResidualFragment->SetCreatorModel(G4String("ResidualNucleus"));
    184 #endif
     166  ResidualMomentum -= EvaporatedMomentum;
     167
     168  G4Fragment * ResidualFragment = new G4Fragment(ResidualA, ResidualZ, ResidualMomentum);
     169 
    185170  G4FragmentVector * theResult = new G4FragmentVector;
    186171 
     
    211196/////////////////////////////////////////
    212197// Calculates the maximal kinetic energy that can be carried by fragment.
    213 G4double G4EvaporationChannel::CalcMaximalKineticEnergy(const G4double NucleusTotalE)
    214 {
    215   G4double ResidualMass = G4ParticleTable::GetParticleTable()->
    216     GetIonTable()->GetNucleusMass( ResidualZ, ResidualA );
    217   G4double EvaporatedMass = G4ParticleTable::GetParticleTable()->
    218     GetIonTable()->GetNucleusMass( theZ, theA );
    219 
     198G4double G4EvaporationChannel::CalcMaximalKineticEnergy(G4double NucleusTotalE)
     199{
    220200  // This is the "true" assimptotic kinetic energy (from energy conservation)   
    221   G4double Tmax = (NucleusTotalE*NucleusTotalE + EvaporatedMass*EvaporatedMass -               
    222                    ResidualMass*ResidualMass)/(2.0*NucleusTotalE) - EvaporatedMass;
     201  G4double Tmax =
     202    ((NucleusTotalE-ResidualMass)*(NucleusTotalE+ResidualMass) + EvaporatedMass*EvaporatedMass)
     203    /(2.0*NucleusTotalE) - EvaporatedMass;
    223204 
    224205  //JMQ (13-09-08) bug fixed: in the original version the Tmax is calculated
     
    245226   
    246227   
    247     if (MaximalKineticEnergy < 0.0)  
     228    if (MaximalKineticEnergy < 0.0) {
    248229      throw G4HadronicException(__FILE__, __LINE__,
    249230                                "G4EvaporationChannel::CalcKineticEnergy: maximal kinetic at the Coulomb barrier is less than 0");
    250    
     231    }
    251232    G4double Rb = 4.0*theLevelDensityPtr->
    252233      LevelDensityParameter(ResidualA+theA,ResidualZ+theZ,MaximalKineticEnergy)*
     
    263244      G4double Q2 = 1.0;
    264245      if (theZ == 0) { // for emitted neutron
    265         G4double Beta = (2.12/std::pow(G4double(ResidualA),2./3.) - 0.05)*MeV/
    266           (0.76 + 2.2/std::pow(G4double(ResidualA),1./3.));
     246        G4double Beta = (2.12/G4Pow::GetInstance()->Z23(ResidualA) - 0.05)*MeV/
     247          (0.76 + 2.2/G4Pow::GetInstance()->Z13(ResidualA));
    267248        Q1 = 1.0 + Beta/(MaximalKineticEnergy);
    268249        Q2 = Q1*std::sqrt(Q1);
     
    277258  } else if (OPTxs==1 || OPTxs==2 || OPTxs==3 || OPTxs==4) {
    278259   
    279     G4double V;
    280     if(useSICB) V= CoulombBarrier;
    281     else V=0.;
    282     //If Coulomb barrier is just included  in the cross sections
    283     //  G4double V=0.;
     260    // Coulomb barrier is just included  in the cross sections
     261    G4double V = 0;
     262    if(useSICB) { V= CoulombBarrier; }
     263
     264    V = std::max(V, aFragment.GetGroundStateMass()-EvaporatedMass-ResidualMass);
    284265
    285266    G4double Tmax=MaximalKineticEnergy;
    286267    G4double T(0.0);
    287268    G4double NormalizedProbability(1.0);
    288    
     269
     270    // VI: This is very ineffective - create new objects at each call to the method   
     271    /*
    289272    // A pointer is created in order to access the distribution function.
    290     G4EvaporationProbability * G4EPtemp;
     273    G4EvaporationProbability * G4EPtemp = 0;
    291274   
    292275    if (theA==1 && theZ==0) G4EPtemp=new G4NeutronEvaporationProbability();
     
    305288      G4EPtemp->SetOPTxs(OPTxs);
    306289      G4EPtemp->UseSICB(useSICB);
    307 
     290    */
     291
     292    // use local pointer and not create a new one
    308293    do
    309294      { 
    310295        T=V+G4UniformRand()*(Tmax-V);
    311         NormalizedProbability=G4EPtemp->ProbabilityDistributionFunction(aFragment,T)/
    312           (this->GetEmissionProbability());
     296        NormalizedProbability =
     297          theEvaporationProbabilityPtr->ProbabilityDistributionFunction(aFragment,T)/
     298          GetEmissionProbability();
    313299       
    314300      }
    315301    while (G4UniformRand() > NormalizedProbability);
    316    delete G4EPtemp;
    317    return T;
     302    //   delete G4EPtemp;
     303    return T;
    318304  } else{
    319305    std::ostringstream errOs;
     
    323309}
    324310
    325 G4ThreeVector G4EvaporationChannel::IsotropicVector(const G4double Magnitude)
     311G4ThreeVector G4EvaporationChannel::IsotropicVector(G4double Magnitude)
    326312    // Samples a isotropic random vectorwith a magnitud given by Magnitude.
    327313    // By default Magnitude = 1.0
    328314{
    329     G4double CosTheta = 1.0 - 2.0*G4UniformRand();
    330     G4double SinTheta = std::sqrt(1.0 - CosTheta*CosTheta);
    331     G4double Phi = twopi*G4UniformRand();
    332     G4ThreeVector Vector(Magnitude*std::cos(Phi)*SinTheta,
    333                         Magnitude*std::sin(Phi)*SinTheta,
    334                         Magnitude*CosTheta);
    335     return Vector;
    336             }
     315  G4double CosTheta = 1.0 - 2.0*G4UniformRand();
     316  G4double SinTheta = std::sqrt(1.0 - CosTheta*CosTheta);
     317  G4double Phi = twopi*G4UniformRand();
     318  G4ThreeVector Vector(Magnitude*std::cos(Phi)*SinTheta,
     319                      Magnitude*std::sin(Phi)*SinTheta,
     320                      Magnitude*CosTheta);
     321  return Vector;
     322}
    337323
    338324
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/src/G4EvaporationDefaultGEMFactory.cc

    r1340 r1347  
    2626//
    2727// $Id: G4EvaporationDefaultGEMFactory.cc,v 1.2 2010/04/27 11:43:16 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/src/G4EvaporationFactory.cc

    r1340 r1347  
    2626//
    2727// $Id: G4EvaporationFactory.cc,v 1.5 2010/04/27 11:43:16 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/src/G4EvaporationProbability.cc

    r1315 r1347  
    4444#include "G4IonTable.hh"
    4545
    46 
    47 G4EvaporationProbability::G4EvaporationProbability(const G4EvaporationProbability &) : G4VEmissionProbability()
     46G4EvaporationProbability::G4EvaporationProbability(G4int anA, G4int aZ,
     47                                                   G4double aGamma,
     48                                                   G4VCoulombBarrier * aCoulombBarrier)
     49  : theA(anA),
     50    theZ(aZ),
     51    Gamma(aGamma),
     52    theCoulombBarrierptr(aCoulombBarrier)
     53{}
     54
     55G4EvaporationProbability::G4EvaporationProbability()
     56  : theA(0),
     57    theZ(0),
     58    Gamma(0.0),
     59    theCoulombBarrierptr(0)
     60{}
     61
     62G4EvaporationProbability::~G4EvaporationProbability()
     63{}
     64 
     65G4double
     66G4EvaporationProbability::EmissionProbability(const G4Fragment & fragment, G4double anEnergy)
    4867{
    49     throw G4HadronicException(__FILE__, __LINE__, "G4EvaporationProbability::copy_constructor meant to not be accessable");
    50 }
    51 
    52 
    53 
    54 
    55 const G4EvaporationProbability & G4EvaporationProbability::
    56 operator=(const G4EvaporationProbability &)
     68  G4double EmissionProbability = 0.0;
     69  G4double MaximalKineticEnergy = anEnergy;
     70
     71  if (MaximalKineticEnergy > 0.0 && fragment.GetExcitationEnergy() > 0.0) {
     72    EmissionProbability = CalculateProbability(fragment, MaximalKineticEnergy);
     73
     74  }
     75  return EmissionProbability;
     76}
     77
     78////////////////////////////////////
     79
     80// Computes the integrated probability of evaporation channel
     81G4double
     82G4EvaporationProbability::CalculateProbability(const G4Fragment & fragment,
     83                                               G4double MaximalKineticEnergy)
    5784{
    58     throw G4HadronicException(__FILE__, __LINE__, "G4EvaporationProbability::operator= meant to not be accessable");
    59     return *this;
    60 }
    61 
    62 
    63 G4bool G4EvaporationProbability::operator==(const G4EvaporationProbability &) const
    64 {
    65     return false;
    66 }
    67 
    68 G4bool G4EvaporationProbability::operator!=(const G4EvaporationProbability &) const
    69 {
    70     return true;
    71 }
    72  
    73 G4double G4EvaporationProbability::EmissionProbability(const G4Fragment & fragment, const G4double anEnergy)
    74 {
    75     G4double EmissionProbability = 0.0;
    76     G4double MaximalKineticEnergy = anEnergy;
    77 
    78     if (MaximalKineticEnergy > 0.0 && fragment.GetExcitationEnergy() > 0.0) {
    79         EmissionProbability = CalculateProbability(fragment, MaximalKineticEnergy);
    80 
    81     }
    82     return EmissionProbability;
    83 }
    84 
    85 ////////////////////////////////////
    86 
    87 // Computes the integrated probability of evaporation channel
    88 G4double G4EvaporationProbability::CalculateProbability(const G4Fragment & fragment, const G4double MaximalKineticEnergy)
    89 {
    90     G4double ResidualA = fragment.GetA() - theA;
    91     G4double ResidualZ = fragment.GetZ() - theZ;
    92     G4double U = fragment.GetExcitationEnergy();
     85  G4int ResidualA = fragment.GetA_asInt() - theA;
     86  G4int ResidualZ = fragment.GetZ_asInt() - theZ;
     87  G4double U = fragment.GetExcitationEnergy();
    9388   
    94  if (OPTxs==0) {
    95 
    96        
    97     G4double NuclearMass = G4ParticleTable::GetParticleTable()->GetIonTable()->GetNucleusMass(theZ,theA);
    98 
    99 
    100     G4double delta0 = G4PairingCorrection::GetInstance()->GetPairingCorrection(static_cast<G4int>(fragment.GetA()),
    101                                                                                static_cast<G4int>(fragment.GetZ()));
    102 
    103     G4double SystemEntropy = 2.0*std::sqrt(theEvapLDPptr->LevelDensityParameter(static_cast<G4int>(fragment.GetA()),
    104                                                                            static_cast<G4int>(fragment.GetZ()),U)*
    105                                       (U-delta0));
     89  if (OPTxs==0) {
     90
     91    G4double NuclearMass = fragment.ComputeGroundStateMass(theZ,theA);
     92
     93    G4double delta0 = fPairCorr->GetPairingCorrection(fragment.GetA_asInt(),
     94                                                      fragment.GetZ_asInt());
     95
     96    G4double SystemEntropy = 2.0*std::sqrt(
     97      theEvapLDPptr->LevelDensityParameter(fragment.GetA_asInt(),fragment.GetZ_asInt(),U)*
     98      (U-delta0));
    10699                                                                 
    107 
    108     G4double RN = 1.5*fermi;
     100    const G4double RN = 1.5*fermi;
    109101
    110102    G4double Alpha = CalcAlphaParam(fragment);
     
    112104       
    113105    G4double Rmax = MaximalKineticEnergy;
    114     G4double a = theEvapLDPptr->LevelDensityParameter(static_cast<G4int>(ResidualA),
    115                                                       static_cast<G4int>(ResidualZ),
    116                                                       Rmax);
    117     G4double GlobalFactor = static_cast<G4double>(Gamma) * (Alpha/(a*a)) *
    118         (NuclearMass*RN*RN*std::pow(ResidualA,2./3.))/
    119         (2.*pi* hbar_Planck*hbar_Planck);
     106    G4double a = theEvapLDPptr->LevelDensityParameter(ResidualA,ResidualZ,Rmax);
     107    G4double GlobalFactor = Gamma * Alpha/(a*a) *
     108        (NuclearMass*RN*RN*fG4pow->Z23(ResidualA))/
     109        (twopi* hbar_Planck*hbar_Planck);
    120110    G4double Term1 = (2.0*Beta*a-3.0)/2.0 + Rmax*a;
    121111    G4double Term2 = (2.0*Beta*a-3.0)*std::sqrt(Rmax*a) + 2.0*a*Rmax;
    122112       
    123113    G4double ExpTerm1 = 0.0;
    124     if (SystemEntropy <= 600.0) ExpTerm1 = std::exp(-SystemEntropy);
     114    if (SystemEntropy <= 600.0) { ExpTerm1 = std::exp(-SystemEntropy); }
    125115       
    126116    G4double ExpTerm2 = 2.*std::sqrt(a*Rmax) - SystemEntropy;
    127     if (ExpTerm2 > 700.0) ExpTerm2 = 700.0;
     117    if (ExpTerm2 > 700.0) { ExpTerm2 = 700.0; }
    128118    ExpTerm2 = std::exp(ExpTerm2);
    129119       
     
    134124 } else if (OPTxs==1 || OPTxs==2 ||OPTxs==3 || OPTxs==4) {
    135125
    136    G4double limit;
    137    if (useSICB) limit=theCoulombBarrierptr->GetCoulombBarrier(G4lrint(ResidualA),G4lrint(ResidualZ),U);
    138    else limit=0.;
    139 
    140    if (MaximalKineticEnergy <= limit)  return 0.0;
    141 
    142 
    143    // if Coulomb barrier cutoff is superimposed for all cross sections the limit is the Coulomb Barrier
     126   G4double EvaporatedMass = fragment.ComputeGroundStateMass(theZ,theA);
     127   G4double ResidulalMass = fragment.ComputeGroundStateMass(ResidualZ,ResidualA);
     128   G4double limit = std::max(0.0,fragment.GetGroundStateMass()-EvaporatedMass-ResidulalMass);
     129   if (useSICB) {
     130     limit = std::max(limit,theCoulombBarrierptr->GetCoulombBarrier(ResidualA,ResidualZ,U));
     131   }
     132
     133   if (MaximalKineticEnergy <= limit) { return 0.0; }
     134
     135   // if Coulomb barrier cutoff is superimposed for all cross sections
     136   // then the limit is the Coulomb Barrier
    144137   G4double LowerLimit= limit;
    145138
    146    //  MaximalKineticEnergy: asimptotic value (already accounted for in G4EvaporationChannel)     
     139   //MaximalKineticEnergy: asimptotic value (already accounted for in G4EvaporationChannel)     
    147140
    148141   G4double UpperLimit = MaximalKineticEnergy;
    149142
    150 
    151143   G4double Width = IntegrateEmissionProbability(fragment,LowerLimit,UpperLimit);
    152144
    153145   return Width;
    154  } else{
     146 } else {
    155147   std::ostringstream errOs;
    156148   errOs << "Bad option for cross sections at evaporation"  <<G4endl;
     
    163155
    164156G4double G4EvaporationProbability::
    165 IntegrateEmissionProbability(const G4Fragment & fragment, const G4double & Low, const G4double & Up )
     157IntegrateEmissionProbability(const G4Fragment & fragment,
     158                             const G4double & Low, const G4double & Up )
    166159{
    167 
    168160  static const G4int N = 10;
    169161  // 10-Points Gauss-Legendre abcisas and weights
     
    212204//New method (OPT=1,2,3,4)
    213205
    214 G4double G4EvaporationProbability::ProbabilityDistributionFunction( const G4Fragment & fragment, const G4double K)
     206G4double
     207G4EvaporationProbability::ProbabilityDistributionFunction( const G4Fragment & fragment,
     208                                                           G4double K)
    215209{
    216 
     210  G4int ResidualA = fragment.GetA_asInt() - theA;
     211  G4int ResidualZ = fragment.GetZ_asInt() - theZ; 
     212  G4double U = fragment.GetExcitationEnergy();
     213  //G4cout << "### G4EvaporationProbability::ProbabilityDistributionFunction" << G4endl;
     214  //G4cout << "FragZ= " << fragment.GetZ_asInt() << " FragA= " << fragment.GetA_asInt()
     215  //     << " Z= " << theZ << "  A= " << theA << G4endl;
     216  //G4cout << "PC " << fPairCorr << "   DP " << theEvapLDPptr << G4endl;
     217
     218  // if(K <= theCoulombBarrierptr->GetCoulombBarrier(ResidualA,ResidualZ,U)) return 0.0;
     219
     220  G4double delta1 = fPairCorr->GetPairingCorrection(ResidualA,ResidualZ);
    217221 
    218 
    219 
    220   G4double ResidualA = fragment.GetA() - theA;
    221   G4double ResidualZ = fragment.GetZ() - theZ; 
    222   G4double U = fragment.GetExcitationEnergy();
    223 
    224   //        if(K <= theCoulombBarrierptr->GetCoulombBarrier(G4lrint(ResidualA),G4lrint(ResidualZ),U)) return 0.0;   
    225 
    226   G4double delta1 = G4PairingCorrection::GetInstance()->GetPairingCorrection(static_cast<G4int>(ResidualA),static_cast<G4int>(ResidualZ));
    227 
    228  
    229   G4double delta0 = G4PairingCorrection::GetInstance()->GetPairingCorrection(static_cast<G4int>(fragment.GetA()),static_cast<G4int>(fragment.GetZ()));
    230 
    231  
    232   G4double ParticleMass = G4ParticleTable::GetParticleTable()->GetIonTable()->GetNucleusMass(theZ,theA);
    233 
    234   G4double theSeparationEnergy= G4NucleiProperties::GetMassExcess(static_cast<G4int>(theA),static_cast<G4int>(theZ)) +
    235     G4NucleiProperties::GetMassExcess(static_cast<G4int>(ResidualA),static_cast<G4int>(ResidualZ)) -
    236     G4NucleiProperties::GetMassExcess(static_cast<G4int>(fragment.GetA()),static_cast<G4int>(fragment.GetZ()));
    237 
    238   G4double a0 = theEvapLDPptr->LevelDensityParameter(static_cast<G4int>(fragment.GetA()),static_cast<G4int>(fragment.GetZ()),U - delta0);
    239 
    240   G4double a1 = theEvapLDPptr->LevelDensityParameter(static_cast<G4int>(ResidualA),static_cast<G4int>(ResidualZ),U - theSeparationEnergy - delta1);
    241  
    242  
    243   G4double E0=U-delta0;
    244 
    245   G4double E1=U-theSeparationEnergy-delta1-K;
    246 
    247   if (E1<0.) return 0.;
     222  G4double delta0 = fPairCorr->GetPairingCorrection(fragment.GetA_asInt(),
     223                                                    fragment.GetZ_asInt());
     224
     225 
     226  G4double ParticleMass = fragment.ComputeGroundStateMass(theZ,theA);
     227  G4double ResidualMass = fragment.ComputeGroundStateMass(ResidualZ,ResidualA);
     228
     229  G4double theSeparationEnergy = ParticleMass + ResidualMass
     230    - fragment.GetGroundStateMass();
     231
     232  G4double a0 = theEvapLDPptr->LevelDensityParameter(fragment.GetA_asInt(),
     233                                                     fragment.GetZ_asInt(),
     234                                                     U - delta0);
     235
     236  G4double a1 = theEvapLDPptr->LevelDensityParameter(ResidualA, ResidualZ,
     237                                                     U - theSeparationEnergy - delta1);
     238 
     239 
     240  G4double E0 = U - delta0;
     241
     242  G4double E1 = U - theSeparationEnergy - delta1 - K;
     243
     244  if (E1<0.) { return 0.; }
    248245
    249246  //JMQ 14/02/09 BUG fixed: hbarc should be in the denominator instead of hbar_Planck
    250247  //Without 1/hbar_Panck remains as a width
    251   //  G4double  Prob=Gamma*ParticleMass/((pi*hbar_Planck)*(pi*hbar_Planck)*
    252   //std::exp(2*std::sqrt(a0*E0)))*K*CrossSection(fragment,K)*std::exp(2*std::sqrt(a1*E1))*millibarn;
    253248
    254249  G4double Prob=Gamma*ParticleMass/((pi*hbarc)*(pi*hbarc)*std::exp(2*std::sqrt(a0*E0)))
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/src/G4He3EvaporationChannel.cc

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4He3EvaporationChannel.cc,v 1.4 2006/06/29 20:10:33 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4He3EvaporationChannel.cc,v 1.5 2010/11/17 12:14:59 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
    3131// by V. Lara (Nov. 1999)
    3232//
     33// 17-11-2010 V.Ivanchenko moved constructor and destructor to source and cleanup
    3334
    3435#include "G4He3EvaporationChannel.hh"
    3536
     37G4He3EvaporationChannel::G4He3EvaporationChannel()
     38: G4EvaporationChannel(3,2,"He3",&theEvaporationProbability,&theCoulombBarrier)
     39{}
    3640
    37 const G4He3EvaporationChannel & G4He3EvaporationChannel::operator=(const G4He3EvaporationChannel & )
    38 {
    39     throw G4HadronicException(__FILE__, __LINE__, "G4He3EvaporationChannel::operator= meant to not be accessable");
    40     return *this;
    41 }
     41G4He3EvaporationChannel::~G4He3EvaporationChannel()
     42{}
    4243
    43 G4He3EvaporationChannel::G4He3EvaporationChannel(const G4He3EvaporationChannel & ) : G4EvaporationChannel()
    44 {
    45     throw G4HadronicException(__FILE__, __LINE__, "G4He3EvaporationChannel::CopyConstructor meant to not be accessable");
    46 }
    47 
    48 G4bool G4He3EvaporationChannel::operator==(const G4He3EvaporationChannel & right) const
    49 {
    50     return (this == (G4He3EvaporationChannel *) &right);
    51     //  return false;
    52 }
    53 
    54 G4bool G4He3EvaporationChannel::operator!=(const G4He3EvaporationChannel & right) const
    55 {
    56     return (this != (G4He3EvaporationChannel *) &right);
    57     //  return true;
    58 }
    59 
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/src/G4He3EvaporationProbability.cc

    r1315 r1347  
    2424// ********************************************************************
    2525//
    26 //J.M. Quesada (August2008). Based on:
     26// $Id: G4He3EvaporationProbability.cc,v 1.18 2010/11/17 11:06:03 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
     28//
     29// J.M. Quesada (August2008). Based on:
    2730//
    2831// Hadronic Process: Nuclear De-excitations
    2932// by V. Lara (Oct 1998)
    3033//
    31 // Modif (03 September 2008) by J. M. Quesada for external choice of inverse
    32 // cross section option
     34// Modified:
     35// 03-09-2008 J.M. Quesada for external choice of inverse cross section option
     36// 17-11-2010 V.Ivanchenko integer Z and A
    3337
    3438#include "G4He3EvaporationProbability.hh"
     
    3640G4He3EvaporationProbability::G4He3EvaporationProbability() :
    3741   G4EvaporationProbability(3,2,2,&theCoulombBarrier) // A,Z,Gamma,&theCoulombBarrier
    38 {
    39 
    40 }
    41 
    42 G4He3EvaporationProbability::G4He3EvaporationProbability(const G4He3EvaporationProbability &) : G4EvaporationProbability()
    43 {
    44     throw G4HadronicException(__FILE__, __LINE__, "G4He3EvaporationProbability::copy_constructor meant to not be accessable");
    45 }
    46 
    47 
    48 
    49 
    50 const G4He3EvaporationProbability & G4He3EvaporationProbability::
    51 operator=(const G4He3EvaporationProbability &)
    52 {
    53     throw G4HadronicException(__FILE__, __LINE__, "G4He3EvaporationProbability::operator= meant to not be accessable");
    54     return *this;
    55 }
    56 
    57 
    58 G4bool G4He3EvaporationProbability::operator==(const G4He3EvaporationProbability &) const
    59 {
    60     return false;
    61 }
    62 
    63 G4bool G4He3EvaporationProbability::operator!=(const G4He3EvaporationProbability &) const
    64 {
    65     return true;
    66 }
    67 
    68   G4double G4He3EvaporationProbability::CalcAlphaParam(const G4Fragment & fragment) 
    69   { return 1.0 + CCoeficient(static_cast<G4double>(fragment.GetZ()-GetZ()));}
     42{}
     43
     44G4He3EvaporationProbability::~G4He3EvaporationProbability()
     45{}
     46
     47G4double G4He3EvaporationProbability::CalcAlphaParam(const G4Fragment & fragment) 
     48  { return 1.0 + CCoeficient(fragment.GetZ_asInt()-GetZ());}
    7049       
    71   G4double G4He3EvaporationProbability::CalcBetaParam(const G4Fragment & ) 
     50G4double G4He3EvaporationProbability::CalcBetaParam(const G4Fragment & ) 
    7251  { return 0.0; }
    7352
    7453
    75 G4double G4He3EvaporationProbability::CCoeficient(const G4double aZ)
    76 {
    77     // Data comes from
    78     // Dostrovsky, Fraenkel and Friedlander
    79     // Physical Review, vol 116, num. 3 1959
    80     //
    81     // const G4int size = 5;
    82     // G4double Zlist[5] = { 10.0, 20.0, 30.0, 50.0, 70.0};
    83     //  G4double Calpha[5] = { 0.10, 0.10, 0.10, 0.08, 0.06};
    84     // C for He3 is equal to C for alpha times 4/3
    85     G4double C = 0.0;
     54G4double G4He3EvaporationProbability::CCoeficient(G4int aZ)
     55{
     56  // Data comes from
     57  // Dostrovsky, Fraenkel and Friedlander
     58  // Physical Review, vol 116, num. 3 1959
     59  //
     60  // const G4int size = 5;
     61  // G4double Zlist[5] = { 10.0, 20.0, 30.0, 50.0, 70.0};
     62  //    G4double Calpha[5] = { 0.10, 0.10, 0.10, 0.08, 0.06};
     63  // C for He3 is equal to C for alpha times 4/3
     64  G4double C = 0.0;
    8665       
    87        
    88     if (aZ <= 30) {
    89         C = 0.10;
    90     } else if (aZ <= 50) {
    91         C = 0.1 + -((aZ-50.)/20.)*0.02;
    92     } else if (aZ < 70) {
    93         C = 0.08 + -((aZ-70.)/20.)*0.02;
    94     } else {
    95         C = 0.06;
    96     }
    97     return C*(4.0/3.0);
     66  if (aZ <= 30)
     67    {
     68      C = 0.10;
     69    }
     70  else if (aZ <= 50)
     71    {
     72      C = 0.1 - (aZ - 30)*0.001;
     73    }
     74  else if (aZ < 70)
     75    {
     76      C = 0.08 - (aZ - 50)*0.001;
     77    }
     78  else
     79    {
     80      C = 0.06;
     81    }
     82  return C*(4.0/3.0);
    9883}
    9984
     
    10489//OPT=3,4 Kalbach's parameterization
    10590//
    106 G4double G4He3EvaporationProbability::CrossSection(const  G4Fragment & fragment, const  G4double K)
    107 {
    108        theA=GetA();
    109        theZ=GetZ();
    110        ResidualA=fragment.GetA()-theA;
    111        ResidualZ=fragment.GetZ()-theZ;
    112  
    113        ResidualAthrd=std::pow(ResidualA,0.33333);
    114        FragmentA=fragment.GetA();
    115        FragmentAthrd=std::pow(FragmentA,0.33333);
    116 
    117 
    118        if (OPTxs==0) {std::ostringstream errOs;
    119          errOs << "We should'n be here (OPT =0) at evaporation cross section calculation (He3's)!!" 
    120                <<G4endl;
    121          throw G4HadronicException(__FILE__, __LINE__, errOs.str());
    122          return 0.;}
    123        if( OPTxs==1 || OPTxs==2) return G4He3EvaporationProbability::GetOpt12( K);
    124        else if (OPTxs==3 || OPTxs==4)  return G4He3EvaporationProbability::GetOpt34( K);
    125        else{
    126          std::ostringstream errOs;
    127          errOs << "BAD He3's CROSS SECTION OPTION AT EVAPORATION!!"  <<G4endl;
    128          throw G4HadronicException(__FILE__, __LINE__, errOs.str());
    129          return 0.;
    130        }
    131 }
    132 //
    133 //********************* OPT=1,2 : Chatterjee's cross section ************************
     91G4double
     92G4He3EvaporationProbability::CrossSection(const  G4Fragment & fragment, G4double K)
     93{
     94
     95  theA=GetA();
     96  theZ=GetZ();
     97  ResidualA=fragment.GetA_asInt()-theA;
     98  ResidualZ=fragment.GetZ_asInt()-theZ;
     99 
     100  ResidualAthrd=fG4pow->Z13(ResidualA);
     101  FragmentA=fragment.GetA_asInt();
     102  FragmentAthrd=fG4pow->Z13(FragmentA);
     103
     104  if (OPTxs==0) {std::ostringstream errOs;
     105  errOs << "We should'n be here (OPT =0) at evaporation cross section calculation (He3's)!!" 
     106        <<G4endl;
     107  throw G4HadronicException(__FILE__, __LINE__, errOs.str());
     108  return 0.;}
     109  if( OPTxs==1 || OPTxs==2) return G4He3EvaporationProbability::GetOpt12( K);
     110  else if (OPTxs==3 || OPTxs==4)  return G4He3EvaporationProbability::GetOpt34( K);
     111  else{
     112    std::ostringstream errOs;
     113    errOs << "BAD He3's CROSS SECTION OPTION AT EVAPORATION!!"  <<G4endl;
     114    throw G4HadronicException(__FILE__, __LINE__, errOs.str());
     115    return 0.;
     116  }
     117}
     118
     119//********************* OPT=1,2 : Chatterjee's cross section *****************
    134120//(fitting to cross section from Bechetti & Greenles OM potential)
    135121
    136122G4double G4He3EvaporationProbability::GetOpt12(const  G4double K)
    137123{
    138 
    139 G4double Kc=K;
    140 
    141 // JMQ xsec is set constat above limit of validity
    142  if (K>50) Kc=50;
    143 
    144  G4double landa ,mu ,nu ,p , Ec,q,r,ji,xs;
    145 
    146  G4double     p0 = -3.06;
    147  G4double     p1 = 278.5;
    148  G4double     p2 = -1389.;
    149  G4double     landa0 = -0.00535;
    150  G4double     landa1 = -11.16;
    151  G4double     mu0 = 555.5;
    152  G4double     mu1 = 0.40;
    153  G4double     nu0 = 687.4;
    154  G4double     nu1 = -476.3;
    155  G4double     nu2 = 0.509;   
    156  G4double     delta=1.2;             
    157 
    158       Ec = 1.44*theZ*ResidualZ/(1.5*ResidualAthrd+delta);
    159       p = p0 + p1/Ec + p2/(Ec*Ec);
    160       landa = landa0*ResidualA + landa1;
    161       mu = mu0*std::pow(ResidualA,mu1);
    162       nu = std::pow(ResidualA,mu1)*(nu0 + nu1*Ec + nu2*(Ec*Ec));
    163       q = landa - nu/(Ec*Ec) - 2*p*Ec;
    164       r = mu + 2*nu/Ec + p*(Ec*Ec);
    165 
    166    ji=std::max(Kc,Ec);
    167    if(Kc < Ec) { xs = p*Kc*Kc + q*Kc + r;}
    168    else {xs = p*(Kc - ji)*(Kc - ji) + landa*Kc + mu + nu*(2 - Kc/ji)/ji ;}
    169    
    170    if (xs <0.0) {xs=0.0;}
     124  G4double Kc = K;
     125
     126  // JMQ xsec is set constat above limit of validity
     127  if (K > 50*MeV) { Kc = 50*MeV; }
     128
     129  G4double landa ,mu ,nu ,p , Ec,q,r,ji,xs;
     130
     131  G4double     p0 = -3.06;
     132  G4double     p1 = 278.5;
     133  G4double     p2 = -1389.;
     134  G4double     landa0 = -0.00535;
     135  G4double     landa1 = -11.16;
     136  G4double     mu0 = 555.5;
     137  G4double     mu1 = 0.40;
     138  G4double     nu0 = 687.4;
     139  G4double     nu1 = -476.3;
     140  G4double     nu2 = 0.509;   
     141  G4double     delta=1.2;             
     142
     143  Ec = 1.44*theZ*ResidualZ/(1.5*ResidualAthrd+delta);
     144  p = p0 + p1/Ec + p2/(Ec*Ec);
     145  landa = landa0*ResidualA + landa1;
     146
     147  G4double resmu1 = fG4pow->powZ(ResidualA,mu1);
     148  mu = mu0*resmu1;
     149  nu = resmu1*(nu0 + nu1*Ec + nu2*(Ec*Ec));
     150  q = landa - nu/(Ec*Ec) - 2*p*Ec;
     151  r = mu + 2*nu/Ec + p*(Ec*Ec);
     152 
     153  ji=std::max(Kc,Ec);
     154  if(Kc < Ec) { xs = p*Kc*Kc + q*Kc + r;}
     155  else {xs = p*(Kc - ji)*(Kc - ji) + landa*Kc + mu + nu*(2 - Kc/ji)/ji ;}
     156 
     157  if (xs <0.0) {xs=0.0;}
    171158             
    172    return xs;
     159  return xs;
    173160
    174161}
     
    178165//c     ** 3he from o.m. of gibson et al
    179166{
    180  
    181167  G4double landa, mu, nu, p , signor(1.),sig;
    182168  G4double ec,ecsq,xnulam,etest(0.),a;
    183169  G4double b,ecut,cut,ecut2,geom,elab;
    184  
    185  
     170
    186171  G4double     flow = 1.e-18;
    187172  G4double     spill= 1.e+18;
    188 
    189173
    190174  G4double     p0 = -2.88;
     
    200184 
    201185  G4double      ra=0.80;
    202  
     186       
    203187  //JMQ 13/02/09 increase of reduced radius to lower the barrier
    204188  // ec = 1.44 * theZ * ResidualZ / (1.5*ResidualAthrd+ra);
     
    207191  p = p0 + p1/ec + p2/ecsq;
    208192  landa = landa0*ResidualA + landa1;
    209   a = std::pow(ResidualA,mu1);
     193  a = fG4pow->powZ(ResidualA,mu1);
    210194  mu = mu0 * a;
    211195  nu = a* (nu0+nu1*ec+nu2*ecsq); 
    212196  xnulam = nu / landa;
    213   if (xnulam > spill) xnulam=0.;
    214   if (xnulam >= flow) etest = 1.2 *std::sqrt(xnulam);
     197  if (xnulam > spill) { xnulam=0.; }
     198  if (xnulam >= flow) { etest = 1.2 *std::sqrt(xnulam); }
    215199 
    216200  a = -2.*p*ec + landa - nu/ecsq;
     
    221205  ecut = (ecut-a) / (p+p);
    222206  ecut2 = ecut;
    223 //JMQ 290310 for avoiding unphysical increase below minimum (at ecut)
    224 //ecut<0 means that there is no cut with energy axis, i.e. xs is set to 0 bellow minimum
    225 //  if (cut < 0.) ecut2 = ecut - 2.;
    226   if (cut < 0.) ecut2 = ecut;
    227   elab = K * FragmentA / ResidualA;
     207  //JMQ 290310 for avoiding unphysical increase below minimum (at ecut)
     208  // ecut<0 means that there is no cut with energy axis, i.e. xs is set
     209  // to 0 bellow minimum
     210  //  if (cut < 0.) ecut2 = ecut - 2.;
     211  if (cut < 0.) { ecut2 = ecut; }
     212  elab = K * FragmentA /G4double(ResidualA);
    228213  sig = 0.;
    229 
     214 
    230215  if (elab <= ec) { //start for E<Ec
    231     if (elab > ecut2)  sig = (p*elab*elab+a*elab+b) * signor;
     216    if (elab > ecut2) { sig = (p*elab*elab+a*elab+b) * signor; }
    232217  }           //end for E<Ec
    233218  else {           //start for E>Ec
    234219    sig = (landa*elab+mu+nu/elab) * signor;
    235220    geom = 0.;
    236     if (xnulam < flow || elab < etest) return sig;
     221    if (xnulam < flow || elab < etest) { return sig; }
    237222    geom = std::sqrt(theA*K);
    238223    geom = 1.23*ResidualAthrd + ra + 4.573/geom;
     
    243228 
    244229}
    245 
    246 //   ************************** end of cross sections *******************************
    247 
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/src/G4NeutronEvaporationChannel.cc

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4NeutronEvaporationChannel.cc,v 1.4 2006/06/29 20:10:37 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4NeutronEvaporationChannel.cc,v 1.5 2010/11/17 12:14:59 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
    3131// by V. Lara (Nov. 1999)
    3232//
     33// 17-11-2010 V.Ivanchenko moved constructor and destructor to source and cleanup
    3334
    3435#include "G4NeutronEvaporationChannel.hh"
    3536
     37G4NeutronEvaporationChannel::G4NeutronEvaporationChannel()
     38: G4EvaporationChannel(1,0,"neutron",&theEvaporationProbability,&theCoulombBarrier)
     39{}
    3640
    37 const G4NeutronEvaporationChannel & G4NeutronEvaporationChannel::operator=(const G4NeutronEvaporationChannel & )
    38 {
    39     throw G4HadronicException(__FILE__, __LINE__, "G4NeutronEvaporationChannel::operator= meant to not be accessable");
    40     return *this;
    41 }
    42 
    43 G4NeutronEvaporationChannel::G4NeutronEvaporationChannel(const G4NeutronEvaporationChannel & ) : G4EvaporationChannel()
    44 {
    45     throw G4HadronicException(__FILE__, __LINE__, "G4NeutronEvaporationChannel::CopyConstructor meant to not be accessable");
    46 }
    47 
    48 G4bool G4NeutronEvaporationChannel::operator==(const G4NeutronEvaporationChannel & right) const
    49 {
    50     return (this == (G4NeutronEvaporationChannel *) &right);
    51     //  return false;
    52 }
    53 
    54 G4bool G4NeutronEvaporationChannel::operator!=(const G4NeutronEvaporationChannel & right) const
    55 {
    56     return (this != (G4NeutronEvaporationChannel *) &right);
    57     //  return true;
    58 }
    59 
     41G4NeutronEvaporationChannel::~G4NeutronEvaporationChannel()
     42{}
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/src/G4NeutronEvaporationProbability.cc

    r962 r1347  
    2424// ********************************************************************
    2525//
    26 //J.M. Quesada (August2008). Based on:
     26// $Id: G4NeutronEvaporationProbability.cc,v 1.16 2010/11/17 11:06:03 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
     28//
     29// J.M. Quesada (August2008). Based on:
    2730//
    2831// Hadronic Process: Nuclear De-excitations
    2932// by V. Lara (Oct 1998)
    3033//
    31 // Modif (03 September 2008) by J. M. Quesada for external choice of inverse
    32 // cross section option
     34// Modified:
     35// 03-09-2008 J.M. Quesada for external choice of inverse cross section option
     36// 17-11-2010 V.Ivanchenko integer Z and A
    3337
    3438#include "G4NeutronEvaporationProbability.hh"
     
    3640G4NeutronEvaporationProbability::G4NeutronEvaporationProbability() :
    3741    G4EvaporationProbability(1,0,2,&theCoulombBarrier) // A,Z,Gamma,&theCoulombBarrier
    38 {
    39  
    40 }
    41 
    42 
    43 G4NeutronEvaporationProbability::G4NeutronEvaporationProbability(const G4NeutronEvaporationProbability &) : G4EvaporationProbability()
    44 {
    45     throw G4HadronicException(__FILE__, __LINE__, "G4NeutronEvaporationProbability::copy_constructor meant to not be accessable");
    46 }
    47 
    48 
    49 
    50 
    51 const G4NeutronEvaporationProbability & G4NeutronEvaporationProbability::
    52 operator=(const G4NeutronEvaporationProbability &)
    53 {
    54     throw G4HadronicException(__FILE__, __LINE__, "G4NeutronEvaporationProbability::operator= meant to not be accessable");
    55     return *this;
    56 }
    57 
    58 
    59 G4bool G4NeutronEvaporationProbability::operator==(const G4NeutronEvaporationProbability &) const
    60 {
    61     return false;
    62 }
    63 
    64 G4bool G4NeutronEvaporationProbability::operator!=(const G4NeutronEvaporationProbability &) const
    65 {
    66     return true;
    67 }
    68 
    69  G4double G4NeutronEvaporationProbability::CalcAlphaParam(const G4Fragment & fragment)
    70   { return 0.76+2.2/std::pow(static_cast<G4double>(fragment.GetA()-GetA()),1.0/3.0);}
    71 
     42{}
     43
     44G4NeutronEvaporationProbability::~G4NeutronEvaporationProbability()
     45{}
     46
     47G4double G4NeutronEvaporationProbability::CalcAlphaParam(const G4Fragment & fragment)
     48{
     49  return 0.76+2.2/fG4pow->Z13(fragment.GetA_asInt()-GetA());
     50}
    7251       
    73   G4double G4NeutronEvaporationProbability::CalcBetaParam(const G4Fragment &  fragment)
    74   { return (2.12/std::pow(static_cast<G4double>(fragment.GetA()-GetA()),2.0/3.0) - 0.05)*MeV/
    75       CalcAlphaParam(fragment); }
    76 
     52G4double G4NeutronEvaporationProbability::CalcBetaParam(const G4Fragment &  fragment)
     53{
     54  return (2.12/fG4pow->Z23(fragment.GetA_asInt()-GetA()) - 0.05)*MeV/
     55    CalcAlphaParam(fragment);
     56}
    7757
    7858////////////////////////////////////////////////////////////////////////////////////
     
    8262//OPT=3,4 Kalbach's parameterization
    8363//
    84  G4double G4NeutronEvaporationProbability::CrossSection(const  G4Fragment & fragment, const  G4double K)
     64G4double
     65G4NeutronEvaporationProbability::CrossSection(const  G4Fragment & fragment, G4double K)
    8566{
    8667  theA=GetA();
    8768  theZ=GetZ();
    88   ResidualA=fragment.GetA()-theA;
    89   ResidualZ=fragment.GetZ()-theZ;
    90  
    91   ResidualAthrd=std::pow(ResidualA,0.33333);
    92   FragmentA=fragment.GetA();
    93   FragmentAthrd=std::pow(FragmentA,0.33333);
    94 
     69  ResidualA=fragment.GetA_asInt()-theA;
     70  ResidualZ=fragment.GetZ_asInt()-theZ;
     71 
     72  ResidualAthrd=fG4pow->Z13(ResidualA);
     73  FragmentA=fragment.GetA_asInt();
     74  FragmentAthrd=fG4pow->Z13(FragmentA);
    9575
    9676  if (OPTxs==0) {std::ostringstream errOs;
     
    10787  }
    10888}
    109 
    110 
    111 
    112 
    113 
    114 
    115 //********************* OPT=1,2 : Chatterjee's cross section ************************
     89 
     90//********************* OPT=1,2 : Chatterjee's cross section ***************
    11691//(fitting to cross section from Bechetti & Greenles OM potential)
    11792
    118 G4double G4NeutronEvaporationProbability::GetOpt12(const  G4double K)
     93G4double G4NeutronEvaporationProbability::GetOpt12(G4double K)
    11994{
    120 
    12195  G4double Kc=K;
    12296
    123 // JMQ  xsec is set constat above limit of validity
    124   if (K>50) Kc=50;
     97  // Pramana (Bechetti & Greenles) for neutrons is chosen
     98
     99  // JMQ  xsec is set constat above limit of validity
     100  if (K > 50*MeV) { Kc = 50*MeV; }
    125101
    126102  G4double landa, landa0, landa1, mu, mu0, mu1,nu, nu0, nu1, nu2,xs;
     
    143119    errOs <<"  xsec("<<Kc<<" MeV) ="<<xs <<G4endl;
    144120    throw G4HadronicException(__FILE__, __LINE__, errOs.str());
    145   }
     121              }
    146122  return xs;
    147123}
    148124
    149 
    150125// *********** OPT=3,4 : Kalbach's cross sections (from PRECO code)*************
    151 G4double G4NeutronEvaporationProbability::GetOpt34(const  G4double K)
     126G4double G4NeutronEvaporationProbability::GetOpt34(G4double K)
    152127{
    153 
    154128  G4double landa, landa0, landa1, mu, mu0, mu1,nu, nu0, nu1, nu2;
    155129  G4double p, p0, p1, p2;
     
    157131  G4double b,ecut,cut,ecut2,geom,elab;
    158132
    159 //safety initialization
     133  //safety initialization
    160134  landa0=0;
    161135  landa1=0;
     
    169143  p2=0.;
    170144
    171 
    172145  flow = 1.e-18;
    173146  spill= 1.0e+18;
    174147
    175  
    176 
    177 // PRECO xs for neutrons is choosen
    178 
     148  // PRECO xs for neutrons is choosen
    179149  p0 = -312.;
    180150  p1= 0.;
     
    188158  nu2 = 1280.8;
    189159
    190   if (ResidualA < 40.) signor=0.7+ResidualA*0.0075;
    191   if (ResidualA > 210.) signor = 1. + (ResidualA-210.)/250.;
     160  if (ResidualA < 40)  { signor =0.7 + ResidualA*0.0075; }
     161  if (ResidualA > 210) { signor = 1. + (ResidualA-210)/250.; }
    192162  landa = landa0/ResidualAthrd + landa1;
    193163  mu = mu0*ResidualAthrd + mu1*ResidualAthrd*ResidualAthrd;
     
    195165
    196166  // JMQ very low energy behaviour corrected (problem  for A (apprx.)>60)
    197   if (nu < 0.)nu=-nu;
     167  if (nu < 0.) { nu=-nu; }
    198168
    199169  ec = 0.5;
     
    202172  xnulam = 1.;
    203173  etest = 32.;
    204 //          ** etest is the energy above which the rxn cross section is
    205 //          ** compared with the geometrical limit and the max taken.
    206 //          ** xnulam here is a dummy value to be used later.
    207 
    208 
     174  //          ** etest is the energy above which the rxn cross section is
     175  //          ** compared with the geometrical limit and the max taken.
     176  //          ** xnulam here is a dummy value to be used later.
    209177
    210178  a = -2.*p*ec + landa - nu/ecsq;
     
    212180  ecut = 0.;
    213181  cut = a*a - 4.*p*b;
    214   if (cut > 0.) ecut = std::sqrt(cut);
     182  if (cut > 0.) { ecut = std::sqrt(cut); }
    215183  ecut = (ecut-a) / (p+p);
    216184  ecut2 = ecut;
    217   if (cut < 0.) ecut2 = ecut - 2.;
    218   elab = K * FragmentA / ResidualA;
     185  if (cut < 0.) { ecut2 = ecut - 2.; }
     186  elab = K * FragmentA / G4double(ResidualA);
    219187  sig = 0.;
    220188  if (elab <= ec) { //start for E<Ec
    221     if (elab > ecut2)  sig = (p*elab*elab+a*elab+b) * signor;   
     189    if (elab > ecut2) { sig = (p*elab*elab+a*elab+b) * signor; }
    222190  }              //end for E<Ec
    223191  else {           //start for  E>Ec
    224192    sig = (landa*elab+mu+nu/elab) * signor;
    225193    geom = 0.;
    226     if (xnulam < flow || elab < etest) return sig;
     194    if (xnulam < flow || elab < etest) { return sig; }
    227195    geom = std::sqrt(theA*K);
    228196    geom = 1.23*ResidualAthrd + ra + 4.573/geom;
    229197    geom = 31.416 * geom * geom;
    230198    sig = std::max(geom,sig);
     199
    231200  }
    232   return sig;}
    233 
    234 //   ************************** end of cross sections *******************************
    235 
     201  return sig;
     202}
     203
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/src/G4ProtonEvaporationChannel.cc

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4ProtonEvaporationChannel.cc,v 1.4 2006/06/29 20:10:41 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4ProtonEvaporationChannel.cc,v 1.5 2010/11/17 12:14:59 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
    3131// by V. Lara (Nov. 1999)
    3232//
     33// 17-11-2010 V.Ivanchenko moved constructor and destructor to source and cleanup
    3334
    3435#include "G4ProtonEvaporationChannel.hh"
    3536
     37G4ProtonEvaporationChannel::G4ProtonEvaporationChannel()
     38: G4EvaporationChannel(1,1,"proton",&theEvaporationProbability,&theCoulombBarrier)
     39{}
    3640
    37 const G4ProtonEvaporationChannel & G4ProtonEvaporationChannel::operator=(const G4ProtonEvaporationChannel & )
    38 {
    39     throw G4HadronicException(__FILE__, __LINE__, "G4ProtonEvaporationChannel::operator= meant to not be accessable");
    40     return *this;
    41 }
    42 
    43 G4ProtonEvaporationChannel::G4ProtonEvaporationChannel(const G4ProtonEvaporationChannel & ) : G4EvaporationChannel()
    44 {
    45     throw G4HadronicException(__FILE__, __LINE__, "G4ProtonEvaporationChannel::CopyConstructor meant to not be accessable");
    46 }
    47 
    48 G4bool G4ProtonEvaporationChannel::operator==(const G4ProtonEvaporationChannel & right) const
    49 {
    50     return (this == (G4ProtonEvaporationChannel *) &right);
    51     //  return false;
    52 }
    53 
    54 G4bool G4ProtonEvaporationChannel::operator!=(const G4ProtonEvaporationChannel & right) const
    55 {
    56     return (this != (G4ProtonEvaporationChannel *) &right);
    57     //  return true;
    58 }
    59 
    60 
     41G4ProtonEvaporationChannel::~G4ProtonEvaporationChannel()
     42{}
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/src/G4ProtonEvaporationProbability.cc

    r1315 r1347  
    2424// ********************************************************************
    2525//
    26 //J.M. Quesada (August2008). Based on:
     26// $Id: G4ProtonEvaporationProbability.cc,v 1.17 2010/11/17 11:06:03 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
     28//
     29// J.M. Quesada (August2008). Based on:
    2730//
    2831// Hadronic Process: Nuclear De-excitations
    2932// by V. Lara (Oct 1998)
    3033//
    31 // Modif (03 September 2008) by J. M. Quesada for external choice of inverse
    32 // cross section option
     34// Modified:
     35// 03-09-2008 J.M. Quesada for external choice of inverse cross section option
     36// 17-11-2010 V.Ivanchenko integer Z and A
    3337
    3438#include "G4ProtonEvaporationProbability.hh"
     
    3640G4ProtonEvaporationProbability::G4ProtonEvaporationProbability() :
    3741    G4EvaporationProbability(1,1,2,&theCoulombBarrier) // A,Z,Gamma,&theCoulombBarrier
    38 {
    39    
    40 }
    41 
    42 G4ProtonEvaporationProbability::G4ProtonEvaporationProbability(const G4ProtonEvaporationProbability &) : G4EvaporationProbability()
    43 {
    44     throw G4HadronicException(__FILE__, __LINE__, "G4ProtonEvaporationProbability::copy_constructor meant to not be accessable");
    45 }
    46 
    47 const G4ProtonEvaporationProbability & G4ProtonEvaporationProbability::
    48 operator=(const G4ProtonEvaporationProbability &)
    49 {
    50     throw G4HadronicException(__FILE__, __LINE__, "G4ProtonEvaporationProbability::operator= meant to not be accessable");
    51     return *this;
    52 }
    53 
    54 
    55 G4bool G4ProtonEvaporationProbability::operator==(const G4ProtonEvaporationProbability &) const
    56 {
    57     return false;
    58 }
    59 
    60 G4bool G4ProtonEvaporationProbability::operator!=(const G4ProtonEvaporationProbability &) const
    61 {
    62     return true;
    63 }
    64 
    65   G4double G4ProtonEvaporationProbability::CalcAlphaParam(const G4Fragment & fragment)
    66   { return 1.0 + CCoeficient(static_cast<G4double>(fragment.GetZ()-GetZ()));}
    67        
    68   G4double G4ProtonEvaporationProbability::CalcBetaParam(const G4Fragment & ) 
     42{}
     43
     44G4ProtonEvaporationProbability::~G4ProtonEvaporationProbability()
     45{}
     46
     47G4double G4ProtonEvaporationProbability::CalcAlphaParam(const G4Fragment & fragment)
     48  { return 1.0 + CCoeficient(fragment.GetZ_asInt()-GetZ());}
     49       
     50G4double G4ProtonEvaporationProbability::CalcBetaParam(const G4Fragment & ) 
    6951  { return 0.0; }
    7052
    71   G4double G4ProtonEvaporationProbability::CCoeficient(const G4double aZ)
    72 {
    73     // Data comes from
    74     // Dostrovsky, Fraenkel and Friedlander
    75     // Physical Review, vol 116, num. 3 1959
    76     //
    77     // const G4int size = 5;
    78     // G4double Zlist[5] = { 10.0, 20.0, 30.0, 50.0, 70.0};
    79     // G4double Cp[5] = { 0.50, 0.28, 0.20, 0.15, 0.10};
    80     G4double C = 0.0;
    81        
    82     if (aZ >= 70) {
    83         C = 0.10;
    84     } else {
    85         C = ((((0.15417e-06*aZ) - 0.29875e-04)*aZ + 0.21071e-02)*aZ - 0.66612e-01)*aZ + 0.98375;
    86     }
    87        
    88     return C;
     53G4double G4ProtonEvaporationProbability::CCoeficient(G4int aZ)
     54{
     55  // Data comes from
     56  // Dostrovsky, Fraenkel and Friedlander
     57  // Physical Review, vol 116, num. 3 1959
     58  //
     59  // const G4int size = 5;
     60  // G4double Zlist[5] = { 10.0, 20.0, 30.0, 50.0, 70.0};
     61  // G4double Cp[5] = { 0.50, 0.28, 0.20, 0.15, 0.10};
     62  G4double C = 0.0;
     63       
     64  if (aZ >= 70) {
     65    C = 0.10;
     66  } else {
     67    C = ((((0.15417e-06*aZ) - 0.29875e-04)*aZ + 0.21071e-02)*aZ - 0.66612e-01)*aZ + 0.98375;
     68  }
     69       
     70  return C;
    8971       
    9072}
     
    9779//OPT=3 Kalbach's parameterization
    9880//
    99 G4double G4ProtonEvaporationProbability::CrossSection(const  G4Fragment & fragment, const  G4double K)
    100 {
    101 //  G4cout<<" In G4ProtonEVaporationProbability OPTxs="<<OPTxs<<G4endl;
    102 //  G4cout<<" In G4ProtonEVaporationProbability useSICB="<<useSICB<<G4endl;
     81G4double
     82G4ProtonEvaporationProbability::CrossSection(const  G4Fragment & fragment, G4double K)
     83{
     84  //  G4cout<<" In G4ProtonEVaporationProbability OPTxs="<<OPTxs<<G4endl;
     85  //  G4cout<<" In G4ProtonEVaporationProbability useSICB="<<useSICB<<G4endl;
    10386
    10487  theA=GetA();
    10588  theZ=GetZ();
    106   ResidualA=fragment.GetA()-theA;
    107   ResidualZ=fragment.GetZ()-theZ;
    108  
    109   ResidualAthrd=std::pow(ResidualA,0.33333);
    110   FragmentA=fragment.GetA();
    111   FragmentAthrd=std::pow(FragmentA,0.33333);
     89  ResidualA=fragment.GetA_asInt()-theA;
     90  ResidualZ=fragment.GetZ_asInt()-theZ;
     91 
     92  ResidualAthrd=fG4pow->Z13(ResidualA);
     93  FragmentA=fragment.GetA_asInt();
     94  FragmentAthrd=fG4pow->Z13(FragmentA);
     95
    11296  U=fragment.GetExcitationEnergy();
    11397
     
    126110  }
    127111}
    128 //********************* OPT=1 : Chatterjee's cross section ************************
     112
     113//********************* OPT=1 : Chatterjee's cross section *********************
    129114//(fitting to cross section from Bechetti & Greenles OM potential)
    130115
    131 G4double G4ProtonEvaporationProbability::GetOpt1(const  G4double K)
     116G4double G4ProtonEvaporationProbability::GetOpt1(G4double K)
    132117{
    133118  G4double Kc=K;
    134119
    135 // JMQ  xsec is set constat above limit of validity
    136   if (K>50)  Kc=50;
     120  // JMQ  xsec is set constat above limit of validity
     121  if (K > 50*MeV) { Kc = 50*MeV; }
    137122
    138123  G4double landa, landa0, landa1, mu, mu0, mu1,nu, nu0, nu1, nu2,xs;
     
    154139  p = p0 + p1/Ec + p2/(Ec*Ec);
    155140  landa = landa0*ResidualA + landa1;
    156   mu = mu0*std::pow(ResidualA,mu1);
    157   nu = std::pow(ResidualA,mu1)*(nu0 + nu1*Ec + nu2*(Ec*Ec));
     141
     142  G4double resmu1 = fG4pow->powZ(ResidualA,mu1);
     143  mu = mu0*resmu1;
     144  nu = resmu1*(nu0 + nu1*Ec + nu2*(Ec*Ec));
    158145  q = landa - nu/(Ec*Ec) - 2*p*Ec;
    159146  r = mu + 2*nu/Ec + p*(Ec*Ec);
     
    162149  if(Kc < Ec) { xs = p*Kc*Kc + q*Kc + r;}
    163150  else {xs = p*(Kc - ji)*(Kc - ji) + landa*Kc + mu + nu*(2 - Kc/ji)/ji ;}
    164    if (xs <0.0) {xs=0.0;}
    165 
    166    return xs;
    167 
    168 }
    169 
    170 
    171 
    172 //************* OPT=2 : Wellisch's proton reaction cross section ************************
    173 
    174 G4double G4ProtonEvaporationProbability::GetOpt2(const  G4double K)
    175 {
    176 
    177   G4double rnpro,rnneu,eekin,ekin,ff1,ff2,ff3,r0,fac,fac1,fac2,b0,xine_th(0);
     151  if (xs <0.0) {xs=0.0;}
     152
     153  return xs;
     154}
     155
     156//************* OPT=2 : Welisch's proton reaction cross section ***************
     157
     158G4double G4ProtonEvaporationProbability::GetOpt2(G4double K)
     159{
     160
     161  G4double eekin,ekin,ff1,ff2,ff3,r0,fac,fac1,fac2,b0,xine_th(0);
    178162 
    179 //This is redundant when the Coulomb  barrier is overimposed to all cross sections
    180 //It should be kept when Coulomb barrier only imposed at OPTxs=2, this is why ..
    181 
    182          if(!useSICB && K <= theCoulombBarrier.GetCoulombBarrier(G4lrint(ResidualA),G4lrint(ResidualZ),U)) return xine_th=0.0;
     163  // This is redundant when the Coulomb  barrier is overimposed to all
     164  // cross sections
     165  // It should be kept when Coulomb barrier only imposed at OPTxs=2
     166
     167  if(!useSICB && K<=theCoulombBarrier.GetCoulombBarrier(ResidualA,ResidualZ,U))
     168    { return 0.0; }
    183169
    184170  eekin=K;
    185   rnpro=ResidualZ;
    186   rnneu=ResidualA-ResidualZ;
     171  G4int rnneu=ResidualA-ResidualZ;
    187172  ekin=eekin/1000;
    188 
    189173  r0=1.36*1.e-15;
    190174  fac=pi*r0*r0;
     
    192176  fac1=b0*(1.-1./ResidualAthrd);
    193177  fac2=1.;
    194   if(rnneu > 1.5) fac2=std::log(rnneu);
     178  if(rnneu > 1.5) { fac2 = fG4pow->logZ(rnneu); }
    195179  xine_th= 1.e+31*fac*fac2*(1.+ResidualAthrd-fac1);
    196180  xine_th=(1.-0.15*std::exp(-ekin))*xine_th/(1.00-0.0007*ResidualA);   
    197   ff1=0.70-0.0020*ResidualA ;
    198   ff2=1.00+1/ResidualA;
    199   ff3=0.8+18/ResidualA-0.002*ResidualA;
     181  ff1=0.70-0.0020*ResidualA;
     182  ff2=1.00+1/G4double(ResidualA);
     183  ff3=0.8+18/G4double(ResidualA)-0.002*ResidualA;
    200184  fac=1.-(1./(1.+std::exp(-8.*ff1*(std::log10(ekin)+1.37*ff2))));
    201185  xine_th=xine_th*(1.+ff3*fac);
    202   ff1=1.-1/ResidualA-0.001*ResidualA;
    203   ff2=1.17-2.7/ResidualA-0.0014*ResidualA;
     186  ff1=1.-1/G4double(ResidualA)-0.001*ResidualA;
     187  ff2=1.17-2.7/G4double(ResidualA)-0.0014*ResidualA;
    204188  fac=-8.*ff1*(std::log10(ekin)+2.0*ff2);
    205189  fac=1./(1.+std::exp(fac));
    206   xine_th=xine_th*fac;               
     190  xine_th=xine_th*fac;           
    207191  if (xine_th < 0.0){
    208192    std::ostringstream errOs;
     
    212196    throw G4HadronicException(__FILE__, __LINE__, errOs.str());
    213197  }
    214 
    215198  return xine_th;
    216            
    217 }
    218 
     199}
    219200
    220201// *********** OPT=3 : Kalbach's cross sections (from PRECO code)*************
    221202G4double G4ProtonEvaporationProbability::GetOpt3(const  G4double K)
    222203{
    223 //     ** p from  becchetti and greenlees (but modified with sub-barrier
    224 //     ** correction function and xp2 changed from -449)
     204  //     ** p from  becchetti and greenlees (but modified with sub-barrier
     205  //     ** correction function and xp2 changed from -449)
    225206
    226207  G4double landa, landa0, landa1, mu, mu0, mu1,nu, nu0, nu1, nu2;
     
    236217  nu1 = -182.4;
    237218  nu2 = -1.872;
    238 
    239 // parameters for  proton cross section refinement
     219 
     220  // parameters for  proton cross section refinement
    240221  G4double afit,bfit,a2,b2;
    241222  afit=-0.0785656;
     
    243224  a2= -0.00089076;
    244225  b2= 0.0231597; 
    245 
     226 
    246227  G4double ec,ecsq,xnulam,etest(0.),ra(0.),a,w,c,signor(1.),signor2,sig;
    247228  G4double b,ecut,cut,ecut2,geom,elab;
    248 
    249 
     229   
    250230  G4double      flow = 1.e-18;
    251231  G4double       spill= 1.e+18;
    252 
    253 
    254   if (ResidualA <= 60.)  signor = 0.92;
    255   else if (ResidualA < 100.) signor = 0.8 + ResidualA*0.002;
    256 
    257 
     232   
     233  if (ResidualA <= 60)      { signor = 0.92; }
     234  else if (ResidualA < 100) { signor = 0.8 + ResidualA*0.002; }
     235 
    258236  ec = 1.44 * theZ * ResidualZ / (1.5*ResidualAthrd+ra);
    259237  ecsq = ec * ec;
    260238  p = p0 + p1/ec + p2/ecsq;
    261239  landa = landa0*ResidualA + landa1;
    262   a = std::pow(ResidualA,mu1);
     240  a = fG4pow->powZ(ResidualA,mu1);
    263241  mu = mu0 * a;
    264242  nu = a* (nu0+nu1*ec+nu2*ecsq);
    265  
     243  
    266244  c =std::min(3.15,ec*0.5);
    267245  w = 0.7 * c / 3.15;
    268 
     246 
    269247  xnulam = nu / landa;
    270   if (xnulam > spill) xnulam=0.;
    271   if (xnulam >= flow) etest =std::sqrt(xnulam) + 7.;
    272 
     248  if (xnulam > spill) { xnulam=0.; }
     249  if (xnulam >= flow) { etest =std::sqrt(xnulam) + 7.; }
     250 
    273251  a = -2.*p*ec + landa - nu/ecsq;
    274252  b = p*ecsq + mu + 2.*nu/ec;
    275253  ecut = 0.;
    276254  cut = a*a - 4.*p*b;
    277   if (cut > 0.) ecut = std::sqrt(cut);
     255  if (cut > 0.) { ecut = std::sqrt(cut); }
    278256  ecut = (ecut-a) / (p+p);
    279257  ecut2 = ecut;
    280 //JMQ 290310 for avoiding unphysical increase below minimum (at ecut)
    281 //ecut<0 means that there is no cut with energy axis, i.e. xs is set to 0 bellow minimum
    282 //  if (cut < 0.) ecut2 = ecut - 2.;
    283  if (cut < 0.) ecut2 = ecut;
    284   elab = K * FragmentA / ResidualA;
     258  //JMQ 290310 for avoiding unphysical increase below minimum (at ecut)
     259  // ecut<0 means that there is no cut with energy axis, i.e. xs is set
     260  // to 0 bellow minimum
     261  //  if (cut < 0.) ecut2 = ecut - 2.;
     262  if (cut < 0.) { ecut2 = ecut; }
     263  elab = K * FragmentA /G4double(ResidualA);
    285264  sig = 0.;
    286265  if (elab <= ec) { //start for E<Ec
    287     if (elab > ecut2)  sig = (p*elab*elab+a*elab+b) * signor;
     266    if (elab > ecut2) { sig = (p*elab*elab+a*elab+b) * signor; }
     267   
    288268    signor2 = (ec-elab-c) / w;
    289269    signor2 = 1. + std::exp(signor2);
    290     sig = sig / signor2;     
    291                        }       //end for E<=Ec
    292   else            {           //start for  E>Ec
     270    sig = sig / signor2;
     271  }              //end for E<=Ec
     272  else{           //start for  E>Ec
    293273    sig = (landa*elab+mu+nu/elab) * signor;
    294274    geom = 0.;
    295 
    296     if (xnulam < flow || elab < etest)
    297      {
     275   
     276    if (xnulam < flow || elab < etest) 
     277      {
    298278        if (sig <0.0) {sig=0.0;}
    299279        return sig;
     
    303283    geom = 31.416 * geom * geom;
    304284    sig = std::max(geom,sig);
    305 
     285   
    306286  }   //end for E>Ec
    307  return sig;}
    308 
    309 
    310 
    311 //   ************************** end of cross sections *******************************
    312 
     287  return sig;
     288}
     289
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/src/G4TritonEvaporationChannel.cc

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4TritonEvaporationChannel.cc,v 1.4 2006/06/29 20:10:45 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4TritonEvaporationChannel.cc,v 1.5 2010/11/17 12:14:59 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
    3131// by V. Lara (Nov. 1999)
    3232//
     33// 17-11-2010 V.Ivanchenko moved constructor and destructor to source and cleanup
    3334
    3435#include "G4TritonEvaporationChannel.hh"
    3536
     37G4TritonEvaporationChannel::G4TritonEvaporationChannel()
     38: G4EvaporationChannel(3,1,"triton",&theEvaporationProbability,&theCoulombBarrier)
     39{}
    3640
    37 const G4TritonEvaporationChannel & G4TritonEvaporationChannel::
    38 operator=(const G4TritonEvaporationChannel & )
    39 {
    40     throw G4HadronicException(__FILE__, __LINE__, "G4TritonEvaporationChannel::operator= meant to not be accessable");
    41     return *this;
    42 }
     41G4TritonEvaporationChannel::~G4TritonEvaporationChannel()
     42{}
    4343
    44 G4TritonEvaporationChannel::G4TritonEvaporationChannel(const G4TritonEvaporationChannel & ) : G4EvaporationChannel()
    45 {
    46     throw G4HadronicException(__FILE__, __LINE__, "G4TritonEvaporationChannel::CopyConstructor meant to not be accessable");
    47 }
    48 
    49 G4bool G4TritonEvaporationChannel::operator==(const G4TritonEvaporationChannel & right) const
    50 {
    51     return (this == (G4TritonEvaporationChannel *) &right);
    52 }
    53 
    54 G4bool G4TritonEvaporationChannel::operator!=(const G4TritonEvaporationChannel & right) const
    55 {
    56     return (this != (G4TritonEvaporationChannel *) &right);
    57 }
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/src/G4TritonEvaporationProbability.cc

    r1315 r1347  
    2424// ********************************************************************
    2525//
    26 //J.M. Quesada (August2008). Based on:
     26// $Id: G4TritonEvaporationProbability.cc,v 1.18 2010/11/17 11:06:03 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
     28//
     29// J.M. Quesada (August2008). Based on:
    2730//
    2831// Hadronic Process: Nuclear De-excitations
    2932// by V. Lara (Oct 1998)
    3033//
    31 // Modif (03 September 2008) by J. M. Quesada for external choice of inverse
    32 // cross section option
     34// Modified:
     35// 03-09-2008 J.M. Quesada for external choice of inverse cross section option
     36// 17-11-2010 V.Ivanchenko integer Z and A
    3337
    3438#include "G4TritonEvaporationProbability.hh"
     
    3640G4TritonEvaporationProbability::G4TritonEvaporationProbability() :
    3741    G4EvaporationProbability(3,1,2,&theCoulombBarrier) // A,Z,Gamma,&theCoulombBarrier
    38 {
    39 
    40 }
    41 
    42 G4TritonEvaporationProbability::G4TritonEvaporationProbability(const G4TritonEvaporationProbability &) : G4EvaporationProbability()
    43 {
    44     throw G4HadronicException(__FILE__, __LINE__, "G4TritonEvaporationProbability::copy_constructor meant to not be accessable");
    45 }
    46 
    47 
    48 
    49 
    50 const G4TritonEvaporationProbability & G4TritonEvaporationProbability::
    51 operator=(const G4TritonEvaporationProbability &)
    52 {
    53     throw G4HadronicException(__FILE__, __LINE__, "G4TritonEvaporationProbability::operator= meant to not be accessable");
    54     return *this;
    55 }
    56 
    57 
    58 G4bool G4TritonEvaporationProbability::operator==(const G4TritonEvaporationProbability &) const
    59 {
    60     return false;
    61 }
    62 
    63 G4bool G4TritonEvaporationProbability::operator!=(const G4TritonEvaporationProbability &) const
    64 {
    65     return true;
    66 }
    67 
    68    G4double G4TritonEvaporationProbability::CalcAlphaParam(const G4Fragment & fragment)
    69   { return 1.0 + CCoeficient(static_cast<G4double>(fragment.GetZ()-GetZ()));}
     42{}
     43
     44G4TritonEvaporationProbability::~G4TritonEvaporationProbability()
     45{}
     46
     47G4double G4TritonEvaporationProbability::CalcAlphaParam(const G4Fragment & fragment)
     48{
     49  return 1.0 + CCoeficient(fragment.GetZ_asInt()-GetZ());
     50}
    7051       
    71   G4double G4TritonEvaporationProbability::CalcBetaParam(const G4Fragment & )
    72   { return 0.0; }
    73 
    74 G4double G4TritonEvaporationProbability::CCoeficient(const G4double aZ)
    75 {
    76     // Data comes from
    77     // Dostrovsky, Fraenkel and Friedlander
    78     // Physical Review, vol 116, num. 3 1959
    79     //
    80     // const G4int size = 5;
    81     // G4double Zlist[5] = { 10.0, 20.0, 30.0, 50.0, 70.0};
    82     // G4double Cp[5] = { 0.50, 0.28, 0.20, 0.15, 0.10};
    83     // C for triton is equal to C for protons divided by 3
    84     G4double C = 0.0;
     52G4double G4TritonEvaporationProbability::CalcBetaParam(const G4Fragment & )
     53{
     54  return 0.0;
     55}
     56
     57G4double G4TritonEvaporationProbability::CCoeficient(G4int aZ)
     58{
     59  // Data comes from
     60  // Dostrovsky, Fraenkel and Friedlander
     61  // Physical Review, vol 116, num. 3 1959
     62  //
     63  // const G4int size = 5;
     64  // G4double Zlist[5] = { 10.0, 20.0, 30.0, 50.0, 70.0};
     65  // G4double Cp[5] = { 0.50, 0.28, 0.20, 0.15, 0.10};
     66  // C for triton is equal to C for protons divided by 3
     67  G4double C = 0.0;
    8568       
    86     if (aZ >= 70) {
    87         C = 0.10;
    88     } else {
    89         C = ((((0.15417e-06*aZ) - 0.29875e-04)*aZ + 0.21071e-02)*aZ - 0.66612e-01)*aZ + 0.98375;
    90     }
     69  if (aZ >= 70) {
     70    C = 0.10;
     71  } else {
     72    C = ((((0.15417e-06*aZ) - 0.29875e-04)*aZ + 0.21071e-02)*aZ - 0.66612e-01)*aZ + 0.98375;
     73  }
    9174       
    92     return C/3.0;
    93        
     75  return C/3.0;
    9476}
    9577
     
    10082//OPT=3,4 Kalbach's parameterization
    10183//
    102 G4double G4TritonEvaporationProbability::CrossSection(const  G4Fragment & fragment, const  G4double K)
     84G4double
     85G4TritonEvaporationProbability::CrossSection(const  G4Fragment & fragment, G4double K)
    10386{
    10487  theA=GetA();
    10588  theZ=GetZ();
    106   ResidualA=fragment.GetA()-theA;
    107   ResidualZ=fragment.GetZ()-theZ;
     89  ResidualA=fragment.GetA_asInt()-theA;
     90  ResidualZ=fragment.GetZ_asInt()-theZ;
    10891 
    109   ResidualAthrd=std::pow(ResidualA,0.33333);
    110   FragmentA=fragment.GetA();
    111   FragmentAthrd=std::pow(FragmentA,0.33333);
    112 
    113  
     92  ResidualAthrd=fG4pow->Z13(ResidualA);
     93  FragmentA=fragment.GetA_asInt();
     94  FragmentAthrd=fG4pow->Z13(FragmentA);
     95
    11496  if (OPTxs==0) {std::ostringstream errOs;
    11597    errOs << "We should'n be here (OPT =0) at evaporation cross section calculation (tritons)!!" 
     
    128110
    129111//
    130 //********************* OPT=1,2 : Chatterjee's cross section ************************
     112//********************* OPT=1,2 : Chatterjee's cross section *****************
    131113//(fitting to cross section from Bechetti & Greenles OM potential)
    132114
    133 G4double G4TritonEvaporationProbability::GetOpt12(const  G4double K)
    134 {
    135 
     115G4double G4TritonEvaporationProbability::GetOpt12(G4double K)
     116{
    136117  G4double Kc=K;
    137118
    138 // JMQ xsec is set constat above limit of validity
    139   if (K>50) Kc=50;
    140 
    141  G4double landa ,mu ,nu ,p , Ec,q,r,ji,xs;
    142 //G4double Eo(0),epsilon1(0),epsilon2(0),discri(0);
    143 
     119  // JMQ xsec is set constat above limit of validity
     120  if (K > 50*MeV) { Kc=50*MeV; }
     121
     122  G4double landa ,mu ,nu ,p , Ec,q,r,ji,xs;
    144123 
    145  G4double    p0 = -11.04;
    146  G4double    p1 = 619.1;
    147  G4double    p2 = -2147.;
    148  G4double    landa0 = -0.0426;
    149  G4double    landa1 = -10.33;
    150  G4double    mu0 = 601.9;
    151  G4double    mu1 = 0.37;
    152  G4double    nu0 = 583.0;
    153  G4double    nu1 = -546.2;
    154  G4double    nu2 = 1.718; 
    155  G4double    delta=1.2;           
    156 
    157  Ec = 1.44*theZ*ResidualZ/(1.5*ResidualAthrd+delta);
    158  p = p0 + p1/Ec + p2/(Ec*Ec);
    159  landa = landa0*ResidualA + landa1;
    160  mu = mu0*std::pow(ResidualA,mu1);
    161  nu = std::pow(ResidualA,mu1)*(nu0 + nu1*Ec + nu2*(Ec*Ec));
    162  q = landa - nu/(Ec*Ec) - 2*p*Ec;
    163  r = mu + 2*nu/Ec + p*(Ec*Ec);
    164 
    165  ji=std::max(Kc,Ec);
    166  if(Kc < Ec) { xs = p*Kc*Kc + q*Kc + r;}
    167  else {xs = p*(Kc - ji)*(Kc - ji) + landa*Kc + mu + nu*(2 - Kc/ji)/ji ;}
    168  
    169  if (xs <0.0) {xs=0.0;}
    170  
    171  return xs;
    172 
     124  G4double    p0 = -11.04;
     125  G4double    p1 = 619.1;
     126  G4double    p2 = -2147.;
     127  G4double    landa0 = -0.0426;
     128  G4double    landa1 = -10.33;
     129  G4double    mu0 = 601.9;
     130  G4double    mu1 = 0.37;
     131  G4double    nu0 = 583.0;
     132  G4double    nu1 = -546.2;
     133  G4double    nu2 = 1.718; 
     134  G4double    delta=1.2;           
     135
     136  Ec = 1.44*theZ*ResidualZ/(1.5*ResidualAthrd+delta);
     137  p = p0 + p1/Ec + p2/(Ec*Ec);
     138  landa = landa0*ResidualA + landa1;
     139
     140  G4double resmu1 = fG4pow->powZ(ResidualA,mu1);
     141  mu = mu0*resmu1;
     142  nu = resmu1*(nu0 + nu1*Ec + nu2*(Ec*Ec));
     143  q = landa - nu/(Ec*Ec) - 2*p*Ec;
     144  r = mu + 2*nu/Ec + p*(Ec*Ec);
     145 
     146  ji=std::max(Kc,Ec);
     147  if(Kc < Ec) { xs = p*Kc*Kc + q*Kc + r;}
     148  else {xs = p*(Kc - ji)*(Kc - ji) + landa*Kc + mu + nu*(2 - Kc/ji)/ji ;}
     149                 
     150  if (xs <0.0) {xs=0.0;}
     151             
     152  return xs;
    173153}
    174154
    175155// *********** OPT=3,4 : Kalbach's cross sections (from PRECO code)*************
    176 G4double G4TritonEvaporationProbability::GetOpt34(const  G4double K)
     156G4double G4TritonEvaporationProbability::GetOpt34(G4double K)
    177157//     ** t from o.m. of hafele, flynn et al
    178158{
    179  
    180159  G4double landa, mu, nu, p , signor(1.),sig;
    181160  G4double ec,ecsq,xnulam,etest(0.),a;
    182161  G4double b,ecut,cut,ecut2,geom,elab;
    183  
    184  
     162
    185163  G4double     flow = 1.e-18;
    186164  G4double     spill= 1.e+18;
     
    205183  p = p0 + p1/ec + p2/ecsq;
    206184  landa = landa0*ResidualA + landa1;
    207   a = std::pow(ResidualA,mu1);
     185  a = fG4pow->powZ(ResidualA,mu1);
    208186  mu = mu0 * a;
    209187  nu = a* (nu0+nu1*ec+nu2*ecsq); 
    210188  xnulam = nu / landa;
    211   if (xnulam > spill) xnulam=0.;
    212   if (xnulam >= flow) etest = 1.2 *std::sqrt(xnulam);
    213   
     189  if (xnulam > spill) { xnulam=0.; }
     190  if (xnulam >= flow) { etest = 1.2 *std::sqrt(xnulam); }
     191 
    214192  a = -2.*p*ec + landa - nu/ecsq;
    215193  b = p*ecsq + mu + 2.*nu/ec;
    216194  ecut = 0.;
    217195  cut = a*a - 4.*p*b;
    218   if (cut > 0.) ecut = std::sqrt(cut);
     196  if (cut > 0.) { ecut = std::sqrt(cut); }
    219197  ecut = (ecut-a) / (p+p);
    220198  ecut2 = ecut;
    221 //JMQ 290310 for avoiding unphysical increase below minimum (at ecut)
    222 //ecut<0 means that there is no cut with energy axis, i.e. xs is set to 0 bellow minimum
    223 //  if (cut < 0.) ecut2 = ecut - 2.;
    224   if (cut < 0.) ecut2 = ecut;
    225   elab = K * FragmentA / ResidualA;
     199  //JMQ 290310 for avoiding unphysical increase below minimum (at ecut)
     200  // ecut<0 means that there is no cut with energy axis, i.e. xs is set
     201  // to 0 bellow minimum
     202  //  if (cut < 0.) ecut2 = ecut - 2.;
     203  if (cut < 0.) { ecut2 = ecut; }
     204  elab = K * FragmentA / G4double(ResidualA);
    226205  sig = 0.;
    227 
     206 
    228207  if (elab <= ec) { //start for E<Ec
    229     if (elab > ecut2)  sig = (p*elab*elab+a*elab+b) * signor;
     208    if (elab > ecut2) { sig = (p*elab*elab+a*elab+b) * signor; }
    230209  }           //end for E<Ec
    231   else {           //start for E>Ec 
     210  else {           //start for E>Ec
    232211    sig = (landa*elab+mu+nu/elab) * signor;
    233212    geom = 0.;
    234     if (xnulam < flow || elab < etest) return sig;
     213    if (xnulam < flow || elab < etest) { return sig; }
    235214    geom = std::sqrt(theA*K);
    236215    geom = 1.23*ResidualAthrd + ra + 4.573/geom;
     
    239218  }           //end for E>Ec
    240219  return sig;
    241  
    242 }
    243 
    244 //   ************************** end of cross sections *******************************
    245 
     220}
     221
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/src/G4UnstableFragmentBreakUp.cc

    r1340 r1347  
    2525//
    2626// $Id: G4UnstableFragmentBreakUp.cc,v 1.8 2010/06/25 09:46:09 gunter Exp $
    27 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2828//
    2929// -------------------------------------------------------------------
  • trunk/source/processes/hadronic/models/de_excitation/evaporation/src/G4VEvaporation.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VEvaporation.cc,v 1.7 2010/04/27 14:00:40 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     26// $Id: G4VEvaporation.cc,v 1.8 2010/10/29 17:35:03 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2828//
    2929// Hadronic Process: Nuclear De-excitations
     
    3333#include "G4VEvaporation.hh"
    3434
    35 G4VEvaporation::G4VEvaporation() 
     35G4VEvaporation::G4VEvaporation():OPTxs(3),useSICB(false)
    3636{}
    3737
  • trunk/source/processes/hadronic/models/de_excitation/fermi_breakup/include/G4VFermiFragment.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4VFermiFragment.hh,v 1.3 2006/06/29 20:12:37 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4VFermiFragment.hh,v 1.4 2010/10/29 17:35:03 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    3535
    3636#include "G4FragmentVector.hh"
    37 #include "G4NucleiProperties.hh"
    38 #include "G4ParticleTable.hh"
    39 #include "G4IonTable.hh"
     37#include "globals.hh"
    4038
    4139class G4VFermiFragment
    4240{
    4341public:
    44   G4VFermiFragment(const G4int anA, const G4int aZ, const G4int Pol, const G4double ExE):
    45     A(anA),
    46     Z(aZ),
    47     Polarization(Pol),
    48     ExcitEnergy(ExE)
    49     {}
     42  G4VFermiFragment(G4int anA, G4int aZ, G4int Pol, G4double ExE);
    5043
    51   virtual ~G4VFermiFragment() {};
     44  virtual ~G4VFermiFragment();
    5245 
    5346protected:
    54   G4VFermiFragment() {};
     47  G4VFermiFragment();
    5548
    5649private:
     
    6659  virtual G4FragmentVector * GetFragment(const G4LorentzVector & aMomentum) const = 0;
    6760
    68   G4int GetA(void) const
     61  inline G4int GetA(void) const
    6962  {
    7063    return A;
    7164  }
    7265 
    73   G4int GetZ(void) const
     66  inline G4int GetZ(void) const
    7467  {
    7568    return Z;
    7669  }
    7770 
    78   G4int GetPolarization(void) const
     71  inline G4int GetPolarization(void) const
    7972  {
    8073    return Polarization;
    8174  }
    8275
    83   G4double GetExcitationEnergy(void) const
     76  inline G4double GetExcitationEnergy(void) const
    8477  {
    8578    return ExcitEnergy;
    8679  }
    8780
    88   G4double GetFragmentMass(void) const
     81  inline G4double GetFragmentMass(void) const
    8982  {
    90     return G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(Z,A);
     83    return fragmentMass;
    9184  }
    9285
    93   G4double GetTotalEnergy(void) const
     86  inline G4double GetTotalEnergy(void) const
    9487  {
    95     return this->GetFragmentMass() + this->GetExcitationEnergy();
     88    return (GetFragmentMass() + GetExcitationEnergy());
    9689  }
    9790
     
    10699  G4double ExcitEnergy;
    107100
     101  G4double fragmentMass;
    108102
    109103};
  • trunk/source/processes/hadronic/models/de_excitation/fermi_breakup/src/G4VFermiFragment.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4VFermiFragment.cc,v 1.5 2006/06/29 20:13:15 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     26// $Id: G4VFermiFragment.cc,v 1.6 2010/10/29 17:35:03 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2928//
    3029// Hadronic Process: Nuclear De-excitations
     
    3231
    3332#include "G4VFermiFragment.hh"
    34 #include "G4HadronicException.hh"
     33#include "G4NucleiProperties.hh"
    3534
    36 G4VFermiFragment::G4VFermiFragment(const G4VFermiFragment &)
     35G4VFermiFragment::G4VFermiFragment(G4int anA, G4int aZ, G4int Pol, G4double ExE):
     36    A(anA),
     37    Z(aZ),
     38    Polarization(Pol),
     39    ExcitEnergy(ExE)
    3740{
    38     throw G4HadronicException(__FILE__, __LINE__, "G4VFermiFragment::copy_constructor meant to not be accessable");
     41  fragmentMass = 0.0;
     42  if(A > 0) { fragmentMass = G4NucleiProperties::GetNuclearMass(A, Z); }
    3943}
    4044
    41 
    42 const G4VFermiFragment & G4VFermiFragment::operator=(const G4VFermiFragment &)
     45G4VFermiFragment::G4VFermiFragment():
     46    A(0),
     47    Z(0),
     48    Polarization(0),
     49    ExcitEnergy(0.0)
    4350{
    44     throw G4HadronicException(__FILE__, __LINE__, "G4VFermiFragment::operator= meant to not be accessable");
    45     return *this;
     51  fragmentMass = 0.0;
    4652}
    4753
    48 
    49 G4bool G4VFermiFragment::operator==(const G4VFermiFragment &) const
    50 {
    51     return false;
    52 }
    53 
    54 G4bool G4VFermiFragment::operator!=(const G4VFermiFragment &) const
    55 {
    56     return true;
    57 }
     54G4VFermiFragment::~G4VFermiFragment()
     55{}
    5856
    5957
    6058
     59
  • trunk/source/processes/hadronic/models/de_excitation/fission/include/G4CompetitiveFission.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4CompetitiveFission.hh,v 1.3 2006/06/29 20:13:19 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4CompetitiveFission.hh,v 1.5 2010/11/17 20:22:46 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    5858private:
    5959  G4CompetitiveFission(const G4CompetitiveFission &right);
    60 
    6160  const G4CompetitiveFission & operator=(const G4CompetitiveFission &right);
    62 public:
    6361  G4bool operator==(const G4CompetitiveFission &right) const;
    6462  G4bool operator!=(const G4CompetitiveFission &right) const;
     
    121119  G4double LevelDensityParameter;
    122120
    123 
    124 
    125 
    126121  //  --------------------
    127122
    128 
    129123  // Sample AtomicNumber of Fission products
    130   G4int FissionAtomicNumber(const G4int A, const G4FissionParameters & theParam);
    131   G4double MassDistribution(const G4double x, const G4double A, const G4FissionParameters & theParam);
     124  G4int FissionAtomicNumber(G4int A, const G4FissionParameters & theParam);
     125  G4double MassDistribution(G4double x, G4double A, const G4FissionParameters & theParam);
    132126
    133127
    134128  // Sample Charge of fission products
    135   G4int FissionCharge(const G4double A, const G4double Z, const G4double Af);
     129  G4int FissionCharge(G4double A, G4double Z, G4double Af);
    136130
    137131
    138132  // Sample Kinetic energy of fission products
    139   G4double FissionKineticEnergy(const G4double A, const G4double Z,
    140                                 const G4double Af1, const G4double Zf1,
    141                                 const G4double Af2, const G4double Zf2,
    142                                 const G4double U, const G4double Tmax,
     133  G4double FissionKineticEnergy(G4int A, G4int Z,
     134                                G4double Af1, G4double Zf1,
     135                                G4double Af2, G4double Zf2,
     136                                G4double U, G4double Tmax,
    143137                                const G4FissionParameters & theParam);
    144138   
     139  G4double Ratio(G4double A, G4double A11, G4double B1, G4double A00);
     140  G4double SymmetricRatio(G4int A, G4double A11);
     141  G4double AsymmetricRatio(G4int A, G4double A11);
    145142
    146 
    147   G4double Ratio(const G4double A,const G4double A11,const G4double B1,const G4double A00);
    148   G4double SymmetricRatio(const G4double A,const G4double A11);
    149   G4double AsymmetricRatio(const G4double A,const G4double A11);
    150 
    151 
    152 
    153   G4ThreeVector IsotropicVector(const G4double Magnitude = 1.0);
    154 
     143  G4ThreeVector IsotropicVector(G4double Magnitude = 1.0);
    155144
    156145#ifdef debug
     
    159148#endif
    160149
    161 
    162150};
    163 
    164 
    165151
    166152#endif
  • trunk/source/processes/hadronic/models/de_excitation/fission/include/G4FissionBarrier.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4FissionBarrier.hh,v 1.5 2009/12/16 16:50:07 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4FissionBarrier.hh,v 1.6 2010/11/17 20:22:46 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    4141{
    4242public:
    43   G4FissionBarrier() {};
    44   ~G4FissionBarrier() {};
     43  G4FissionBarrier();
     44  ~G4FissionBarrier();
    4545
    4646private:
     
    5252 
    5353public:
    54   G4double FissionBarrier(const G4int A, const G4int Z, const G4double U);
     54  G4double FissionBarrier(G4int A, G4int Z, G4double U);
    5555
    5656
    5757private:
    5858
    59   G4double BarashenkovFissionBarrier(const G4int A, const G4int Z);
     59  G4double BarashenkovFissionBarrier(G4int A, G4int Z);
    6060 
    61   G4double SellPlusPairingCorrection(const G4int Z, const G4int N)
     61  inline G4double SellPlusPairingCorrection(G4int Z, G4int N)
    6262  {
    6363    G4CameronShellPlusPairingCorrections* SPtr = G4CameronShellPlusPairingCorrections::GetInstance();
  • trunk/source/processes/hadronic/models/de_excitation/fission/include/G4FissionLevelDensityParameter.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4FissionLevelDensityParameter.hh,v 1.3 2006/06/29 20:13:23 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4FissionLevelDensityParameter.hh,v 1.4 2010/11/17 20:22:46 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    4545{
    4646public:
    47   G4FissionLevelDensityParameter() {};
    48   virtual ~G4FissionLevelDensityParameter() {};
     47  G4FissionLevelDensityParameter();
     48  virtual ~G4FissionLevelDensityParameter();
    4949
    5050private: 
     
    5656 
    5757public:
    58   G4double LevelDensityParameter(const G4int A,const G4int Z,const G4double U) const;
     58  G4double LevelDensityParameter(G4int A, G4int Z, G4double U) const;
    5959
    6060 
  • trunk/source/processes/hadronic/models/de_excitation/fission/include/G4FissionParameters.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4FissionParameters.hh,v 1.3 2006/06/29 20:13:25 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4FissionParameters.hh,v 1.4 2010/11/17 20:22:46 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    4444public:
    4545  // Only available constructor
    46   G4FissionParameters(const G4int A, const G4int Z, const G4double ExEnergy, const G4double FissionBarrier);
     46  G4FissionParameters(G4int A, G4int Z, G4double ExEnergy, G4double FissionBarrier);
    4747
    48   ~G4FissionParameters() {}
     48  ~G4FissionParameters()
    4949
    5050private: 
    5151  // Default constructor
    52   G4FissionParameters() {};
     52  G4FissionParameters();
    5353
    5454  // Copy constructor
  • trunk/source/processes/hadronic/models/de_excitation/fission/include/G4FissionProbability.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4FissionProbability.hh,v 1.3 2006/06/29 20:13:27 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4FissionProbability.hh,v 1.4 2010/11/17 20:22:46 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    4646public:
    4747  // Default constructor
    48   G4FissionProbability() {};
     48  G4FissionProbability();
    4949
    50   ~G4FissionProbability() {}
     50  ~G4FissionProbability()
    5151
    5252private: 
     
    5959 
    6060public:
    61         G4double EmissionProbability(const G4Fragment & fragment, const G4double MaximalKineticEnergy);
     61  G4double EmissionProbability(const G4Fragment & fragment, G4double MaximalKineticEnergy);
    6262
    6363private:
    64         G4EvaporationLevelDensityParameter theEvapLDP;
    65         G4FissionLevelDensityParameter theFissLDP;
     64  G4EvaporationLevelDensityParameter theEvapLDP;
     65  G4FissionLevelDensityParameter theFissLDP;
    6666
    6767
  • trunk/source/processes/hadronic/models/de_excitation/fission/include/G4ParaFissionModel.hh

    r819 r1347  
    2525//
    2626#ifndef G4ParaFissionModel_h
    27 #define G4ParaFissionModel_h
     27#define G4ParaFissionModel_h 1
    2828
    2929#include "G4CompetitiveFission.hh"
     
    4949    SetMaxEnergy( 60.*MeV );
    5050  }
     51
     52  ~G4ParaFissionModel() {};
    5153 
    5254  virtual G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,
    53                                               G4Nucleus& theNucleus)
     55                                        G4Nucleus& theNucleus)
    5456  {
    5557    theParticleChange.Clear();
     
    5961    // prepare the fragment
    6062
    61     G4Fragment anInitialState;
    62     G4double anA = theNucleus.GetN();
    63     G4double aZ = theNucleus.GetZ();
    64     G4double nucMass = G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(G4int(aZ) ,G4int(anA));
    65      
    66     anA += aTrack.GetDefinition()->GetBaryonNumber();
    67     aZ += aTrack.GetDefinition()->GetPDGCharge();
     63    G4int A = theNucleus.GetA_asInt();
     64    G4int Z = theNucleus.GetZ_asInt();
     65    G4double nucMass =
     66      G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(Z,A);
    6867     
    6968    G4int numberOfEx = aTrack.GetDefinition()->GetBaryonNumber();
    70     G4int numberOfCh = G4int(std::abs(aTrack.GetDefinition()->GetPDGCharge()));
     69    G4int numberOfCh = G4int(aTrack.GetDefinition()->GetPDGCharge() + 0.5);
    7170    G4int numberOfHoles = 0;
     71
     72    A += numberOfEx;
     73    Z += numberOfCh;
    7274     
    73     G4ThreeVector exciton3Momentum = aTrack.Get4Momentum().vect();
    74     G4double compoundMass = aTrack.GetTotalEnergy();
    75     compoundMass += nucMass;
    76     compoundMass = std::sqrt(compoundMass*compoundMass - exciton3Momentum*exciton3Momentum);
    77     G4LorentzVector fragment4Momentum(exciton3Momentum,
    78                                std::sqrt(exciton3Momentum.mag2()+compoundMass*compoundMass));
    79    
    80     anInitialState.SetA(anA);
    81     anInitialState.SetZ(aZ);
    82     anInitialState.SetNumberOfParticles(numberOfEx-numberOfHoles);
    83     anInitialState.SetNumberOfCharged(numberOfCh);
    84     anInitialState.SetNumberOfHoles(numberOfHoles);
    85     anInitialState.SetMomentum(fragment4Momentum);
     75    G4LorentzVector v = aTrack.Get4Momentum() + G4LorentzVector(0.0,0.0,0.0,nucMass);
     76    G4Fragment anInitialState(Z,A,v);
     77    anInitialState.SetNumberOfExcitedParticle(numberOfEx,numberOfCh);
     78    anInitialState.SetNumberOfHoles(0,0);
    8679
    8780    // do the fission
     
    10396        {
    10497          G4ReactionProduct* rp0 = (*theExcitationResult)[j];
    105           G4DynamicParticle* p0 = new G4DynamicParticle;
    106           p0->SetDefinition(rp0->GetDefinition() );
    107           p0->SetMomentum(rp0->GetMomentum() );
     98          G4DynamicParticle* p0 =
     99            new G4DynamicParticle(rp0->GetDefinition(),rp0->GetMomentum());
    108100          theParticleChange.AddSecondary(p0);
    109101          delete rp0;
     
    114106      {
    115107        // add secondary
    116         G4DynamicParticle* p0 = new G4DynamicParticle;
    117         p0->SetDefinition(aFragment->GetParticleDefinition());
    118         p0->SetMomentum(aFragment->GetMomentum().vect());
     108        G4DynamicParticle* p0 =
     109          new G4DynamicParticle(aFragment->GetParticleDefinition(),
     110                                aFragment->GetMomentum());
    119111        theParticleChange.AddSecondary(p0);
    120112      }
  • trunk/source/processes/hadronic/models/de_excitation/fission/include/G4VFissionBarrier.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4VFissionBarrier.hh,v 1.4 2006/06/29 20:13:31 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4VFissionBarrier.hh,v 1.5 2010/11/17 20:22:46 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    4141{
    4242public:
    43   G4VFissionBarrier() {};
    44   virtual ~G4VFissionBarrier() {};
     43  G4VFissionBarrier();
     44  virtual ~G4VFissionBarrier();
    4545
    4646private:
     
    5252 
    5353public:
    54   virtual G4double FissionBarrier(const G4int A, const G4int Z,const G4double U) = 0;
     54  virtual G4double FissionBarrier(G4int A, G4int Z,const G4double U) = 0;
    5555 
    5656
  • trunk/source/processes/hadronic/models/de_excitation/fission/src/G4CompetitiveFission.cc

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4CompetitiveFission.cc,v 1.12 2010/05/03 16:49:19 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4CompetitiveFission.cc,v 1.14 2010/11/17 20:22:46 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    3939#include "G4PairingCorrection.hh"
    4040#include "G4ParticleMomentum.hh"
     41#include "G4Pow.hh"
    4142
    4243G4CompetitiveFission::G4CompetitiveFission() : G4VEvaporationChannel("fission")
     
    5758}
    5859
    59 G4CompetitiveFission::G4CompetitiveFission(const G4CompetitiveFission &) : G4VEvaporationChannel()
    60 {
    61 }
    62 
    6360G4CompetitiveFission::~G4CompetitiveFission()
    6461{
     
    7067}
    7168
    72 const G4CompetitiveFission & G4CompetitiveFission::operator=(const G4CompetitiveFission &)
    73 {
    74     throw G4HadronicException(__FILE__, __LINE__, "G4CompetitiveFission::operator= meant to not be accessable");
    75     return *this;
    76 }
    77 
    78 G4bool G4CompetitiveFission::operator==(const G4CompetitiveFission &right) const
    79 {
    80     return (this == (G4CompetitiveFission *) &right);
    81 }
    82 
    83 G4bool G4CompetitiveFission::operator!=(const G4CompetitiveFission &right) const
    84 {
    85     return (this != (G4CompetitiveFission *) &right);
    86 }
    87 
    88 
    89 
    90 
    9169void G4CompetitiveFission::Initialize(const G4Fragment & fragment)
    9270{
    93     G4int anA = static_cast<G4int>(fragment.GetA());
    94     G4int aZ = static_cast<G4int>(fragment.GetZ());
    95     G4double ExEnergy = fragment.GetExcitationEnergy() -
    96            G4PairingCorrection::GetInstance()->GetFissionPairingCorrection(anA,aZ);
    97  
    98 
    99     // Saddle point excitation energy ---> A = 65
    100     // Fission is excluded for A < 65
    101     if (anA >= 65 && ExEnergy > 0.0) {
    102         FissionBarrier = theFissionBarrierPtr->FissionBarrier(anA,aZ,ExEnergy);
    103         MaximalKineticEnergy = ExEnergy - FissionBarrier;
    104         LevelDensityParameter = theLevelDensityPtr->LevelDensityParameter(anA,aZ,ExEnergy);
    105         FissionProbability = theFissionProbabilityPtr->EmissionProbability(fragment,MaximalKineticEnergy);
    106     }
    107     else {
    108         MaximalKineticEnergy = -1000.0*MeV;
    109         LevelDensityParameter = 0.0;
    110         FissionProbability = 0.0;
    111     }
    112 
    113     return;
    114 }
    115 
    116 
     71  G4int anA = fragment.GetA_asInt();
     72  G4int aZ  = fragment.GetZ_asInt();
     73  G4double ExEnergy = fragment.GetExcitationEnergy() -
     74    G4PairingCorrection::GetInstance()->GetFissionPairingCorrection(anA,aZ);
     75 
     76
     77  // Saddle point excitation energy ---> A = 65
     78  // Fission is excluded for A < 65
     79  if (anA >= 65 && ExEnergy > 0.0) {
     80    FissionBarrier = theFissionBarrierPtr->FissionBarrier(anA,aZ,ExEnergy);
     81    MaximalKineticEnergy = ExEnergy - FissionBarrier;
     82    LevelDensityParameter =
     83      theLevelDensityPtr->LevelDensityParameter(anA,aZ,ExEnergy);
     84    FissionProbability =
     85      theFissionProbabilityPtr->EmissionProbability(fragment,MaximalKineticEnergy);
     86    }
     87  else {
     88    MaximalKineticEnergy = -1000.0*MeV;
     89    LevelDensityParameter = 0.0;
     90    FissionProbability = 0.0;
     91  }
     92}
    11793
    11894G4FragmentVector * G4CompetitiveFission::BreakUp(const G4Fragment & theNucleus)
    11995{
    120     // Nucleus data
    121     // Atomic number of nucleus
    122     G4int A = static_cast<G4int>(theNucleus.GetA());
    123     // Charge of nucleus
    124     G4int Z = static_cast<G4int>(theNucleus.GetZ());
    125     //   Excitation energy (in MeV)
    126     G4double U = theNucleus.GetExcitationEnergy() -
    127         G4PairingCorrection::GetInstance()->GetFissionPairingCorrection(A,Z);
    128     // Check that U > 0
    129     if (U <= 0.0) {
    130         G4FragmentVector * theResult = new  G4FragmentVector;
    131         theResult->push_back(new G4Fragment(theNucleus));
    132         return theResult;
    133     }
    134 
    135 
    136     // Atomic Mass of Nucleus (in MeV)
    137     G4double M = G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(Z,A);
    138 
    139     // Nucleus Momentum
    140     G4LorentzVector theNucleusMomentum = theNucleus.GetMomentum();
    141 
    142     // Calculate fission parameters
    143     G4FissionParameters theParameters(A,Z,U,FissionBarrier);
    144  
    145     // First fragment
    146     G4int A1 = 0;
    147     G4int Z1 = 0;
    148     G4double M1 = 0.0;
    149 
    150     // Second fragment
    151     G4int A2 = 0;
    152     G4int Z2 = 0;
    153     G4double M2 = 0.0;
    154 
    155     G4double FragmentsExcitationEnergy = 0.0;
    156     G4double FragmentsKineticEnergy = 0.0;
    157 
    158     //JMQ 04/03/09 It will be used latter to fix the bug in energy conservation
    159     G4double FissionPairingEnergy=G4PairingCorrection::GetInstance()->GetFissionPairingCorrection(A,Z);
    160 
    161     G4int Trials = 0;
    162     do {
    163 
    164         // First fragment
    165         A1 = FissionAtomicNumber(A,theParameters);
    166         Z1 = FissionCharge(A,Z,A1);
    167         M1 = G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(Z1,A1);
    168 
    169 
    170         // Second Fragment
    171         A2 = A - A1;
    172         Z2 = Z - Z1;
    173         if (A2 < 1 || Z2 < 0)
    174             throw G4HadronicException(__FILE__, __LINE__, "G4CompetitiveFission::BreakUp: Can't define second fragment! ");
    175 
    176         M2 = G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(Z2,A2);
    177 
    178         // Check that fragment masses are less or equal than total energy
    179         if (M1 + M2 > theNucleusMomentum.e())
    180             throw G4HadronicException(__FILE__, __LINE__, "G4CompetitiveFission::BreakUp: Fragments Mass > Total Energy");
    181 
    182         // Maximal Kinetic Energy (available energy for fragments)
    183         G4double Tmax = M + U - M1 - M2;
    184 
    185         FragmentsKineticEnergy = FissionKineticEnergy( A , Z,
    186                                                        A1, Z1,
    187                                                        A2, Z2,
    188                                                        U , Tmax,
    189                                                        theParameters);
     96  // Nucleus data
     97  // Atomic number of nucleus
     98  G4int A = theNucleus.GetA_asInt();
     99  // Charge of nucleus
     100  G4int Z = theNucleus.GetZ_asInt();
     101  //   Excitation energy (in MeV)
     102  G4double U = theNucleus.GetExcitationEnergy() -
     103    G4PairingCorrection::GetInstance()->GetFissionPairingCorrection(A,Z);
     104  // Check that U > 0
     105  if (U <= 0.0) {
     106    G4FragmentVector * theResult = new  G4FragmentVector;
     107    theResult->push_back(new G4Fragment(theNucleus));
     108    return theResult;
     109  }
     110
     111  // Atomic Mass of Nucleus (in MeV)
     112  G4double M = theNucleus.GetGroundStateMass();
     113
     114  // Nucleus Momentum
     115  G4LorentzVector theNucleusMomentum = theNucleus.GetMomentum();
     116
     117  // Calculate fission parameters
     118  G4FissionParameters theParameters(A,Z,U,FissionBarrier);
     119 
     120  // First fragment
     121  G4int A1 = 0;
     122  G4int Z1 = 0;
     123  G4double M1 = 0.0;
     124
     125  // Second fragment
     126  G4int A2 = 0;
     127  G4int Z2 = 0;
     128  G4double M2 = 0.0;
     129
     130  G4double FragmentsExcitationEnergy = 0.0;
     131  G4double FragmentsKineticEnergy = 0.0;
     132
     133  //JMQ 04/03/09 It will be used latter to fix the bug in energy conservation
     134  G4double FissionPairingEnergy=
     135    G4PairingCorrection::GetInstance()->GetFissionPairingCorrection(A,Z);
     136
     137  G4int Trials = 0;
     138  do {
     139
     140    // First fragment
     141    A1 = FissionAtomicNumber(A,theParameters);
     142    Z1 = FissionCharge(A,Z,A1);
     143    M1 = G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(Z1,A1);
     144
     145    // Second Fragment
     146    A2 = A - A1;
     147    Z2 = Z - Z1;
     148    if (A2 < 1 || Z2 < 0) {
     149      throw G4HadronicException(__FILE__, __LINE__,
     150        "G4CompetitiveFission::BreakUp: Can't define second fragment! ");
     151    }
     152    M2 = G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(Z2,A2);
     153
     154    // Check that fragment masses are less or equal than total energy
     155    if (M1 + M2 > theNucleusMomentum.e()) {
     156      throw G4HadronicException(__FILE__, __LINE__,
     157        "G4CompetitiveFission::BreakUp: Fragments Mass > Total Energy");
     158    }
     159    // Maximal Kinetic Energy (available energy for fragments)
     160    G4double Tmax = M + U - M1 - M2;
     161
     162    FragmentsKineticEnergy = FissionKineticEnergy( A , Z,
     163                                                   A1, Z1,
     164                                                   A2, Z2,
     165                                                   U , Tmax,
     166                                                   theParameters);
    190167   
    191         // Excitation Energy
    192         //      FragmentsExcitationEnergy = Tmax - FragmentsKineticEnergy;
    193         // JMQ 04/03/09 BUG FIXED: in order to fulfill energy conservation the
    194         // fragments carry the fission pairing energy in form of
    195         //excitation energy
    196 
    197         FragmentsExcitationEnergy = Tmax - FragmentsKineticEnergy+FissionPairingEnergy;
    198 
    199     } while (FragmentsExcitationEnergy < 0.0 && Trials++ < 100);
     168    // Excitation Energy
     169    //  FragmentsExcitationEnergy = Tmax - FragmentsKineticEnergy;
     170    // JMQ 04/03/09 BUG FIXED: in order to fulfill energy conservation the
     171    // fragments carry the fission pairing energy in form of
     172    //excitation energy
     173
     174    FragmentsExcitationEnergy =
     175      Tmax - FragmentsKineticEnergy+FissionPairingEnergy;
     176
     177  } while (FragmentsExcitationEnergy < 0.0 && Trials++ < 100);
    200178   
    201  
    202 
    203     if (FragmentsExcitationEnergy <= 0.0)
    204         throw G4HadronicException(__FILE__, __LINE__, "G4CompetitiveFission::BreakItUp: Excitation energy for fragments < 0.0!");
    205  
    206 
    207     // while (FragmentsExcitationEnergy < 0 && Trials < 100);
    208  
    209     // Fragment 1
    210     G4double U1 = FragmentsExcitationEnergy * (static_cast<G4double>(A1)/static_cast<G4double>(A));
     179  if (FragmentsExcitationEnergy <= 0.0) {
     180    throw G4HadronicException(__FILE__, __LINE__,
     181      "G4CompetitiveFission::BreakItUp: Excitation energy for fragments < 0.0!");
     182  }
     183
     184  // while (FragmentsExcitationEnergy < 0 && Trials < 100);
     185 
     186  // Fragment 1
     187  G4double U1 = FragmentsExcitationEnergy * A1/static_cast<G4double>(A);
    211188    // Fragment 2
    212     G4double U2 = FragmentsExcitationEnergy * (static_cast<G4double>(A2)/static_cast<G4double>(A));
    213 
    214 
    215     //JMQ  04/03/09 Full relativistic calculation is performed
    216     //
    217     G4double Fragment1KineticEnergy=(FragmentsKineticEnergy*(FragmentsKineticEnergy+2*(M2+U2)))/(2*(M1+U1+M2+U2+FragmentsKineticEnergy));
    218     G4ParticleMomentum Momentum1(IsotropicVector(std::sqrt(Fragment1KineticEnergy*(Fragment1KineticEnergy+2*(M1+U1)))));
    219     G4ParticleMomentum Momentum2(-Momentum1);
    220     G4LorentzVector FourMomentum1(Momentum1,std::sqrt(Momentum1.mag2()+(M1+U1)*(M1+U1)));
    221     G4LorentzVector FourMomentum2(Momentum2,std::sqrt(Momentum2.mag2()+(M2+U2)*(M2+U2)));
    222 
    223     //JMQ 04/03/09 now we do Lorentz boosts (instead of Galileo boosts)
    224     FourMomentum1.boost(theNucleusMomentum.boostVector());
    225     FourMomentum2.boost(theNucleusMomentum.boostVector());
     189  G4double U2 = FragmentsExcitationEnergy * A2/static_cast<G4double>(A);
     190
     191  //JMQ  04/03/09 Full relativistic calculation is performed
     192  //
     193  G4double Fragment1KineticEnergy=
     194    (FragmentsKineticEnergy*(FragmentsKineticEnergy+2*(M2+U2)))
     195    /(2*(M1+U1+M2+U2+FragmentsKineticEnergy));
     196  G4ParticleMomentum Momentum1(IsotropicVector(std::sqrt(Fragment1KineticEnergy*(Fragment1KineticEnergy+2*(M1+U1)))));
     197  G4ParticleMomentum Momentum2(-Momentum1);
     198  G4LorentzVector FourMomentum1(Momentum1,std::sqrt(Momentum1.mag2()+(M1+U1)*(M1+U1)));
     199  G4LorentzVector FourMomentum2(Momentum2,std::sqrt(Momentum2.mag2()+(M2+U2)*(M2+U2)));
     200
     201  //JMQ 04/03/09 now we do Lorentz boosts (instead of Galileo boosts)
     202  FourMomentum1.boost(theNucleusMomentum.boostVector());
     203  FourMomentum2.boost(theNucleusMomentum.boostVector());
    226204   
    227     //////////JMQ 04/03: Old version calculation is commented
    228     // There was vioation of energy momentum conservation
    229 
    230     //    G4double Pmax = std::sqrt( 2 * ( ( (M1+U1)*(M2+U2) ) /
    231     //                          ( (M1+U1)+(M2+U2) ) ) * FragmentsKineticEnergy);
    232 
    233     //G4ParticleMomentum momentum1 = IsotropicVector( Pmax );
    234     //  G4ParticleMomentum momentum2( -momentum1 );
    235 
    236     // Perform a Galileo boost for fragments
    237     //    momentum1 += (theNucleusMomentum.boostVector() * (M1+U1));
    238     //    momentum2 += (theNucleusMomentum.boostVector() * (M2+U2));
    239 
    240 
    241     // Create 4-momentum for first fragment
    242     // Warning!! Energy conservation is broken
    243     //JMQ 04/03/09 ...NOT ANY MORE!! BUGS FIXED: Energy and momentum are NOW conserved
    244     //    G4LorentzVector FourMomentum1( momentum1 , std::sqrt(momentum1.mag2() + (M1+U1)*(M1+U1)));
    245 
    246     // Create 4-momentum for second fragment
    247     // Warning!! Energy conservation is broken
    248     //JMQ 04/03/09 ...NOT ANY MORE!! BUGS FIXED: Energy and momentum are NOW conserved
    249     //    G4LorentzVector FourMomentum2( momentum2 , std::sqrt(momentum2.mag2() + (M2+U2)*(M2+U2)));
    250 
    251     //////////
    252 
    253     // Create Fragments
    254     G4Fragment * Fragment1 = new G4Fragment( A1, Z1, FourMomentum1);
    255     if (!Fragment1) throw G4HadronicException(__FILE__, __LINE__, "G4CompetitiveFission::BreakItUp: Can't create Fragment1! ");
    256     G4Fragment * Fragment2 = new G4Fragment( A2, Z2, FourMomentum2);
    257     if (!Fragment2) throw G4HadronicException(__FILE__, __LINE__, "G4CompetitiveFission::BreakItUp: Can't create Fragment2! ");
    258 
    259 #ifdef PRECOMPOUND_TEST
    260     Fragment1->SetCreatorModel(G4String("G4CompetitiveFission"));
    261     Fragment2->SetCreatorModel(G4String("G4CompetitiveFission"));
     205  //////////JMQ 04/03: Old version calculation is commented
     206  // There was vioation of energy momentum conservation
     207
     208  //    G4double Pmax = std::sqrt( 2 * ( ( (M1+U1)*(M2+U2) ) /
     209  //                            ( (M1+U1)+(M2+U2) ) ) * FragmentsKineticEnergy);
     210
     211  //G4ParticleMomentum momentum1 = IsotropicVector( Pmax );
     212  //  G4ParticleMomentum momentum2( -momentum1 );
     213
     214  // Perform a Galileo boost for fragments
     215  //    momentum1 += (theNucleusMomentum.boostVector() * (M1+U1));
     216  //    momentum2 += (theNucleusMomentum.boostVector() * (M2+U2));
     217
     218
     219  // Create 4-momentum for first fragment
     220  // Warning!! Energy conservation is broken
     221  //JMQ 04/03/09 ...NOT ANY MORE!! BUGS FIXED: Energy and momentum are NOW conserved
     222  //    G4LorentzVector FourMomentum1( momentum1 , std::sqrt(momentum1.mag2() + (M1+U1)*(M1+U1)));
     223
     224  // Create 4-momentum for second fragment
     225  // Warning!! Energy conservation is broken
     226  //JMQ 04/03/09 ...NOT ANY MORE!! BUGS FIXED: Energy and momentum are NOW conserved
     227  //    G4LorentzVector FourMomentum2( momentum2 , std::sqrt(momentum2.mag2() + (M2+U2)*(M2+U2)));
     228
     229  //////////
     230
     231  // Create Fragments
     232  G4Fragment * Fragment1 = new G4Fragment( A1, Z1, FourMomentum1);
     233  G4Fragment * Fragment2 = new G4Fragment( A2, Z2, FourMomentum2);
     234
     235  // Create Fragment Vector
     236  G4FragmentVector * theResult = new G4FragmentVector;
     237
     238  theResult->push_back(Fragment1);
     239  theResult->push_back(Fragment2);
     240
     241#ifdef debug
     242  CheckConservation(theNucleus,theResult);
    262243#endif
    263     // Create Fragment Vector
    264     G4FragmentVector * theResult = new G4FragmentVector;
    265 
    266     theResult->push_back(Fragment1);
    267     theResult->push_back(Fragment2);
    268 
    269 #ifdef debug
    270     CheckConservation(theNucleus,theResult);
    271 #endif
    272 
    273     return theResult;
    274 }
    275 
    276 
    277 
    278 G4int G4CompetitiveFission::FissionAtomicNumber(const G4int A, const G4FissionParameters & theParam)
    279     // Calculates the atomic number of a fission product
    280 {
    281 
    282     // For Simplicity reading code
    283     const G4double A1 = theParam.GetA1();
    284     const G4double A2 = theParam.GetA2();
    285     const G4double As = theParam.GetAs();
    286 //    const G4double Sigma1 = theParam.GetSigma1();
    287     const G4double Sigma2 = theParam.GetSigma2();
    288     const G4double SigmaS = theParam.GetSigmaS();
    289     const G4double w = theParam.GetW();
    290 
    291  
    292 //    G4double FasymAsym = 2.0*std::exp(-((A2-As)*(A2-As))/(2.0*Sigma2*Sigma2)) +
    293 //      std::exp(-((A1-As)*(A1-As))/(2.0*Sigma1*Sigma1));
    294 
    295 //    G4double FsymA1A2 = std::exp(-((As-(A1+A2))*(As-(A1+A2)))/(2.0*SigmaS*SigmaS));
    296 
    297 
    298     G4double C2A = A2 + 3.72*Sigma2;
    299     G4double C2S = As + 3.72*SigmaS;
    300  
    301     G4double C2 = 0.0;
    302     if (w > 1000.0 ) C2 = C2S;
    303     else if (w < 0.001) C2 = C2A;
    304     else C2 =  std::max(C2A,C2S);
    305 
    306     G4double C1 = A-C2;
    307     if (C1 < 30.0) {
    308         C2 = A-30.0;
    309         C1 = 30.0;
    310     }
    311 
    312     G4double Am1 = (As + A1)/2.0;
    313     G4double Am2 = (A1 + A2)/2.0;
    314 
    315     // Get Mass distributions as sum of symmetric and asymmetric Gasussians
    316     G4double Mass1 = MassDistribution(As,A,theParam);
    317     G4double Mass2 = MassDistribution(Am1,A,theParam);
    318     G4double Mass3 = MassDistribution(A1,A,theParam);
    319     G4double Mass4 = MassDistribution(Am2,A,theParam);
    320     G4double Mass5 = MassDistribution(A2,A,theParam);
    321     // get maximal value among Mass1,...,Mass5
    322     G4double MassMax = Mass1;
    323     if (Mass2 > MassMax) MassMax = Mass2;
    324     if (Mass3 > MassMax) MassMax = Mass3;
    325     if (Mass4 > MassMax) MassMax = Mass4;
    326     if (Mass5 > MassMax) MassMax = Mass5;
    327 
    328     // Sample a fragment mass number, which lies between C1 and C2
    329     G4double m;
    330     G4double Pm;
    331     do {
    332         m = C1+G4UniformRand()*(C2-C1);
    333         Pm = MassDistribution(m,A,theParam);
    334     } while (G4UniformRand() > Pm/MassMax);
    335 
    336     return static_cast<G4int>(m+0.5);
    337 }
    338 
    339 
    340 
    341 
    342 
    343 
    344 G4double G4CompetitiveFission::MassDistribution(const G4double x, const G4double A,
    345                                                 const G4FissionParameters & theParam)
    346     // This method gives mass distribution F(x) = F_{asym}(x)+w*F_{sym}(x)
    347     // which consist of symmetric and asymmetric sum of gaussians components.
    348 {
    349     G4double Xsym = std::exp(-0.5*(x-theParam.GetAs())*(x-theParam.GetAs())/
    350                         (theParam.GetSigmaS()*theParam.GetSigmaS()));
    351 
    352     G4double Xasym = std::exp(-0.5*(x-theParam.GetA2())*(x-theParam.GetA2())/
    353                          (theParam.GetSigma2()*theParam.GetSigma2())) +
    354         std::exp(-0.5*(x-(A-theParam.GetA2()))*(x-(A-theParam.GetA2()))/
    355             (theParam.GetSigma2()*theParam.GetSigma2())) +
    356         0.5*std::exp(-0.5*(x-theParam.GetA1())*(x-theParam.GetA1())/
    357                 (theParam.GetSigma1()*theParam.GetSigma1())) +
    358         0.5*std::exp(-0.5*(x-(A-theParam.GetA1()))*(x-(A-theParam.GetA1()))/
    359                 (theParam.GetSigma1()*theParam.GetSigma1()));
    360 
    361     if (theParam.GetW() > 1000) return Xsym;
    362     else if (theParam.GetW() < 0.001) return Xasym;
    363     else return theParam.GetW()*Xsym+Xasym;
    364 }
    365 
    366 
    367 
    368 
    369 G4int G4CompetitiveFission::FissionCharge(const G4double A,
    370                                           const G4double Z,
    371                                           const G4double Af)
    372     // Calculates the charge of a fission product for a given atomic number Af
    373 {
    374     const G4double sigma = 0.6;
    375     G4double DeltaZ = 0.0;
    376     if (Af >= 134.0) DeltaZ = -0.45;                    //                      134 <= Af
    377     else if (Af <= (A-134.0)) DeltaZ = 0.45;             // Af <= (A-134)
    378     else DeltaZ = -0.45*(Af-(A/2.0))/(134.0-(A/2.0));   //       (A-134) < Af < 134
    379 
    380     G4double Zmean = (Af/A)*Z + DeltaZ;
     244
     245  return theResult;
     246}
     247
     248G4int
     249G4CompetitiveFission::FissionAtomicNumber(G4int A,
     250                                          const G4FissionParameters & theParam)
     251  // Calculates the atomic number of a fission product
     252{
     253
     254  // For Simplicity reading code
     255  const G4double A1 = theParam.GetA1();
     256  const G4double A2 = theParam.GetA2();
     257  const G4double As = theParam.GetAs();
     258  //    const G4double Sigma1 = theParam.GetSigma1();
     259  const G4double Sigma2 = theParam.GetSigma2();
     260  const G4double SigmaS = theParam.GetSigmaS();
     261  const G4double w = theParam.GetW();
     262 
     263  //    G4double FasymAsym = 2.0*std::exp(-((A2-As)*(A2-As))/(2.0*Sigma2*Sigma2)) +
     264  //    std::exp(-((A1-As)*(A1-As))/(2.0*Sigma1*Sigma1));
     265
     266  //    G4double FsymA1A2 = std::exp(-((As-(A1+A2))*(As-(A1+A2)))/(2.0*SigmaS*SigmaS));
     267
     268  G4double C2A = A2 + 3.72*Sigma2;
     269  G4double C2S = As + 3.72*SigmaS;
     270 
     271  G4double C2 = 0.0;
     272  if (w > 1000.0 ) C2 = C2S;
     273  else if (w < 0.001) C2 = C2A;
     274  else C2 =  std::max(C2A,C2S);
     275
     276  G4double C1 = A-C2;
     277  if (C1 < 30.0) {
     278    C2 = A-30.0;
     279    C1 = 30.0;
     280  }
     281
     282  G4double Am1 = (As + A1)/2.0;
     283  G4double Am2 = (A1 + A2)/2.0;
     284
     285  // Get Mass distributions as sum of symmetric and asymmetric Gasussians
     286  G4double Mass1 = MassDistribution(As,A,theParam);
     287  G4double Mass2 = MassDistribution(Am1,A,theParam);
     288  G4double Mass3 = MassDistribution(A1,A,theParam);
     289  G4double Mass4 = MassDistribution(Am2,A,theParam);
     290  G4double Mass5 = MassDistribution(A2,A,theParam);
     291  // get maximal value among Mass1,...,Mass5
     292  G4double MassMax = Mass1;
     293  if (Mass2 > MassMax) MassMax = Mass2;
     294  if (Mass3 > MassMax) MassMax = Mass3;
     295  if (Mass4 > MassMax) MassMax = Mass4;
     296  if (Mass5 > MassMax) MassMax = Mass5;
     297
     298  // Sample a fragment mass number, which lies between C1 and C2
     299  G4double m;
     300  G4double Pm;
     301  do {
     302    m = C1+G4UniformRand()*(C2-C1);
     303    Pm = MassDistribution(m,A,theParam);
     304  } while (MassMax*G4UniformRand() > Pm);
     305
     306  return static_cast<G4int>(m+0.5);
     307}
     308
     309G4double
     310G4CompetitiveFission::MassDistribution(G4double x, G4double A,
     311                                       const G4FissionParameters & theParam)
     312  // This method gives mass distribution F(x) = F_{asym}(x)+w*F_{sym}(x)
     313  // which consist of symmetric and asymmetric sum of gaussians components.
     314{
     315  G4double Xsym = std::exp(-0.5*(x-theParam.GetAs())*(x-theParam.GetAs())/
     316                           (theParam.GetSigmaS()*theParam.GetSigmaS()));
     317
     318  G4double Xasym = std::exp(-0.5*(x-theParam.GetA2())*(x-theParam.GetA2())/
     319                            (theParam.GetSigma2()*theParam.GetSigma2())) +
     320    std::exp(-0.5*(x-(A-theParam.GetA2()))*(x-(A-theParam.GetA2()))/
     321             (theParam.GetSigma2()*theParam.GetSigma2())) +
     322    0.5*std::exp(-0.5*(x-theParam.GetA1())*(x-theParam.GetA1())/
     323                 (theParam.GetSigma1()*theParam.GetSigma1())) +
     324    0.5*std::exp(-0.5*(x-(A-theParam.GetA1()))*(x-(A-theParam.GetA1()))/
     325                 (theParam.GetSigma1()*theParam.GetSigma1()));
     326
     327  if (theParam.GetW() > 1000) return Xsym;
     328  else if (theParam.GetW() < 0.001) return Xasym;
     329  else return theParam.GetW()*Xsym+Xasym;
     330}
     331
     332G4int G4CompetitiveFission::FissionCharge(G4double A, G4double Z,
     333                                          G4double Af)
     334  // Calculates the charge of a fission product for a given atomic number Af
     335{
     336  const G4double sigma = 0.6;
     337  G4double DeltaZ = 0.0;
     338  if (Af >= 134.0) DeltaZ = -0.45;                    //                      134 <= Af
     339  else if (Af <= (A-134.0)) DeltaZ = 0.45;             // Af <= (A-134)
     340  else DeltaZ = -0.45*(Af-(A/2.0))/(134.0-(A/2.0));   //       (A-134) < Af < 134
     341
     342  G4double Zmean = (Af/A)*Z + DeltaZ;
    381343 
    382     G4double theZ;
    383     do {
    384         theZ = G4RandGauss::shoot(Zmean,sigma);
    385     } while (theZ  < 1.0 || theZ > (Z-1.0) || theZ > Af);
    386     //  return static_cast<G4int>(theZ+0.5);
    387     return static_cast<G4int>(theZ+0.5);
    388 }
    389 
    390 
    391 
    392 
    393 G4double G4CompetitiveFission::FissionKineticEnergy(const G4double A, const G4double Z,
    394                                                     const G4double Af1, const G4double /*Zf1*/,
    395                                                     const G4double Af2, const G4double /*Zf2*/,
    396                                                     const G4double /*U*/, const G4double Tmax,
    397                                                     const G4FissionParameters & theParam)
    398     // Gives the kinetic energy of fission products
    399 {
    400     // Find maximal value of A for fragments
    401     G4double AfMax = std::max(Af1,Af2);
    402     if (AfMax < (A/2.0)) AfMax = A - AfMax;
    403 
    404     // Weights for symmetric and asymmetric components
    405     G4double Pas;
    406     if (theParam.GetW() > 1000) Pas = 0.0;
    407     else {
    408         G4double P1 = 0.5*std::exp(-0.5*(AfMax-theParam.GetA1())*(AfMax-theParam.GetA1())/
    409                               (theParam.GetSigma1()*theParam.GetSigma1()));
    410 
    411         G4double P2 = std::exp(-0.5*(AfMax-theParam.GetA2())*(AfMax-theParam.GetA2())/
    412                           (theParam.GetSigma2()*theParam.GetSigma2()));
    413 
    414         Pas = P1+P2;
    415     }
    416 
    417 
    418     G4double Ps;
    419     if (theParam.GetW() < 0.001) Ps = 0.0;
    420     else
    421         Ps = theParam.GetW()*std::exp(-0.5*(AfMax-theParam.GetAs())*(AfMax-theParam.GetAs())/
    422                                  (theParam.GetSigmaS()*theParam.GetSigmaS()));
    423  
    424 
    425 
    426     G4double Psy = Ps/(Pas+Ps);
    427 
    428 
    429     // Fission fractions Xsy and Xas formed in symmetric and asymmetric modes
    430     G4double PPas = theParam.GetSigma1() + 2.0 * theParam.GetSigma2();
    431     G4double PPsy = theParam.GetW() * theParam.GetSigmaS();
    432     G4double Xas = PPas / (PPas+PPsy);
    433     G4double Xsy = PPsy / (PPas+PPsy);
    434 
    435 
    436     // Average kinetic energy for symmetric and asymmetric components
    437     G4double Eaverage = 0.1071*MeV*(Z*Z)/std::pow(A,1.0/3.0) + 22.2*MeV;
    438 
    439 
    440     // Compute maximal average kinetic energy of fragments and Energy Dispersion (sqrt)
    441     G4double TaverageAfMax;
    442     G4double ESigma;
    443     // Select randomly fission mode (symmetric or asymmetric)
    444     if (G4UniformRand() > Psy) { // Asymmetric Mode
    445         G4double A11 = theParam.GetA1()-0.7979*theParam.GetSigma1();
    446         G4double A12 = theParam.GetA1()+0.7979*theParam.GetSigma1();
    447         G4double A21 = theParam.GetA2()-0.7979*theParam.GetSigma2();
    448         G4double A22 = theParam.GetA2()+0.7979*theParam.GetSigma2();
    449         // scale factor
    450         G4double ScaleFactor = 0.5*theParam.GetSigma1()*(AsymmetricRatio(A,A11)+AsymmetricRatio(A,A12))+
    451             theParam.GetSigma2()*(AsymmetricRatio(A,A21)+AsymmetricRatio(A,A22));
    452         // Compute average kinetic energy for fragment with AfMax
    453         TaverageAfMax = (Eaverage + 12.5 * Xsy) * (PPas/ScaleFactor) * AsymmetricRatio(A,AfMax);
    454         ESigma = 10.0*MeV; // MeV
    455 
    456     } else { // Symmetric Mode
    457         G4double As0 = theParam.GetAs() + 0.7979*theParam.GetSigmaS();
    458         // scale factor
    459         G4double ScaleFactor = theParam.GetW()*theParam.GetSigmaS()*SymmetricRatio(A,As0);
    460         // Compute average kinetic energy for fragment with AfMax
    461         TaverageAfMax = (Eaverage - 12.5*MeV*Xas) * (PPsy/ScaleFactor) * SymmetricRatio(A,AfMax);
    462         ESigma = 8.0*MeV;
    463     }
    464 
    465 
    466     // Select randomly, in accordance with Gaussian distribution, fragment kinetic energy
    467     G4double KineticEnergy;
    468     G4int i = 0;
    469     do {
    470         KineticEnergy = G4RandGauss::shoot(TaverageAfMax,ESigma);
    471         if (i++ > 100) return Eaverage;
    472     } while (KineticEnergy < Eaverage-3.72*ESigma ||
    473              KineticEnergy > Eaverage+3.72*ESigma ||
    474              KineticEnergy > Tmax);
    475 
    476     return KineticEnergy;
    477 }
    478 
    479 
    480 
    481 
    482 
    483 G4double G4CompetitiveFission::AsymmetricRatio(const G4double A,const G4double A11)
    484 {
    485     const G4double B1 = 23.5;
    486     const G4double A00 = 134.0;
    487     return Ratio(A,A11,B1,A00);
    488 }
    489 
    490 G4double G4CompetitiveFission::SymmetricRatio(const G4double A,const G4double A11)
    491 {
    492     const G4double B1 = 5.32;
    493     const G4double A00 = A/2.0;
    494     return Ratio(A,A11,B1,A00);
    495 }
    496 
    497 G4double G4CompetitiveFission::Ratio(const G4double A,const G4double A11,
    498                                      const G4double B1,const G4double A00)
    499 {
    500     if (A == 0) throw G4HadronicException(__FILE__, __LINE__, "G4CompetitiveFission::Ratio: A == 0!");
    501     if (A11 >= A/2.0 && A11 <= (A00+10.0)) return 1.0-B1*((A11-A00)/A)*((A11-A00)/A);
    502     else return 1.0-B1*(10.0/A)*(10.0/A)-2.0*(10.0/A)*B1*((A11-A00-10.0)/A);
    503 }
    504 
    505 
    506 
    507 
     344  G4double theZ;
     345  do {
     346    theZ = G4RandGauss::shoot(Zmean,sigma);
     347  } while (theZ  < 1.0 || theZ > (Z-1.0) || theZ > Af);
     348  //  return static_cast<G4int>(theZ+0.5);
     349  return static_cast<G4int>(theZ+0.5);
     350}
     351
     352G4double
     353G4CompetitiveFission::FissionKineticEnergy(G4int A, G4int Z,
     354                                           G4double Af1, G4double /*Zf1*/,
     355                                           G4double Af2, G4double /*Zf2*/,
     356                                           G4double /*U*/, G4double Tmax,
     357                                           const G4FissionParameters & theParam)
     358  // Gives the kinetic energy of fission products
     359{
     360  // Find maximal value of A for fragments
     361  G4double AfMax = std::max(Af1,Af2);
     362  if (AfMax < (A/2.0)) AfMax = A - AfMax;
     363
     364  // Weights for symmetric and asymmetric components
     365  G4double Pas;
     366  if (theParam.GetW() > 1000) Pas = 0.0;
     367  else {
     368    G4double P1 = 0.5*std::exp(-0.5*(AfMax-theParam.GetA1())*(AfMax-theParam.GetA1())/
     369                               (theParam.GetSigma1()*theParam.GetSigma1()));
     370
     371    G4double P2 = std::exp(-0.5*(AfMax-theParam.GetA2())*(AfMax-theParam.GetA2())/
     372                           (theParam.GetSigma2()*theParam.GetSigma2()));
     373
     374    Pas = P1+P2;
     375  }
     376
     377  G4double Ps;
     378  if (theParam.GetW() < 0.001) Ps = 0.0;
     379  else {
     380    Ps = theParam.GetW()*std::exp(-0.5*(AfMax-theParam.GetAs())*(AfMax-theParam.GetAs())/
     381                                  (theParam.GetSigmaS()*theParam.GetSigmaS()));
     382  }
     383  G4double Psy = Ps/(Pas+Ps);
     384
     385  // Fission fractions Xsy and Xas formed in symmetric and asymmetric modes
     386  G4double PPas = theParam.GetSigma1() + 2.0 * theParam.GetSigma2();
     387  G4double PPsy = theParam.GetW() * theParam.GetSigmaS();
     388  G4double Xas = PPas / (PPas+PPsy);
     389  G4double Xsy = PPsy / (PPas+PPsy);
     390
     391  // Average kinetic energy for symmetric and asymmetric components
     392  G4double Eaverage = 0.1071*MeV*(Z*Z)/G4Pow::GetInstance()->Z13(A) + 22.2*MeV;
     393
     394
     395  // Compute maximal average kinetic energy of fragments and Energy Dispersion (sqrt)
     396  G4double TaverageAfMax;
     397  G4double ESigma;
     398  // Select randomly fission mode (symmetric or asymmetric)
     399  if (G4UniformRand() > Psy) { // Asymmetric Mode
     400    G4double A11 = theParam.GetA1()-0.7979*theParam.GetSigma1();
     401    G4double A12 = theParam.GetA1()+0.7979*theParam.GetSigma1();
     402    G4double A21 = theParam.GetA2()-0.7979*theParam.GetSigma2();
     403    G4double A22 = theParam.GetA2()+0.7979*theParam.GetSigma2();
     404    // scale factor
     405    G4double ScaleFactor = 0.5*theParam.GetSigma1()*(AsymmetricRatio(A,A11)+AsymmetricRatio(A,A12))+
     406      theParam.GetSigma2()*(AsymmetricRatio(A,A21)+AsymmetricRatio(A,A22));
     407    // Compute average kinetic energy for fragment with AfMax
     408    TaverageAfMax = (Eaverage + 12.5 * Xsy) * (PPas/ScaleFactor) * AsymmetricRatio(A,AfMax);
     409    ESigma = 10.0*MeV; // MeV
     410
     411  } else { // Symmetric Mode
     412    G4double As0 = theParam.GetAs() + 0.7979*theParam.GetSigmaS();
     413    // scale factor
     414    G4double ScaleFactor = theParam.GetW()*theParam.GetSigmaS()*SymmetricRatio(A,As0);
     415    // Compute average kinetic energy for fragment with AfMax
     416    TaverageAfMax = (Eaverage - 12.5*MeV*Xas) * (PPsy/ScaleFactor) * SymmetricRatio(A,AfMax);
     417    ESigma = 8.0*MeV;
     418  }
     419
     420
     421  // Select randomly, in accordance with Gaussian distribution, fragment kinetic energy
     422  G4double KineticEnergy;
     423  G4int i = 0;
     424  do {
     425    KineticEnergy = G4RandGauss::shoot(TaverageAfMax,ESigma);
     426    if (i++ > 100) return Eaverage;
     427  } while (KineticEnergy < Eaverage-3.72*ESigma ||
     428           KineticEnergy > Eaverage+3.72*ESigma ||
     429           KineticEnergy > Tmax);
     430 
     431  return KineticEnergy;
     432}
     433
     434G4double G4CompetitiveFission::AsymmetricRatio(G4int A, G4double A11)
     435{
     436  const G4double B1 = 23.5;
     437  const G4double A00 = 134.0;
     438  return Ratio(G4double(A),A11,B1,A00);
     439}
     440
     441G4double G4CompetitiveFission::SymmetricRatio(G4int A, G4double A11)
     442{
     443  const G4double B1 = 5.32;
     444  const G4double A00 = A/2.0;
     445  return Ratio(G4double(A),A11,B1,A00);
     446}
     447
     448G4double G4CompetitiveFission::Ratio(G4double A, G4double A11,
     449                                     G4double B1, G4double A00)
     450{
     451  if (A == 0.0) {
     452    throw G4HadronicException(__FILE__, __LINE__,
     453                              "G4CompetitiveFission::Ratio: A == 0!");
     454  }
     455  if (A11 >= A/2.0 && A11 <= (A00+10.0)) {
     456    return 1.0-B1*((A11-A00)/A)*((A11-A00)/A);
     457  } else {
     458    return 1.0-B1*(10.0/A)*(10.0/A)-2.0*(10.0/A)*B1*((A11-A00-10.0)/A);
     459  }
     460}
    508461
    509462G4ThreeVector G4CompetitiveFission::IsotropicVector(const G4double Magnitude)
    510     // Samples a isotropic random vectorwith a magnitud given by Magnitude.
    511     // By default Magnitude = 1.0
    512 {
    513     G4double CosTheta = 1.0 - 2.0*G4UniformRand();
    514     G4double SinTheta = std::sqrt(1.0 - CosTheta*CosTheta);
    515     G4double Phi = twopi*G4UniformRand();
    516     G4ThreeVector Vector(Magnitude*std::cos(Phi)*SinTheta,
    517                          Magnitude*std::sin(Phi)*SinTheta,
    518                          Magnitude*CosTheta);
    519     return Vector;
    520 }
    521 
     463  // Samples a isotropic random vectorwith a magnitud given by Magnitude.
     464  // By default Magnitude = 1.0
     465{
     466  G4double CosTheta = 1.0 - 2.0*G4UniformRand();
     467  G4double SinTheta = std::sqrt(1.0 - CosTheta*CosTheta);
     468  G4double Phi = twopi*G4UniformRand();
     469  G4ThreeVector Vector(Magnitude*std::cos(Phi)*SinTheta,
     470                       Magnitude*std::sin(Phi)*SinTheta,
     471                       Magnitude*CosTheta);
     472  return Vector;
     473}
    522474
    523475#ifdef debug
  • trunk/source/processes/hadronic/models/de_excitation/fission/src/G4FissionBarrier.cc

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4FissionBarrier.cc,v 1.7 2009/12/16 16:50:07 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4FissionBarrier.cc,v 1.8 2010/11/17 20:22:46 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
    3131// by V. Lara (Oct 1998)
    32 
     32//
     33// 17.11.2010 V.Ivanchenko cleanup and add usage of G4Pow
    3334
    3435#include "G4FissionBarrier.hh"
     36#include "G4Pow.hh"
    3537
    36 G4FissionBarrier::G4FissionBarrier(const G4FissionBarrier & ) : G4VFissionBarrier()
     38G4FissionBarrier::G4FissionBarrier()
     39{}
     40
     41G4FissionBarrier::~G4FissionBarrier()
     42{}
     43
     44G4double
     45G4FissionBarrier::FissionBarrier(G4int A, G4int Z, G4double U)
     46  // Compute fission barrier according with Barashenkov's
     47  // prescription for A >= 65
    3748{
    38     throw G4HadronicException(__FILE__, __LINE__, "G4FissionBarrier::copy_constructor meant to not be accessable.");
     49  if (A >= 65) {
     50    return BarashenkovFissionBarrier(A,Z)/(1.0 + std::sqrt(U/(2.0*A)));
     51  } else { return 100.0*GeV; }
    3952}
    4053
     54G4double
     55G4FissionBarrier::BarashenkovFissionBarrier(G4int A, G4int Z)
     56  // Calculates Fission Barrier heights
     57{
     58  // Liquid drop model parameters for
     59  // surface energy of a spherical nucleus
     60  const G4double aSurf = 17.9439*MeV;
     61  // and coulomb energy
     62  const G4double aCoul = 0.7053*MeV;
     63  const G4double k = 1.7826;
     64  G4int N = A - Z;
    4165
    42 const G4FissionBarrier & G4FissionBarrier::operator=(const G4FissionBarrier & )
    43 {
    44     throw G4HadronicException(__FILE__, __LINE__, "G4FissionBarrier::operator= meant to not be accessable.");
    45     return *this;
     66  // fissibility parameter
     67  G4double x = (aCoul/(2.0*aSurf))*(Z*Z)/static_cast<G4double>(A);
     68  x /= (1.0 - k*(N-Z)*(N-Z)/static_cast<G4double>(A*A));
     69 
     70  // Liquid drop model part of Fission Barrier
     71  G4double BF0 = aSurf*G4Pow::GetInstance()->Z23(A);
     72  if (x <= 2./3.) { BF0 *= 0.38*(3./4.-x); }
     73  else { BF0 *= 0.83*(1. - x)*(1. - x)*(1. - x); }
     74
     75  //
     76  G4double D = 1.248*MeV;
     77  D *= (N - 2*(N/2) + Z - 2*(Z/2));
     78
     79  return BF0 + D - SellPlusPairingCorrection(Z,N);
    4680}
    4781
    48 G4bool G4FissionBarrier::operator==(const G4FissionBarrier & ) const
    49 {
    50     return false;
    51 }
    52 
    53 G4bool G4FissionBarrier::operator!=(const G4FissionBarrier & ) const
    54 {
    55     return true;
    56 }
    57 
    58 
    59 
    60 G4double G4FissionBarrier::FissionBarrier(const G4int A, const G4int Z, const G4double U)
    61     // Compute fission barrier according with Barashenkov's prescription for A >= 65
    62 {
    63     if (A >= 65) return BarashenkovFissionBarrier(A,Z)/(1.0 + std::sqrt(U/(2.0*static_cast<G4double>(A))));
    64     else return 100.0*GeV;
    65 }
    66 
    67 
    68 G4double G4FissionBarrier::BarashenkovFissionBarrier(const G4int A, const G4int Z)
    69     // Calculates Fission Barrier heights
    70 {
    71     // Liquid drop model parameters for
    72     // surface energy of a spherical nucleus
    73     const G4double aSurf = 17.9439*MeV;
    74     // and coulomb energy
    75     const G4double aCoul = 0.7053*MeV;
    76     const G4int N = A - Z;
    77     const G4double k = 1.7826;
    78 
    79     // fissibility parameter
    80     G4double x = (aCoul/(2.0*aSurf))*(static_cast<G4double>(Z)*static_cast<G4double>(Z))/static_cast<G4double>(A);
    81     x /= (1.0 - k*(static_cast<G4double>(N-Z)/static_cast<G4double>(A))*
    82           (static_cast<G4double>(N-Z)/static_cast<G4double>(A)));
    83  
    84     // Liquid drop model part of Fission Barrier
    85     G4double BF0 = aSurf*std::pow(static_cast<G4double>(A),2./3.);
    86     if (x <= 2./3.) BF0 *= 0.38*(3./4.-x);
    87     else BF0 *= 0.83*(1. - x)*(1. - x)*(1. - x);
    88 
    89 
    90     //
    91     G4double D = 1.248*MeV;
    92     D *= (static_cast<G4double>(N)-2.0*(N/2)) + (static_cast<G4double>(Z)-2.0*(Z/2));
    93 
    94     return BF0 + D - SellPlusPairingCorrection(Z,N);
    95 }
    96 
  • trunk/source/processes/hadronic/models/de_excitation/fission/src/G4FissionLevelDensityParameter.cc

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4FissionLevelDensityParameter.cc,v 1.7 2009/11/21 18:05:26 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4FissionLevelDensityParameter.cc,v 1.8 2010/11/17 20:22:46 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    3939
    4040
    41 G4FissionLevelDensityParameter::
    42 G4FissionLevelDensityParameter(const G4FissionLevelDensityParameter &) : G4VLevelDensityParameter()
    43 {
    44     throw G4HadronicException(__FILE__, __LINE__, "G4FissionLevelDensityParameter::copy_constructor meant to not be accessable");
    45 }
     41G4FissionLevelDensityParameter::G4FissionLevelDensityParameter()
     42{}
    4643
    47 
    48 const G4FissionLevelDensityParameter & G4FissionLevelDensityParameter::
    49 operator=(const G4FissionLevelDensityParameter &)
    50 {
    51     throw G4HadronicException(__FILE__, __LINE__, "G4FissionLevelDensityParameter::operator= meant to not be accessable");
    52     return *this;
    53 }
    54 
    55 
    56 G4bool G4FissionLevelDensityParameter::
    57 operator==(const G4FissionLevelDensityParameter &) const
    58 {
    59     return false;
    60 }
    61 
    62 G4bool G4FissionLevelDensityParameter::
    63 operator!=(const G4FissionLevelDensityParameter &) const
    64 {
    65     return true;
    66 }
     44G4FissionLevelDensityParameter::~G4FissionLevelDensityParameter()
     45{}
    6746
    6847
    6948G4double G4FissionLevelDensityParameter::
    70 LevelDensityParameter(const G4int A,const G4int Z,const G4double U) const
     49LevelDensityParameter(G4int A, G4int Z, G4double U) const
    7150{
    7251  G4double EvapLDP =
  • trunk/source/processes/hadronic/models/de_excitation/fission/src/G4FissionParameters.cc

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4FissionParameters.cc,v 1.7 2009/11/19 10:30:49 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4FissionParameters.cc,v 1.8 2010/11/17 20:22:46 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    4141const G4double G4FissionParameters::A2 = 141.0;
    4242
    43 
    44 G4FissionParameters::G4FissionParameters(const G4int A, const G4int Z, const G4double ExEnergy,
    45                                          const G4double FissionBarrier)
     43G4FissionParameters::G4FissionParameters(G4int A, G4int Z, G4double ExEnergy,
     44                                         G4double FissionBarrier)
    4645{
    47     G4double U = ExEnergy;
     46  G4double U = ExEnergy;
     47 
     48  As = A/2.0;
    4849   
    49     As = A/2.0;
     50  if (A <= 235) Sigma2 = 5.6;  // MeV
     51  else Sigma2 = 5.6 + 0.096*(A-235); // MeV
    5052   
    51     if (A <= 235) Sigma2 = 5.6;  // MeV
    52     else Sigma2 = 5.6 + 0.096*(A-235); // MeV
     53  Sigma1 = 0.5*Sigma2; // MeV
    5354   
    54     Sigma1 = 0.5*Sigma2; // MeV
     55  SigmaS = std::exp(0.00553*U/MeV + 2.1386); // MeV
    5556   
    56     SigmaS = std::exp(0.00553*U/MeV + 2.1386); // MeV
     57  //JMQ 310509
     58  //    if (SigmaS > 20.0) SigmaS = 20.0;
     59  //   SigmaS*=1.3;
     60  //JMQ 301009: retuning (after CEM transition prob.have been chosen as default)
     61  SigmaS*=0.8;
     62  //
    5763   
    58     //JMQ 310509
    59     //    if (SigmaS > 20.0) SigmaS = 20.0;
    60     //   SigmaS*=1.3;
    61     //JMQ 301009: retuning (after CEM transition prob.have been chosen as default)
    62     SigmaS*=0.8;
    63     //
     64  G4double FasymAsym = 2.0*std::exp(-((A2-As)*(A2-As))/(2.0*Sigma2*Sigma2)) +
     65    std::exp(-((A1-As)*(A1-As))/(2.0*Sigma1*Sigma1));
    6466   
    65     G4double FasymAsym = 2.0*std::exp(-((A2-As)*(A2-As))/(2.0*Sigma2*Sigma2)) +
    66       std::exp(-((A1-As)*(A1-As))/(2.0*Sigma1*Sigma1));
    67    
    68     G4double FsymA1A2 = std::exp(-((As-(A1+A2)/2.0)*(As-(A1+A2)/2.0))/(2.0*SigmaS*SigmaS));
     67  G4double FsymA1A2 = std::exp(-((As-(A1+A2)/2.0)*(As-(A1+A2)/2.0))
     68                               /(2.0*SigmaS*SigmaS));
    6969   
    7070   
    71     G4double wa = 0.0;
    72     w = 0.0;
    73     if (Z >= 90) {         // Z >= 90
    74       if (U <= 16.25) wa = std::exp(0.5385*U/MeV-9.9564);  // U <= 16.25 MeV
    75       else wa = std::exp(0.09197*U/MeV-2.7003);            // U  > 16.25 MeV
    76     } else if (Z == 89) {  // Z == 89
    77       wa = std::exp(0.09197*U-1.0808);
    78     } else if (Z >= 82) {  //  82 <= Z <= 88
    79       G4double X = FissionBarrier - 7.5*MeV;
    80       if (X < 0.0) X = 0.0;
    81       wa = std::exp(0.09197*(U-X)/MeV-1.0808);
    82     } else {               // Z < 82
    83       w = 1001.0;
    84     }
     71  G4double wa = 0.0;
     72  w = 0.0;
     73  if (Z >= 90) {         // Z >= 90
     74    if (U <= 16.25) wa = std::exp(0.5385*U/MeV-9.9564);  // U <= 16.25 MeV
     75    else wa = std::exp(0.09197*U/MeV-2.7003);            // U  > 16.25 MeV
     76  } else if (Z == 89) {  // Z == 89
     77    wa = std::exp(0.09197*U-1.0808);
     78  } else if (Z >= 82) {  //  82 <= Z <= 88
     79    G4double X = FissionBarrier - 7.5*MeV;
     80    if (X < 0.0) X = 0.0;
     81    wa = std::exp(0.09197*(U-X)/MeV-1.0808);
     82  } else {               // Z < 82
     83    w = 1001.0;
     84  }
    8585   
    86     if (w == 0.0) {
    87       G4double w1 = std::max(1.03*wa - FasymAsym, 0.0001);
    88       G4double w2 = std::max(1.0 - FsymA1A2*wa,   0.0001);
     86  if (w == 0.0) {
     87    G4double w1 = std::max(1.03*wa - FasymAsym, 0.0001);
     88    G4double w2 = std::max(1.0 - FsymA1A2*wa,   0.0001);
     89   
     90    w = w1/w2;
    8991     
    90       w = w1/w2;
    91      
    92       if (82 <= Z && Z < 89 && A < 227)  w *= std::exp(0.3*(227-A));
    93     }
     92    if (82 <= Z && Z < 89 && A < 227)  w *= std::exp(0.3*(227-A));
     93  }
    9494   
    9595}
    9696
     97G4FissionParameters::~G4FissionParameters()
     98{}
    9799
    98 G4FissionParameters::G4FissionParameters(const G4FissionParameters &)
    99 {
    100     throw G4HadronicException(__FILE__, __LINE__, "G4FissionParameters::copy_constructor meant to not be accessable");
    101 }
    102 
    103 
    104 const G4FissionParameters & G4FissionParameters::operator=(const G4FissionParameters &)
    105 {
    106     throw G4HadronicException(__FILE__, __LINE__, "G4FissionParameters::operator= meant to not be accessable");
    107     return *this;
    108 }
    109 
    110 
    111 G4bool G4FissionParameters::operator==(const G4FissionParameters &) const
    112 {
    113     return false;
    114 }
    115 
    116 G4bool G4FissionParameters::operator!=(const G4FissionParameters &) const
    117 {
    118     return true;
    119 }
    120 
    121 
  • trunk/source/processes/hadronic/models/de_excitation/fission/src/G4FissionProbability.cc

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4FissionProbability.cc,v 1.9 2009/02/15 17:03:25 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4FissionProbability.cc,v 1.10 2010/11/17 20:22:46 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    3838#include "G4PairingCorrection.hh"
    3939
     40G4FissionProbability::G4FissionProbability()
     41{}
     42
     43G4FissionProbability::~G4FissionProbability()
     44{}
    4045
    4146
    42 G4FissionProbability::G4FissionProbability(const G4FissionProbability &) : G4VEmissionProbability()
     47G4double
     48G4FissionProbability::EmissionProbability(const G4Fragment & fragment,
     49                                          G4double MaximalKineticEnergy)
     50  // Compute integrated probability of fission channel
    4351{
    44     throw G4HadronicException(__FILE__, __LINE__, "G4FissionProbability::copy_constructor meant to not be accessable");
     52  if (MaximalKineticEnergy <= 0.0) return 0.0;
     53  G4int A = fragment.GetA_asInt();
     54  G4int Z = fragment.GetZ_asInt();
     55  G4double U = fragment.GetExcitationEnergy();
     56 
     57  G4double Ucompound = U -
     58    G4PairingCorrection::GetInstance()->GetPairingCorrection(A,Z);
     59
     60  G4double Ufission = U -
     61    G4PairingCorrection::GetInstance()->GetFissionPairingCorrection(A,Z);
     62 
     63  G4double SystemEntropy =
     64    2.0*std::sqrt(theEvapLDP.LevelDensityParameter(A,Z,Ucompound)*Ucompound);
     65       
     66  G4double afission = theFissLDP.LevelDensityParameter(A,Z,Ufission);
     67
     68  G4double Cf = 2.0*std::sqrt(afission*MaximalKineticEnergy);
     69
     70  //    G4double Q1 = 1.0 + (Cf - 1.0)*std::exp(Cf);
     71  //    G4double Q2 = 4.0*pi*afission*std::exp(SystemEntropy);
     72 
     73  //    G4double probability = Q1/Q2;
     74   
     75  G4double Exp1 = 0.0;
     76  if (SystemEntropy <= 160.0) { Exp1 = std::exp(-SystemEntropy); }
     77  // @@@@@@@@@@@@@@@@@ hpw changed max to min - cannot notify vicente now
     78  G4double Exp2 = std::exp( std::min(700.0,Cf-SystemEntropy) );
     79
     80  // JMQ 14/02/09 BUG fixed in fission probability (missing parenthesis
     81  // at denominator)
     82  //AH fix from Vincente: G4double probability =
     83  //        (Exp1 + (1.0-Cf)*Exp2) / 4.0*pi*afission;
     84  //    G4double probability = (Exp1 + (Cf-1.0)*Exp2) / 4.0*pi*afission;
     85  G4double probability = (Exp1 + (Cf-1.0)*Exp2) / (4.0*pi*afission);
     86
     87  return probability;
    4588}
    4689
    47 
    48 
    49 
    50 const G4FissionProbability & G4FissionProbability::operator=(const G4FissionProbability &)
    51 {
    52     throw G4HadronicException(__FILE__, __LINE__, "G4FissionProbability::operator= meant to not be accessable");
    53     return *this;
    54 }
    55 
    56 
    57 G4bool G4FissionProbability::operator==(const G4FissionProbability &) const
    58 {
    59     return false;
    60 }
    61 
    62 G4bool G4FissionProbability::operator!=(const G4FissionProbability &) const
    63 {
    64     return true;
    65 }
    66 
    67 
    68 G4double G4FissionProbability::EmissionProbability(const G4Fragment & fragment, const G4double MaximalKineticEnergy)
    69     // Compute integrated probability of fission channel
    70 {
    71     if (MaximalKineticEnergy <= 0.0) return 0.0;
    72     G4double A = fragment.GetA();
    73     G4double Z = fragment.GetZ();
    74     G4double U = fragment.GetExcitationEnergy();
    75  
    76     G4double Ucompound = U - G4PairingCorrection::GetInstance()->GetPairingCorrection(static_cast<G4int>(A),
    77                                                                                       static_cast<G4int>(Z));
    78     G4double Ufission = U - G4PairingCorrection::GetInstance()->GetFissionPairingCorrection(static_cast<G4int>(A),
    79                                                                                             static_cast<G4int>(Z));
    80  
    81     G4double SystemEntropy = 2.0*std::sqrt(theEvapLDP.LevelDensityParameter(static_cast<G4int>(A),
    82                                                                        static_cast<G4int>(Z),
    83                                                                        Ucompound)*Ucompound);
    84        
    85     G4double afission = theFissLDP.LevelDensityParameter(static_cast<G4int>(A),
    86                                                          static_cast<G4int>(Z),
    87                                                          Ufission);
    88 
    89     G4double Cf = 2.0*std::sqrt(afission*MaximalKineticEnergy);
    90 
    91     //    G4double Q1 = 1.0 + (Cf - 1.0)*std::exp(Cf);
    92     //    G4double Q2 = 4.0*pi*afission*std::exp(SystemEntropy);
    93        
    94     //    G4double probability = Q1/Q2;
    95  
    96    
    97     G4double Exp1 = 0.0;
    98     if (SystemEntropy <= 160.0) Exp1 = std::exp(-SystemEntropy);
    99     // @@@@@@@@@@@@@@@@@ hpw changed max to min - cannot notify vicente now
    100     G4double Exp2 = std::exp( std::min(700.0,Cf-SystemEntropy) );
    101 
    102     // JMQ 14/02/09 BUG fixed in fission probability (missing parenthesis at denominator)
    103     //AH fix from Vincente:    G4double probability = (Exp1 + (1.0-Cf)*Exp2) / 4.0*pi*afission;
    104     //    G4double probability = (Exp1 + (Cf-1.0)*Exp2) / 4.0*pi*afission;
    105     G4double probability = (Exp1 + (Cf-1.0)*Exp2) / (4.0*pi*afission);
    106 
    107 
    108    
    109     return probability;
    110 }
    111 
  • trunk/source/processes/hadronic/models/de_excitation/fission/src/G4VFissionBarrier.cc

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4VFissionBarrier.cc,v 1.4 2006/06/29 20:13:43 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4VFissionBarrier.cc,v 1.5 2010/11/17 20:22:46 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    3434#include "G4VFissionBarrier.hh"
    3535
    36 G4VFissionBarrier::G4VFissionBarrier(const G4VFissionBarrier & )
    37 {
    38   throw G4HadronicException(__FILE__, __LINE__, "G4VFissionBarrier::copy_constructor meant to not be accessable.");
    39 }
     36G4VFissionBarrier::G4VFissionBarrier() {}
     37G4VFissionBarrier::~G4VFissionBarrier() {}
    4038
    41 
    42 const G4VFissionBarrier & G4VFissionBarrier::operator=(const G4VFissionBarrier & )
    43 {
    44  throw G4HadronicException(__FILE__, __LINE__, "G4VFissionBarrier::operator= meant to not be accessable.");
    45  return *this;
    46 }
    47 
    48 G4bool G4VFissionBarrier::operator==(const G4VFissionBarrier & ) const
    49 {
    50  return false;
    51 }
    52 
    53 G4bool G4VFissionBarrier::operator!=(const G4VFissionBarrier & ) const
    54 {
    55  return true;
    56 }
    57 
  • trunk/source/processes/hadronic/models/de_excitation/gem_evaporation/include/G4AlphaGEMChannel.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4AlphaGEMChannel.hh,v 1.4 2009/09/15 12:54:16 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4AlphaGEMChannel.hh,v 1.5 2010/10/29 17:35:04 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    5757private:
    5858    const G4AlphaGEMChannel & operator=(const G4AlphaGEMChannel & right); 
    59    
    60     G4AlphaGEMChannel(const G4AlphaGEMChannel & right);
    61    
    62 public:
     59    G4AlphaGEMChannel(const G4AlphaGEMChannel & right);   
    6360    G4bool operator==(const G4AlphaGEMChannel & right) const;
    6461    G4bool operator!=(const G4AlphaGEMChannel & right) const;
    6562   
    66 private:
    6763// JMQ 190709
    6864//       G4AlphaCoulombBarrier theCoulombBarrier;
  • trunk/source/processes/hadronic/models/de_excitation/gem_evaporation/include/G4GEMChannel.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4GEMChannel.hh,v 1.5 2009/09/15 12:54:16 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4GEMChannel.hh,v 1.7 2010/11/18 16:21:17 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    4848//#define debug
    4949
     50class G4Pow;
     51
    5052class G4GEMChannel : public G4VEvaporationChannel
    5153{
    5254public:
    53     // Available constructors
    54     G4GEMChannel(const G4int theA, const G4int theZ,
    55                  G4GEMProbability * aEmissionStrategy,
    56                  G4VCoulombBarrier * aCoulombBarrier);
     55
     56  G4GEMChannel(const G4int theA, const G4int theZ, const G4String & aName,
     57               G4GEMProbability * aEmissionStrategy,
     58               G4VCoulombBarrier * aCoulombBarrier);
     59
     60  // destructor
     61  virtual ~G4GEMChannel();
    5762   
    58     G4GEMChannel(const G4int theA, const G4int theZ, const G4String & aName,
    59                  G4GEMProbability * aEmissionStrategy,
    60                  G4VCoulombBarrier * aCoulombBarrier);
     63  void Initialize(const G4Fragment & fragment);
     64
     65  G4FragmentVector * BreakUp(const G4Fragment & theNucleus);
     66
     67  inline void SetLevelDensityParameter(G4VLevelDensityParameter * aLevelDensity)
     68  {
     69    if (MyOwnLevelDensity) { delete theLevelDensityPtr; }
     70    theLevelDensityPtr = aLevelDensity;
     71    MyOwnLevelDensity = false;
     72  }
     73
     74  inline G4double GetEmissionProbability(void) const
     75  { return EmissionProbability; }
     76 
     77  inline G4double GetMaximalKineticEnergy(void) const
     78  { return MaximalKineticEnergy; }
     79 
     80private:
    6181   
    62     G4GEMChannel(const G4int theA, const G4int theZ, const G4String * aName,
    63                  G4GEMProbability * aEmissionStrategy,
    64                  G4VCoulombBarrier * aCoulombBarrier);
    65    
    66 public:
    67     // destructor
    68     ~G4GEMChannel();
    69  
    70     void SetEmissionStrategy(G4GEMProbability * aEmissionStrategy)
    71         {
    72             theEvaporationProbabilityPtr = aEmissionStrategy;
    73         }
    74  
    75     void SetCoulombBarrierStrategy(G4VCoulombBarrier * aCoulombBarrier)
    76         {
    77             theCoulombBarrierPtr = aCoulombBarrier;
    78         }
     82  // Calculate Binding Energy for separate fragment from nucleus
     83  G4double CalcBindingEnergy(G4int anA, G4int aZ);
     84
     85  // Calculate maximal kinetic energy that can be carried by fragment (in MeV)
     86  G4double CalcMaximalKineticEnergy(G4double U);
     87
     88  // Samples fragment kinetic energy.
     89  G4double CalcKineticEnergy(const G4Fragment & fragment);
     90
     91  // This has to be removed and put in Random Generator
     92  G4ThreeVector IsotropicVector(G4double Magnitude  = 1.0);
     93
     94  G4GEMChannel(const G4GEMChannel & right); 
     95  const G4GEMChannel & operator=(const G4GEMChannel & right);
     96  G4bool operator==(const G4GEMChannel & right) const;
     97  G4bool operator!=(const G4GEMChannel & right) const;
    7998 
    8099protected:
    81     // default constructor
    82     G4GEMChannel() {};
    83  
     100  G4GEMChannel();
     101
     102  // Data Members ************
     103
    84104private:
    85     // copy constructor
    86     G4GEMChannel(const G4GEMChannel & right);
    87  
    88 private:
    89     const G4GEMChannel & operator=(const G4GEMChannel & right);
    90  
    91 public:
    92     G4bool operator==(const G4GEMChannel & right) const;
    93     G4bool operator!=(const G4GEMChannel & right) const;
    94105
    95 public:
    96     void Initialize(const G4Fragment & fragment);
     106  // This data member define the channel.
     107  // They are intializated at object creation (constructor) time.
     108   
     109  // Atomic Number
     110  G4int A;
     111   
     112  // Charge
     113  G4int Z;
    97114
    98     G4FragmentVector * BreakUp(const G4Fragment & theNucleus);
     115  G4double EvaporatedMass;
     116  G4double ResidualMass;
    99117
    100     inline void SetLevelDensityParameter(G4VLevelDensityParameter * aLevelDensity)
    101         {
    102             if (MyOwnLevelDensity) delete theLevelDensityPtr;
    103             theLevelDensityPtr = aLevelDensity;
    104             MyOwnLevelDensity = false;
    105         }
    106  
    107 public:
     118  G4Pow* fG4pow;
     119   
     120  // For evaporation probability calcualtion
     121  G4GEMProbability * theEvaporationProbabilityPtr;
     122   
     123  // For Level Density calculation
     124  G4bool MyOwnLevelDensity;
     125  G4VLevelDensityParameter * theLevelDensityPtr;
     126   
     127  // For Coulomb Barrier calculation
     128  G4VCoulombBarrier * theCoulombBarrierPtr;
     129  G4double CoulombBarrier;
     130   
     131  //---------------------------------------------------
     132   
     133  // These values depend on the nucleus that is being evaporated.
     134  // They are calculated through the Initialize method which takes as parameters
     135  // the atomic number, charge and excitation energy of nucleus.
     136   
     137  // Residual Atomic Number
     138  G4int ResidualA;
     139
     140  // Residual Charge
     141  G4int ResidualZ;
     142   
     143  // Emission Probability
     144  G4double EmissionProbability;
     145
     146  // Maximal Kinetic Energy that can be carried by fragment
     147  G4double MaximalKineticEnergy;
    108148
    109149
    110     inline G4double GetEmissionProbability(void) const
    111         {
    112             return EmissionProbability;
    113         }
    114  
    115  
    116     inline G4double GetMaximalKineticEnergy(void) const
    117         {
    118             return MaximalKineticEnergy;
    119         }
    120  
    121     // ----------------------
    122    
    123 private:
    124    
    125     // Calculate Binding Energy for separate fragment from nucleus
    126     G4double CalcBindingEnergy(const G4int anA, const G4int aZ);
    127 
    128     // Calculate maximal kinetic energy that can be carried by fragment (in MeV)
    129     G4double CalcMaximalKineticEnergy(const G4double U);
    130 
    131     // Samples fragment kinetic energy.
    132     G4double CalcKineticEnergy(const G4Fragment & fragment);
    133 
    134     // This has to be removed and put in Random Generator
    135     G4ThreeVector IsotropicVector(const G4double Magnitude  = 1.0);
    136 
    137         // Data Members
    138         // ************
    139 private:
    140 
    141     // This data member define the channel.
    142   // They are intializated at object creation (constructor) time.
    143    
    144     // Atomic Number
    145     G4int A;
    146    
    147     // Charge
    148     G4int Z;
    149    
    150 
    151     // For evaporation probability calcualtion
    152     G4GEMProbability * theEvaporationProbabilityPtr;
    153    
    154     // For Level Density calculation
    155     G4bool MyOwnLevelDensity;
    156     G4VLevelDensityParameter * theLevelDensityPtr;
    157    
    158     // For Coulomb Barrier calculation
    159     G4VCoulombBarrier * theCoulombBarrierPtr;
    160     G4double CoulombBarrier;
    161    
    162     //---------------------------------------------------
    163    
    164     // These values depend on the nucleus that is being evaporated.
    165     // They are calculated through the Initialize method which takes as parameters
    166     // the atomic number, charge and excitation energy of nucleus.
    167    
    168     // Residual Atomic Number
    169     G4int AResidual;
    170 
    171     // Residual Charge
    172     G4int ZResidual;
    173    
    174     // Emission Probability
    175     G4double EmissionProbability;
    176 
    177 
    178     // Maximal Kinetic Energy that can be carried by fragment
    179     G4double MaximalKineticEnergy;
    180150};
    181151
  • trunk/source/processes/hadronic/models/de_excitation/gem_evaporation/include/G4GEMProbability.hh

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4GEMProbability.hh,v 1.4 2010/05/19 10:21:16 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     26// $Id: G4GEMProbability.hh,v 1.6 2010/11/05 14:42:52 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2828//
    2929//---------------------------------------------------------------------
     
    4343#define G4GEMProbability_h 1
    4444
    45 
    4645#include "G4VEmissionProbability.hh"
    4746#include "G4VLevelDensityParameter.hh"
     
    6059
    6160  // Only available constructor
    62   G4GEMProbability(const G4int anA, const G4int aZ, const G4double aSpin);
     61  G4GEMProbability(G4int anA, G4int aZ, G4double aSpin);
    6362   
    6463  virtual ~G4GEMProbability();
     
    114113  }
    115114
    116   inline void SetCoulombBarrierStrategy(G4VCoulombBarrier * aCoulombBarrier)
    117   {
    118     theCoulombBarrierPtr = aCoulombBarrier;
    119   }
    120 
    121115private:
    122116
     
    130124public:
    131125
    132   G4double EmissionProbability(const G4Fragment & fragment, const G4double anEnergy);
     126  G4double EmissionProbability(const G4Fragment & fragment, G4double anEnergy);
    133127 
    134128private:
    135129
    136   G4double CalcProbability(const G4Fragment & fragment, const G4double MaximalKineticEnergy,
    137                            const G4double V);
     130  G4double CalcProbability(const G4Fragment & fragment, G4double MaximalKineticEnergy,
     131                           G4double V);
    138132
    139   virtual G4double CCoeficient(const G4double ) const;
     133  virtual G4double CCoeficient(G4double ) const;
    140134
    141   inline G4double I0(const G4double t);
    142   inline G4double I1(const G4double t, const G4double tx);
    143   inline G4double I2(const G4double s, const G4double sx);
    144   G4double I3(const G4double s, const G4double sx);
     135  inline G4double I0(G4double t);
     136  inline G4double I1(G4double t, G4double tx);
     137  inline G4double I2(G4double s, G4double sx);
     138  G4double I3(G4double s, G4double sx);
    145139   
    146140  // Data Members
     
    174168};
    175169
    176 inline G4double G4GEMProbability::I0(const G4double t)
     170inline G4double G4GEMProbability::I0(G4double t)
    177171{
    178172  return std::exp(t) - 1.0;
    179173}
    180174
    181 inline G4double G4GEMProbability::I1(const G4double t, const G4double tx)
     175inline G4double G4GEMProbability::I1(G4double t, G4double tx)
    182176{
    183177  return (t - tx + 1.0)*std::exp(tx) - t - 1.0;
     
    185179
    186180
    187 inline G4double G4GEMProbability::I2(const G4double s, const G4double sx)
     181inline G4double G4GEMProbability::I2(G4double s, G4double sx)
    188182{
    189183  G4double S = 1.0/std::sqrt(s);
  • trunk/source/processes/hadronic/models/de_excitation/gem_evaporation/src/G4AlphaGEMChannel.cc

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4AlphaGEMChannel.cc,v 1.5 2009/09/15 12:54:16 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4AlphaGEMChannel.cc,v 1.6 2010/10/29 17:35:04 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    3535
    3636
    37 const G4AlphaGEMChannel & G4AlphaGEMChannel::operator=(const G4AlphaGEMChannel & )
    38 {
    39     throw G4HadronicException(__FILE__, __LINE__, "G4AlphaGEMChannel::operator= meant to not be accessable");
    40     return *this;
    41 }
    42 
    43 G4AlphaGEMChannel::G4AlphaGEMChannel(const G4AlphaGEMChannel & ): G4GEMChannel()
    44 {
    45     throw G4HadronicException(__FILE__, __LINE__, "G4AlphaGEMChannel::CopyConstructor meant to not be accessable");
    46 }
    47 
    48 G4bool G4AlphaGEMChannel::operator==(const G4AlphaGEMChannel & right) const
    49 {
    50     return (this == (G4AlphaGEMChannel *) &right);
    51     //  return false;
    52 }
    53 
    54 G4bool G4AlphaGEMChannel::operator!=(const G4AlphaGEMChannel & right) const
    55 {
    56     return (this != (G4AlphaGEMChannel *) &right);
    57     //  return true;
    58 }
    59 
  • trunk/source/processes/hadronic/models/de_excitation/gem_evaporation/src/G4GEMChannel.cc

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4GEMChannel.cc,v 1.10 2009/10/08 07:55:39 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4GEMChannel.cc,v 1.12 2010/11/18 16:21:17 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    4040#include "G4GEMChannel.hh"
    4141#include "G4PairingCorrection.hh"
    42 
    43 
    44 G4GEMChannel::G4GEMChannel(const G4int theA, const G4int theZ,
    45                            G4GEMProbability * aEmissionStrategy,
    46                            G4VCoulombBarrier * aCoulombBarrier):
    47     A(theA),
    48     Z(theZ),
    49     theEvaporationProbabilityPtr(aEmissionStrategy),
    50     theCoulombBarrierPtr(aCoulombBarrier),
    51     EmissionProbability(0.0),
    52     MaximalKineticEnergy(-1000.0)
    53 {
    54     theLevelDensityPtr = new G4EvaporationLevelDensityParameter;
    55     MyOwnLevelDensity = true;
    56 }
    57 
    58 G4GEMChannel::G4GEMChannel(const G4int theA, const G4int theZ, const G4String & aName,
     42#include "G4Pow.hh"
     43
     44G4GEMChannel::G4GEMChannel(G4int theA, G4int theZ, const G4String & aName,
    5945                           G4GEMProbability * aEmissionStrategy,
    6046                           G4VCoulombBarrier * aCoulombBarrier) :
     
    6955  theLevelDensityPtr = new G4EvaporationLevelDensityParameter;
    7056  MyOwnLevelDensity = true;
     57  EvaporatedMass = G4NucleiProperties::GetNuclearMass(A, Z);
     58  ResidualMass = CoulombBarrier = 0.0;
     59  fG4pow = G4Pow::GetInstance();
     60}
     61
     62G4GEMChannel::G4GEMChannel() :
     63  G4VEvaporationChannel("dummy"),
     64  A(0),
     65  Z(0),
     66  theEvaporationProbabilityPtr(0),
     67  theCoulombBarrierPtr(0),
     68  EmissionProbability(0.0),
     69  MaximalKineticEnergy(-1000.0)
     70{
     71  theLevelDensityPtr = 0;
     72  MyOwnLevelDensity = true;
     73  EvaporatedMass = 0.0;
     74  ResidualMass = CoulombBarrier = 0.0;
     75  fG4pow = G4Pow::GetInstance();
    7176}
    7277
    7378G4GEMChannel::~G4GEMChannel()
    7479{
    75     if (MyOwnLevelDensity) delete theLevelDensityPtr;
    76 }
    77 
    78 G4GEMChannel::G4GEMChannel(const G4GEMChannel & ) : G4VEvaporationChannel()
    79 {
    80     throw G4HadronicException(__FILE__, __LINE__, "G4GEMChannel::copy_costructor meant to not be accessable");
    81 }
    82 
    83 const G4GEMChannel & G4GEMChannel::operator=(const G4GEMChannel & )
    84 {
    85     throw G4HadronicException(__FILE__, __LINE__, "G4GEMChannel::operator= meant to not be accessable");
    86     return *this;
    87 }
    88 
    89 G4bool G4GEMChannel::operator==(const G4GEMChannel & right) const
    90 {
    91     return (this == (G4GEMChannel *) &right);
    92     //  return false;
    93 }
    94 
    95 G4bool G4GEMChannel::operator!=(const G4GEMChannel & right) const
    96 {
    97     return (this != (G4GEMChannel *) &right);
    98     //  return true;
     80  if (MyOwnLevelDensity) { delete theLevelDensityPtr; }
    9981}
    10082
    10183void G4GEMChannel::Initialize(const G4Fragment & fragment)
    10284{
    103   G4int anA = static_cast<G4int>(fragment.GetA());
    104   G4int aZ = static_cast<G4int>(fragment.GetZ());
    105   AResidual = anA - A;
    106   ZResidual = aZ - Z;
     85  G4int anA = fragment.GetA_asInt();
     86  G4int aZ  = fragment.GetZ_asInt();
     87  ResidualA = anA - A;
     88  ResidualZ = aZ - Z;
    10789  //G4cout << "G4GEMChannel::Initialize: Z= " << aZ << " A= " << anA
    108   //       << " Zres= " << ZResidual << " Ares= " << AResidual << G4endl;
     90  //       << " Zres= " << ResidualZ << " Ares= " << ResidualA << G4endl;
    10991
    11092  // We only take into account channels which are physically allowed
    111   if (AResidual <= 0 || ZResidual <= 0 || AResidual < ZResidual ||
    112       (AResidual == ZResidual && AResidual > 1))
     93  if (ResidualA <= 0 || ResidualZ <= 0 || ResidualA < ResidualZ ||
     94      (ResidualA == ResidualZ && ResidualA > 1))
    11395    {
    11496      CoulombBarrier = 0.0;
     
    118100  else
    119101    {
    120 
    121102      // Effective excitation energy
    122103      // JMQ 071009: pairing in ExEnergy should be the one of parent compound nucleus
     
    125106      // param for protons must be the same)   
    126107      //    G4double ExEnergy = fragment.GetExcitationEnergy() -
    127       //    G4PairingCorrection::GetInstance()->GetPairingCorrection(AResidual,ZResidual);
     108      //    G4PairingCorrection::GetInstance()->GetPairingCorrection(ResidualA,ResidualZ);
    128109      G4double ExEnergy = fragment.GetExcitationEnergy() -
    129110        G4PairingCorrection::GetInstance()->GetPairingCorrection(anA,aZ);
     
    138119      } else {
    139120
     121        ResidualMass = G4NucleiProperties::GetNuclearMass(ResidualA, ResidualZ);
     122
    140123        // Coulomb Barrier calculation
    141         CoulombBarrier = theCoulombBarrierPtr->GetCoulombBarrier(AResidual,ZResidual,ExEnergy);
     124        CoulombBarrier = theCoulombBarrierPtr->GetCoulombBarrier(ResidualA,ResidualZ,ExEnergy);
    142125        //G4cout << "CBarrier(MeV)= " << CoulombBarrier/MeV << G4endl;
    143126
    144127        //Maximal kinetic energy (JMQ : at the Coulomb barrier)
    145128        MaximalKineticEnergy =
    146           CalcMaximalKineticEnergy(G4ParticleTable::GetParticleTable()->
    147                                    GetIonTable()->GetNucleusMass(aZ,anA)+ExEnergy);
     129          CalcMaximalKineticEnergy(fragment.GetGroundStateMass()+ExEnergy);
    148130        //G4cout << "MaxE(MeV)= " << MaximalKineticEnergy/MeV << G4endl;
    149 
    150131               
    151132        // Emission probability
     
    161142          }
    162143      }
    163     }
    164    
     144    }   
    165145    //G4cout << "Prob= " << EmissionProbability << G4endl;
    166146    return;
     
    169149G4FragmentVector * G4GEMChannel::BreakUp(const G4Fragment & theNucleus)
    170150{
    171     G4double EvaporatedKineticEnergy = CalcKineticEnergy(theNucleus);
    172     G4double EvaporatedMass = G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(Z,A);
    173     G4double EvaporatedEnergy = EvaporatedKineticEnergy + EvaporatedMass;
    174 
    175    
    176     G4ThreeVector momentum(IsotropicVector(std::sqrt(EvaporatedKineticEnergy*
    177                                                 (EvaporatedKineticEnergy+2.0*EvaporatedMass))));
    178    
    179     momentum.rotateUz(theNucleus.GetMomentum().vect().unit());
    180 
    181     G4LorentzVector EvaporatedMomentum(momentum,EvaporatedEnergy);
    182     EvaporatedMomentum.boost(theNucleus.GetMomentum().boostVector());
    183     G4Fragment * EvaporatedFragment = new G4Fragment(A,Z,EvaporatedMomentum);
    184 #ifdef PRECOMPOUND_TEST
    185     EvaporatedFragment->SetCreatorModel(G4String("G4Evaporation"));
     151  G4double EvaporatedKineticEnergy = CalcKineticEnergy(theNucleus);
     152  G4double EvaporatedEnergy = EvaporatedKineticEnergy + EvaporatedMass;
     153 
     154  G4ThreeVector momentum(IsotropicVector(std::sqrt(EvaporatedKineticEnergy*
     155                                                   (EvaporatedKineticEnergy+2.0*EvaporatedMass))));
     156   
     157  momentum.rotateUz(theNucleus.GetMomentum().vect().unit());
     158
     159  G4LorentzVector EvaporatedMomentum(momentum,EvaporatedEnergy);
     160  EvaporatedMomentum.boost(theNucleus.GetMomentum().boostVector());
     161  G4Fragment * EvaporatedFragment = new G4Fragment(A,Z,EvaporatedMomentum);
     162  // ** And now the residual nucleus **
     163  G4double theExEnergy = theNucleus.GetExcitationEnergy();
     164  G4double theMass = theNucleus.GetGroundStateMass();
     165  G4double ResidualEnergy = theMass + (theExEnergy - EvaporatedKineticEnergy) - EvaporatedMass;
     166       
     167  G4LorentzVector ResidualMomentum(-momentum,ResidualEnergy);
     168  ResidualMomentum.boost(theNucleus.GetMomentum().boostVector());
     169       
     170  G4Fragment * ResidualFragment = new G4Fragment( ResidualA, ResidualZ, ResidualMomentum );
     171   
     172  G4FragmentVector * theResult = new G4FragmentVector;
     173   
     174#ifdef debug
     175  G4double Efinal = ResidualMomentum.e() + EvaporatedMomentum.e();
     176  G4ThreeVector Pfinal = ResidualMomentum.vect() + EvaporatedMomentum.vect();
     177  if (std::abs(Efinal-theNucleus.GetMomentum().e()) > 10.0*eV) {
     178    G4cout << "@@@@@@@@@@@@@@@@@@@@@ G4GEMChanel: ENERGY @@@@@@@@@@@@@@@@" << G4endl;
     179    G4cout << "Initial : " << theNucleus.GetMomentum().e()/MeV << " MeV    Final :"
     180           <<Efinal/MeV << " MeV    Delta: " <<  (Efinal-theNucleus.GetMomentum().e())/MeV
     181           << " MeV" << G4endl;
     182  }
     183  if (std::abs(Pfinal.x()-theNucleus.GetMomentum().x()) > 10.0*eV ||
     184      std::abs(Pfinal.y()-theNucleus.GetMomentum().y()) > 10.0*eV ||
     185      std::abs(Pfinal.z()-theNucleus.GetMomentum().z()) > 10.0*eV ) {
     186    G4cout << "@@@@@@@@@@@@@@@@@@@@@ G4GEMChanel: MOMENTUM @@@@@@@@@@@@@@@@" << G4endl;
     187    G4cout << "Initial : " << theNucleus.GetMomentum().vect() << " MeV    Final :"
     188           <<Pfinal/MeV << " MeV    Delta: " <<  Pfinal-theNucleus.GetMomentum().vect()
     189           << " MeV" << G4endl;   
     190       
     191  }
    186192#endif
    187     // ** And now the residual nucleus **
    188     G4double theExEnergy = theNucleus.GetExcitationEnergy();
    189     G4double theMass = G4ParticleTable::GetParticleTable()->
    190         GetIonTable()->GetNucleusMass(static_cast<G4int>(theNucleus.GetZ()),
    191                                       static_cast<G4int>(theNucleus.GetA()));
    192     G4double ResidualEnergy = theMass + (theExEnergy - EvaporatedKineticEnergy) - EvaporatedMass;
    193        
    194     G4LorentzVector ResidualMomentum(-momentum,ResidualEnergy);
    195     ResidualMomentum.boost(theNucleus.GetMomentum().boostVector());
    196        
    197     G4Fragment * ResidualFragment = new G4Fragment( AResidual, ZResidual, ResidualMomentum );
    198 
    199 #ifdef PRECOMPOUND_TEST
    200     ResidualFragment->SetCreatorModel(G4String("ResidualNucleus"));
    201 #endif
    202    
    203    
    204     G4FragmentVector * theResult = new G4FragmentVector;
    205    
    206 #ifdef debug
    207     G4double Efinal = ResidualMomentum.e() + EvaporatedMomentum.e();
    208     G4ThreeVector Pfinal = ResidualMomentum.vect() + EvaporatedMomentum.vect();
    209     if (std::abs(Efinal-theNucleus.GetMomentum().e()) > 10.0*eV) {
    210         G4cout << "@@@@@@@@@@@@@@@@@@@@@ G4GEMChanel: ENERGY @@@@@@@@@@@@@@@@" << G4endl;
    211         G4cout << "Initial : " << theNucleus.GetMomentum().e()/MeV << " MeV    Final :"
    212                <<Efinal/MeV << " MeV    Delta: " <<  (Efinal-theNucleus.GetMomentum().e())/MeV
    213                << " MeV" << G4endl;
    214     }
    215     if (std::abs(Pfinal.x()-theNucleus.GetMomentum().x()) > 10.0*eV ||
    216         std::abs(Pfinal.y()-theNucleus.GetMomentum().y()) > 10.0*eV ||
    217         std::abs(Pfinal.z()-theNucleus.GetMomentum().z()) > 10.0*eV ) {
    218         G4cout << "@@@@@@@@@@@@@@@@@@@@@ G4GEMChanel: MOMENTUM @@@@@@@@@@@@@@@@" << G4endl;
    219         G4cout << "Initial : " << theNucleus.GetMomentum().vect() << " MeV    Final :"
    220                <<Pfinal/MeV << " MeV    Delta: " <<  Pfinal-theNucleus.GetMomentum().vect()
    221                << " MeV" << G4endl;   
    222        
    223     }
    224 #endif
    225     theResult->push_back(EvaporatedFragment);
    226     theResult->push_back(ResidualFragment);
    227     return theResult;
     193  theResult->push_back(EvaporatedFragment);
     194  theResult->push_back(ResidualFragment);
     195  return theResult;
    228196}
    229 
    230 
    231197
    232198G4double G4GEMChannel::CalcMaximalKineticEnergy(const G4double NucleusTotalE)
     
    234200//JMQ this is not the assimptotic kinetic energy but the one at the Coulomb barrier
    235201{
    236   G4double ResidualMass = G4ParticleTable::GetParticleTable()->
    237     GetIonTable()->GetNucleusMass( ZResidual, AResidual );
    238   G4double EvaporatedMass = G4ParticleTable::GetParticleTable()->
    239     GetIonTable()->GetNucleusMass( Z, A );
    240        
    241202  G4double T = (NucleusTotalE*NucleusTotalE + EvaporatedMass*EvaporatedMass - ResidualMass*ResidualMass)/
    242     (2.0*NucleusTotalE) -
    243     EvaporatedMass - CoulombBarrier;
     203    (2.0*NucleusTotalE) - EvaporatedMass - CoulombBarrier;
    244204       
    245205  return T;
    246206}
    247207
    248 
    249 
    250 
    251208G4double G4GEMChannel::CalcKineticEnergy(const G4Fragment & fragment)
    252209// Samples fragment kinetic energy.
    253210{
    254211  G4double U = fragment.GetExcitationEnergy();
    255   G4double NuclearMass = G4ParticleTable::GetParticleTable()->GetIonTable()->GetNucleusMass(Z,A);
    256212 
    257213  G4double Alpha = theEvaporationProbabilityPtr->CalcAlphaParam(fragment);
     
    260216  G4double Normalization = theEvaporationProbabilityPtr->GetNormalization();
    261217
    262 //                       ***RESIDUAL***
     218  //                       ***RESIDUAL***
    263219  //JMQ (September 2009) the following quantities  refer to the RESIDUAL:
    264   G4double delta0 = G4PairingCorrection::GetInstance()->GetPairingCorrection(AResidual,ZResidual);
    265   G4double Ux = (2.5 + 150.0/AResidual)*MeV;
     220  G4double delta0 = G4PairingCorrection::GetInstance()->GetPairingCorrection(ResidualA,ResidualZ);
     221  G4double Ux = (2.5 + 150.0/ResidualA)*MeV;
    266222  G4double Ex = Ux + delta0;
    267223  G4double InitialLevelDensity;
     
    271227  //JMQ (September 2009) the following quantities   refer to the PARENT:
    272228 
    273   G4double deltaCN = G4PairingCorrection::GetInstance()->GetPairingCorrection(static_cast<G4int>(fragment.GetA()),
    274                                                                               static_cast<G4int>(fragment.GetZ()));
    275   G4double aCN = theLevelDensityPtr->LevelDensityParameter(static_cast<G4int>(fragment.GetA()),
    276                                                            static_cast<G4int>(fragment.GetZ()),U-deltaCN);   
     229  G4double deltaCN =
     230    G4PairingCorrection::GetInstance()->GetPairingCorrection(fragment.GetA_asInt(),
     231                                                             fragment.GetZ_asInt());
     232  G4double aCN = theLevelDensityPtr->LevelDensityParameter(fragment.GetA_asInt(),
     233                                                           fragment.GetZ_asInt(),U-deltaCN);   
    277234  G4double UxCN = (2.5 + 150.0/fragment.GetA())*MeV;
    278235  G4double ExCN = UxCN + deltaCN;
    279236  G4double TCN = 1.0/(std::sqrt(aCN/UxCN) - 1.5/UxCN);
    280   G4double E0CN = ExCN - TCN*(std::log(TCN/MeV) - std::log(aCN*MeV)/4.0 - 1.25*std::log(UxCN/MeV) + 2.0*std::sqrt(aCN*UxCN));
    281237  //                       ***end PARENT***
    282238 
     
    284240  if ( U < ExCN )
    285241    {
     242      G4double E0CN = ExCN - TCN*(std::log(TCN/MeV) - std::log(aCN*MeV)/4.0
     243                                  - 1.25*std::log(UxCN/MeV) + 2.0*std::sqrt(aCN*UxCN));
    286244      InitialLevelDensity = (pi/12.0)*std::exp((U-E0CN)/TCN)/TCN;
    287245    }
    288246  else
    289247    {
    290       InitialLevelDensity = (pi/12.0)*std::exp(2*std::sqrt(aCN*(U-deltaCN)))/std::pow(aCN*std::pow(U-deltaCN,5.0),1.0/4.0);
     248      G4double x  = U-deltaCN;
     249      G4double x1 = std::sqrt(aCN*x);
     250      InitialLevelDensity = (pi/12.0)*std::exp(2*x1)/(x*std::sqrt(x1));
     251      //InitialLevelDensity =
     252      //(pi/12.0)*std::exp(2*std::sqrt(aCN*(U-deltaCN)))/std::pow(aCN*std::pow(U-deltaCN,5.0),1.0/4.0);
    291253    }
    292254 
    293255  const G4double Spin = theEvaporationProbabilityPtr->GetSpin();
    294 //JMQ  BIG BUG fixed: hbarc instead of hbar_Planck !!!!
    295 //     it was fixed in total probability (for this channel) but remained still here!!
    296 //    G4double g = (2.0*Spin+1.0)*NuclearMass/(pi2* hbar_Planck*hbar_Planck);
    297     G4double g = (2.0*Spin+1.0)*NuclearMass/(pi2* hbarc*hbarc);
    298 //
    299 //JMQ  fix on Rb and  geometrical cross sections according to Furihata's paper
    300 //                      (JAERI-Data/Code 2001-105, p6)
     256  //JMQ  BIG BUG fixed: hbarc instead of hbar_Planck !!!!
     257  //     it was fixed in total probability (for this channel) but remained still here!!
     258  //    G4double g = (2.0*Spin+1.0)*NuclearMass/(pi2* hbar_Planck*hbar_Planck);
     259  G4double g = (2.0*Spin+1.0)*EvaporatedMass/(pi2* hbarc*hbarc);
     260  //
     261  //JMQ  fix on Rb and  geometrical cross sections according to Furihata's paper
     262  //                      (JAERI-Data/Code 2001-105, p6)
    301263  G4double Rb = 0.0;
    302     if (A > 4)
    303     {
    304       G4double Ad = std::pow(G4double(fragment.GetA()-A),1.0/3.0);
    305       G4double Aj = std::pow(G4double(A),1.0/3.0);
     264  if (A > 4)
     265    {
     266      G4double Ad = fG4pow->Z13(ResidualA);
     267      G4double Aj = fG4pow->Z13(A);
     268      //        RN = 1.12*(R1 + R2) - 0.86*((R1+R2)/(R1*R2));
    306269      Rb = 1.12*(Aj + Ad) - 0.86*((Aj+Ad)/(Aj*Ad))+2.85;
    307270      Rb *= fermi;
    308271    }
    309     else if (A>1)
    310       {
    311         //      G4double R1 = std::pow(G4double(fragment.GetA()-A),1.0/3.0);
    312         //      G4double R2 = std::pow(G4double(A),1.0/3.0);
    313       G4double Ad = std::pow(G4double(fragment.GetA()-A),1.0/3.0);
    314       G4double Aj = std::pow(G4double(A),1.0/3.0);
    315       //        RN = 1.12*(R1 + R2) - 0.86*((R1+R2)/(R1*R2));
     272  else if (A>1)
     273    {
     274      G4double Ad = fG4pow->Z13(ResidualA);
     275      G4double Aj = fG4pow->Z13(A);
    316276      Rb=1.5*(Aj+Ad)*fermi;
    317277    }
    318     else
    319     {
    320       G4double Ad = std::pow(G4double(fragment.GetA()-A),1.0/3.0);
    321       //        RN = 1.5*fermi;
     278  else
     279    {
     280      G4double Ad = fG4pow->Z13(ResidualA);
    322281      Rb = 1.5*Ad*fermi;
    323282    }
    324     //   G4double GeometricalXS = pi*RN*RN*std::pow(G4double(fragment.GetA()-A),2./3.);
    325     G4double GeometricalXS = pi*Rb*Rb;
    326    
    327 
    328     G4double ConstantFactor = g*GeometricalXS*Alpha/InitialLevelDensity;
    329     ConstantFactor *= pi/12.0;
    330     //JMQ : this is the assimptotic maximal kinetic energy of the ejectile
    331     //      (obtained by energy-momentum conservation).
    332     //      In general smaller than U-theSeparationEnergy
    333     G4double theEnergy = MaximalKineticEnergy + CoulombBarrier;
    334     G4double KineticEnergy;
    335     G4double Probability;
    336 
    337     do
    338       {
    339         KineticEnergy =  CoulombBarrier + G4UniformRand()*MaximalKineticEnergy;
    340         Probability = ConstantFactor*(KineticEnergy + Beta);
    341         G4double a = theLevelDensityPtr->LevelDensityParameter(AResidual,ZResidual,theEnergy-KineticEnergy-delta0);
    342         G4double T = 1.0/(std::sqrt(a/Ux) - 1.5/Ux);
    343         //JMQ fix in units
    344         G4double E0 = Ex - T*(std::log(T/MeV) - std::log(a*MeV)/4.0 - 1.25*std::log(Ux/MeV) + 2.0*std::sqrt(a*Ux));
     283  //   G4double GeometricalXS = pi*RN*RN*std::pow(G4double(fragment.GetA()-A),2./3.);
     284  G4double GeometricalXS = pi*Rb*Rb;
     285   
     286  G4double ConstantFactor = g*GeometricalXS*Alpha/InitialLevelDensity;
     287  ConstantFactor *= pi/12.0;
     288  //JMQ : this is the assimptotic maximal kinetic energy of the ejectile
     289  //      (obtained by energy-momentum conservation).
     290  //      In general smaller than U-theSeparationEnergy
     291  G4double theEnergy = MaximalKineticEnergy + CoulombBarrier;
     292  G4double KineticEnergy;
     293  G4double Probability;
     294
     295  do
     296    {
     297      KineticEnergy =  CoulombBarrier + G4UniformRand()*MaximalKineticEnergy;
     298      Probability = ConstantFactor*(KineticEnergy + Beta);
     299      G4double a =
     300        theLevelDensityPtr->LevelDensityParameter(ResidualA,ResidualZ,theEnergy-KineticEnergy-delta0);
     301      G4double T = 1.0/(std::sqrt(a/Ux) - 1.5/Ux);
     302      //JMQ fix in units
    345303       
    346         if ( theEnergy-KineticEnergy < Ex)
    347           {
    348             Probability *= std::exp((theEnergy-KineticEnergy-E0)/T)/T;
    349           }
    350         else
    351           {
    352             Probability *= std::exp(2*std::sqrt(a*(theEnergy-KineticEnergy-delta0)))/
    353               std::pow(a*std::pow(theEnergy-KineticEnergy-delta0,5.0),1.0/4.0);
    354           }
    355         Probability /= Normalization;
    356       }
    357     while (G4UniformRand() > Probability);
    358    
    359     return KineticEnergy;
     304      if ( theEnergy-KineticEnergy < Ex)
     305        {
     306          G4double E0 = Ex - T*(std::log(T/MeV) - std::log(a*MeV)/4.0
     307                                - 1.25*std::log(Ux/MeV) + 2.0*std::sqrt(a*Ux));
     308          Probability *= std::exp((theEnergy-KineticEnergy-E0)/T)/T;
     309        }
     310      else
     311        {
     312          Probability *= std::exp(2*std::sqrt(a*(theEnergy-KineticEnergy-delta0)))/
     313            std::pow(a*fG4pow->powN(theEnergy-KineticEnergy-delta0,5), 0.25);
     314        }
     315    }
     316  while (Normalization*G4UniformRand() > Probability);
     317   
     318  return KineticEnergy;
    360319}
    361320
     
    365324    // By default Magnitude = 1.0
    366325{
    367     G4double CosTheta = 1.0 - 2.0*G4UniformRand();
    368     G4double SinTheta = std::sqrt(1.0 - CosTheta*CosTheta);
    369     G4double Phi = twopi*G4UniformRand();
    370     G4ThreeVector Vector(Magnitude*std::cos(Phi)*SinTheta,
    371                          Magnitude*std::sin(Phi)*SinTheta,
    372                          Magnitude*CosTheta);
    373     return Vector;
    374 }
    375 
    376 
    377 
     326  G4double CosTheta = 1.0 - 2.0*G4UniformRand();
     327  G4double SinTheta = std::sqrt(1.0 - CosTheta*CosTheta);
     328  G4double Phi = twopi*G4UniformRand();
     329  G4ThreeVector Vector(Magnitude*std::cos(Phi)*SinTheta,
     330                       Magnitude*std::sin(Phi)*SinTheta,
     331                       Magnitude*CosTheta);
     332  return Vector;
     333}
     334
     335
     336
  • trunk/source/processes/hadronic/models/de_excitation/gem_evaporation/src/G4GEMProbability.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4GEMProbability.cc,v 1.13 2010/05/19 10:21:16 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     26// $Id: G4GEMProbability.cc,v 1.15 2010/11/05 14:43:27 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2828//
    2929//---------------------------------------------------------------------
     
    6565}
    6666
    67 G4GEMProbability:: G4GEMProbability(const G4int anA, const G4int aZ, const G4double aSpin) :
     67G4GEMProbability:: G4GEMProbability(G4int anA, G4int aZ, G4double aSpin) :
    6868  theA(anA), theZ(aZ), Spin(aSpin), theCoulombBarrierPtr(0),
    6969  ExcitationEnergies(0), ExcitationSpins(0), ExcitationLifetimes(0), Normalization(1.0)
     
    9595
    9696G4double G4GEMProbability::EmissionProbability(const G4Fragment & fragment,
    97                                                const G4double MaximalKineticEnergy)
     97                                               G4double MaximalKineticEnergy)
    9898{
    9999  G4double EmissionProbability = 0.0;
     
    130130
    131131G4double G4GEMProbability::CalcProbability(const G4Fragment & fragment,
    132                                            const G4double MaximalKineticEnergy,
    133                                            const G4double V)
     132                                           G4double MaximalKineticEnergy,
     133                                           G4double V)
    134134
    135135// Calculate integrated probability (width) for evaporation channel
     
    146146  G4double Alpha = CalcAlphaParam(fragment);
    147147  G4double Beta = CalcBetaParam(fragment);
    148  
    149  
     148   
    150149  //                       ***RESIDUAL***
    151150  //JMQ (September 2009) the following quantities refer to the RESIDUAL:
     
    159158  G4double T  = 1.0/(std::sqrt(a/Ux) - 1.5/Ux);
    160159  //JMQ fixed bug in units
    161   G4double E0 = Ex - T*(std::log(T/MeV) - std::log(a*MeV)/4.0 - 1.25*std::log(Ux/MeV) + 2.0*std::sqrt(a*Ux));
     160  G4double E0 = Ex - T*(std::log(T/MeV) - std::log(a*MeV)/4.0
     161        - 1.25*std::log(Ux/MeV) + 2.0*std::sqrt(a*Ux));
    162162  //                      ***end RESIDUAL ***
    163163 
     
    165165  //JMQ (September 2009) the following quantities refer to the PARENT:
    166166     
    167   G4double deltaCN=fPairCorr->GetPairingCorrection(A, Z);                                     
    168   G4double aCN = theEvapLDPptr->LevelDensityParameter(A, Z, U-deltaCN);
    169   G4double UxCN = (2.5 + 150.0/G4double(A))*MeV;
    170   G4double ExCN = UxCN + deltaCN;
    171   G4double TCN = 1.0/(std::sqrt(aCN/UxCN) - 1.5/UxCN);
    172   //JMQ fixed bug in units
    173   G4double E0CN = ExCN - TCN*(std::log(TCN/MeV) - std::log(aCN*MeV)/4.0 - 1.25*std::log(UxCN/MeV) + 2.0*std::sqrt(aCN*UxCN));
    174 //                       ***end PARENT***
     167  G4double deltaCN = fPairCorr->GetPairingCorrection(A, Z);                                   
     168  G4double aCN     = theEvapLDPptr->LevelDensityParameter(A, Z, U-deltaCN);
     169  G4double UxCN    = (2.5 + 150.0/G4double(A))*MeV;
     170  G4double ExCN    = UxCN + deltaCN;
     171  G4double TCN     = 1.0/(std::sqrt(aCN/UxCN) - 1.5/UxCN);
     172  //                     ***end PARENT***
    175173
    176174  G4double Width;
     
    231229  //end of JMQ fix on Rb by 190709
    232230 
    233 
    234 
    235 //JMQ 160909 fix: initial level density must be calculated according to the
    236 // conditions at the initial compound nucleus
    237 // (it has been removed from previous "if" for the residual)
    238 
    239    if ( U < ExCN )
    240       {
    241         InitialLevelDensity = (pi/12.0)*std::exp((U-E0CN)/TCN)/TCN;
    242       }
    243     else
    244       {
    245         //        InitialLevelDensity = (pi/12.0)*std::exp(2*std::sqrt(aCN*(U-deltaCN)))/std::pow(aCN*std::pow(U-deltaCN,5.0),1.0/4.0);
    246         //VI speedup
    247         G4double x  = U-deltaCN;
    248         G4double x2 = x*x;
    249         G4double x3 = x2*x;
    250         InitialLevelDensity = (pi/12.0)*std::exp(2*std::sqrt(aCN*x))/std::sqrt(std::sqrt(aCN*x2*x3));
    251       }
    252  //
    253 
     231  //JMQ 160909 fix: initial level density must be calculated according to the
     232  // conditions at the initial compound nucleus
     233  // (it has been removed from previous "if" for the residual)
     234
     235  if ( U < ExCN )
     236    {
     237      //JMQ fixed bug in units
     238      //VI moved the computation here
     239      G4double E0CN = ExCN - TCN*(std::log(TCN/MeV) - std::log(aCN*MeV)/4.0
     240                                  - 1.25*std::log(UxCN/MeV) + 2.0*std::sqrt(aCN*UxCN));
     241      InitialLevelDensity = (pi/12.0)*std::exp((U-E0CN)/TCN)/TCN;
     242    }
     243  else
     244    {
     245      //InitialLevelDensity = (pi/12.0)*std::exp(2*std::sqrt(aCN*(U-deltaCN)))/std::pow(aCN*std::pow(U-deltaCN,5.0),1.0/4.0);
     246      //VI speedup
     247      G4double x  = U-deltaCN;
     248      G4double x1 = std::sqrt(aCN*x);
     249      InitialLevelDensity = (pi/12.0)*std::exp(2*x1)/(x*std::sqrt(x1));
     250    }
    254251
    255252  //JMQ 190709 BUG : pi instead of sqrt(pi) must be here according to Furihata's report:
     
    257254  Width *= pi*g*GeometricalXS*Alpha/(12.0*InitialLevelDensity);
    258255   
    259 
    260256  return Width;
    261257}
    262258
    263 /*
    264 
    265 G4double G4GEMProbability::CalcProbability(const G4Fragment & fragment,
    266                                            const G4double MaximalKineticEnergy,
    267                                            const G4double V)
    268 // Calculate integrated probability (width) for evaporation channel
    269 {
    270   G4double ResidualA = static_cast<G4double>(fragment.GetA() - theA);
    271   G4double ResidualZ = static_cast<G4double>(fragment.GetZ() - theZ);
    272   G4double U = fragment.GetExcitationEnergy();
    273  
    274   G4double NuclearMass = G4ParticleTable::GetParticleTable()->
    275     GetIonTable()->GetNucleusMass(theZ,theA);
    276  
    277  
    278   G4double Alpha = CalcAlphaParam(fragment);
    279   G4double Beta = CalcBetaParam(fragment);
    280  
    281  
    282   //                       ***RESIDUAL***
    283   //JMQ (September 2009) the following quantities refer to the RESIDUAL:
    284  
    285   G4double delta0 = G4PairingCorrection::GetInstance()->GetPairingCorrection( static_cast<G4int>( ResidualA ) , static_cast<G4int>( ResidualZ ) ); 
    286  
    287   G4double a = theEvapLDPptr->LevelDensityParameter(static_cast<G4int>(ResidualA),
    288                                                     static_cast<G4int>(ResidualZ),MaximalKineticEnergy+V-delta0);
    289   G4double Ux = (2.5 + 150.0/ResidualA)*MeV;
    290   G4double Ex = Ux + delta0;
    291   G4double T = 1.0/(std::sqrt(a/Ux) - 1.5/Ux);
    292   //JMQ fixed bug in units
    293   G4double E0 = Ex - T*(std::log(T/MeV) - std::log(a*MeV)/4.0 - 1.25*std::log(Ux/MeV) + 2.0*std::sqrt(a*Ux));
    294   //                      ***end RESIDUAL ***
    295  
    296   //                       ***PARENT***
    297   //JMQ (September 2009) the following quantities refer to the PARENT:
    298      
    299   G4double deltaCN=G4PairingCorrection::GetInstance()->
    300     GetPairingCorrection(static_cast<G4int>(fragment.GetA()),static_cast<G4int>(fragment.GetZ()));                                     
    301   G4double aCN = theEvapLDPptr->LevelDensityParameter(static_cast<G4int>(fragment.GetA()),
    302                                                       static_cast<G4int>(fragment.GetZ()),U-deltaCN);
    303   G4double UxCN = (2.5 + 150.0/fragment.GetA())*MeV;
    304   G4double ExCN = UxCN + deltaCN;
    305   G4double TCN = 1.0/(std::sqrt(aCN/UxCN) - 1.5/UxCN);
    306   //JMQ fixed bug in units
    307   G4double E0CN = ExCN - TCN*(std::log(TCN/MeV) - std::log(aCN*MeV)/4.0 - 1.25*std::log(UxCN/MeV) + 2.0*std::sqrt(aCN*UxCN));
    308 //                       ***end PARENT***
    309 
    310   G4double Width;
    311   G4double InitialLevelDensity;
    312   G4double t = MaximalKineticEnergy/T;
    313   if ( MaximalKineticEnergy < Ex ) {
    314     //JMQ 190709 bug in I1 fixed (T was  missing)
    315     Width = (I1(t,t)*T + (Beta+V)*I0(t))/std::exp(E0/T);
    316 //JMQ 160909 fix:  InitialLevelDensity has been taken away (different conditions for initial CN..)
    317   } else {
    318     G4double tx = Ex/T;
    319     G4double s = 2.0*std::sqrt(a*(MaximalKineticEnergy-delta0));
    320     G4double sx = 2.0*std::sqrt(a*(Ex-delta0));
    321     Width = I1(t,tx)*T/std::exp(E0/T) + I3(s,sx)*std::exp(s)/(std::sqrt(2.0)*a);
    322     // For charged particles (Beta+V) = 0 beacuse Beta = -V
    323     if (theZ == 0) {
    324       Width += (Beta+V)*(I0(tx)/std::exp(E0/T) + 2.0*std::sqrt(2.0)*I2(s,sx)*std::exp(s));
    325     }
    326   }
    327  
    328   //JMQ 14/07/2009 BIG BUG : NuclearMass is in MeV => hbarc instead of hbar_planck must be used
    329   //    G4double g = (2.0*Spin+1.0)*NuclearMass/(pi2* hbar_Planck*hbar_Planck);
    330   G4double g = (2.0*Spin+1.0)*NuclearMass/(pi2* hbarc*hbarc);
    331  
    332   //JMQ 190709 fix on Rb and  geometrical cross sections according to Furihata's paper
    333   //                      (JAERI-Data/Code 2001-105, p6)
    334   //    G4double RN = 0.0;
    335   G4double Rb = 0.0;
    336   if (theA > 4)
    337     {
    338       //        G4double R1 = std::pow(ResidualA,1.0/3.0);
    339       //        G4double R2 = std::pow(G4double(theA),1.0/3.0);
    340       G4double Ad = std::pow(ResidualA,1.0/3.0);
    341       G4double Aj = std::pow(G4double(theA),1.0/3.0);
    342       //        RN = 1.12*(R1 + R2) - 0.86*((R1+R2)/(R1*R2));
    343       Rb = 1.12*(Aj + Ad) - 0.86*((Aj+Ad)/(Aj*Ad))+2.85;
    344       Rb *= fermi;
    345     }
    346   else if (theA>1)
    347     {
    348       G4double Ad = std::pow(ResidualA,1.0/3.0);
    349       G4double Aj = std::pow(G4double(theA),1.0/3.0);
    350       Rb=1.5*(Aj+Ad)*fermi;
    351     }
    352   else
    353     {
    354       G4double Ad = std::pow(ResidualA,1.0/3.0);
    355       Rb = 1.5*Ad*fermi;
    356     }
    357   //   G4double GeometricalXS = pi*RN*RN*std::pow(ResidualA,2./3.);
    358   G4double GeometricalXS = pi*Rb*Rb;
    359   //end of JMQ fix on Rb by 190709
    360  
    361 
    362 
    363 //JMQ 160909 fix: initial level density must be calculated according to the
    364 // conditions at the initial compound nucleus
    365 // (it has been removed from previous "if" for the residual)
    366 
    367    if ( U < ExCN )
    368       {
    369         InitialLevelDensity = (pi/12.0)*std::exp((U-E0CN)/TCN)/TCN;
    370       }
    371     else
    372       {
    373         InitialLevelDensity = (pi/12.0)*std::exp(2*std::sqrt(aCN*(U-deltaCN)))/std::pow(aCN*std::pow(U-deltaCN,5.0),1.0/4.0);
    374       }
    375  //
    376 
    377 
    378   //JMQ 190709 BUG : pi instead of sqrt(pi) must be here according to Furihata's report:
    379   //    Width *= std::sqrt(pi)*g*GeometricalXS*Alpha/(12.0*InitialLevelDensity);
    380   Width *= pi*g*GeometricalXS*Alpha/(12.0*InitialLevelDensity);
    381    
    382 
    383   return Width;
    384 }
    385 */
    386 
    387 G4double G4GEMProbability::I3(const G4double s, const G4double sx)
     259G4double G4GEMProbability::I3(G4double s, G4double sx)
    388260{
    389261  G4double s2 = s*s;
  • trunk/source/processes/hadronic/models/de_excitation/handler/include/G4ExcitationHandler.hh

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4ExcitationHandler.hh,v 1.12 2010/04/27 14:00:23 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     26// $Id: G4ExcitationHandler.hh,v 1.13 2010/11/17 16:20:31 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2828//
    2929// Hadronic Process: Nuclear De-excitations
     
    5959#include "G4ReactionProductVector.hh"
    6060#include "G4ReactionProduct.hh"
    61 #include "G4ParticleTypes.hh"
    62 #include "G4ParticleTable.hh"
    6361// needed for default models
    6462#include "G4Evaporation.hh"
     
    6664#include "G4FermiBreakUp.hh"
    6765#include "G4PhotonEvaporation.hh"
    68 #include "G4IonConstructor.hh"
     66
     67class G4IonTable;
    6968
    7069class G4ExcitationHandler
     
    141140  G4double minExcitation;
    142141
    143   G4ParticleTable *theTableOfParticles;
     142  G4IonTable* theTableOfIons;
    144143
    145144  G4bool MyOwnEvaporationClass;
  • trunk/source/processes/hadronic/models/de_excitation/handler/src/G4ExcitationHandler.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4ExcitationHandler.cc,v 1.39 2010/05/18 15:46:11 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     26// $Id: G4ExcitationHandler.cc,v 1.40 2010/11/17 16:20:38 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2828//
    2929// Hadronic Process: Nuclear De-excitations
     
    6262#include "G4LorentzVector.hh"
    6363#include "G4NistManager.hh"
     64#include "G4ParticleTable.hh"
     65#include "G4IonTable.hh"
     66#include "G4IonConstructor.hh"
     67#include "G4ParticleTypes.hh"
     68
    6469#include <list>
    6570
     
    7075  maxZForFermiBreakUp(9),maxAForFermiBreakUp(17),minEForMultiFrag(4.0*GeV),
    7176  //  maxZForFermiBreakUp(9),maxAForFermiBreakUp(17),minEForMultiFrag(3.0*MeV),
    72   //maxZForFermiBreakUp(1),maxAForFermiBreakUp(1),minEForMultiFrag(4.0*GeV),
    7377  minExcitation(CLHEP::keV),
    7478  MyOwnEvaporationClass(true), MyOwnMultiFragmentationClass(true),MyOwnFermiBreakUpClass(true),
    7579  MyOwnPhotonEvaporationClass(true),OPTxs(3),useSICB(false)
    7680{                                                                         
    77   theTableOfParticles = G4ParticleTable::GetParticleTable();
     81  theTableOfIons = G4ParticleTable::GetParticleTable()->GetIonTable();
    7882 
    7983  theEvaporation = new G4Evaporation;
     
    335339        theKindOfFragment = G4Alpha::AlphaDefinition();;
    336340      } else {
    337         theKindOfFragment = theTableOfParticles->FindIon(theFragmentZ,theFragmentA,0,theFragmentZ);
     341        theKindOfFragment =
     342          theTableOfIons->GetIon(theFragmentZ,theFragmentA,0.0);
    338343      }
    339344      if (theKindOfFragment != 0)
     
    350355  return theReactionProductVector;
    351356}
    352 
    353 
    354357
    355358G4ReactionProductVector *
     
    399402      theKindOfFragment = theAlpha;
    400403    } else {
    401       theKindOfFragment = theTableOfParticles->FindIon(theFragmentZ,theFragmentA,0,theFragmentZ);
     404      theKindOfFragment =
     405        theTableOfIons->GetIon(theFragmentZ,theFragmentA,0.0);
    402406    }
    403407    if (theKindOfFragment != 0)
     
    407411        theNew->SetTotalEnergy(theFragmentMomentum.e());
    408412        theNew->SetFormationTime((*i)->GetCreationTime());
    409 #ifdef PRECOMPOUND_TEST
    410         theNew->SetCreatorModel((*i)->GetCreatorModel());
    411 #endif
    412413        theReactionProductVector->push_back(theNew);
    413414      }
     
    458459    ProductsEnergy += tmp.e();
    459460    ProductsMomentum += tmp.vect();
    460     ProductsA += static_cast<G4int>((*h)->GetA());
    461     ProductsZ += static_cast<G4int>((*h)->GetZ());
     461    ProductsA += (*h)->GetA_asInt();
     462    ProductsZ += (*h)->GetZ_asInt();
    462463  }
    463464 
    464   if (ProductsA != theInitialState.GetA()) {
     465  if (ProductsA != theInitialState.GetA_asInt()) {
    465466    G4cout << "!!!!!!!!!! Baryonic Number Conservation Violation !!!!!!!!!!" << G4endl;
    466467    G4cout << "G4ExcitationHandler.cc: Barionic Number Conservation test for deexcitation fragments"
    467468           << G4endl;
    468     G4cout << "Initial A = " << theInitialState.GetA()
     469    G4cout << "Initial A = " << theInitialState.GetA_asInt()
    469470           << "   Fragments A = " << ProductsA << "   Diference --> "
    470471           << theInitialState.GetA() - ProductsA << G4endl;
    471472  }
    472   if (ProductsZ != theInitialState.GetZ()) {
     473  if (ProductsZ != theInitialState.GetZ_asInt()) {
    473474    G4cout << "!!!!!!!!!! Charge Conservation Violation !!!!!!!!!!" << G4endl;
    474475    G4cout << "G4ExcitationHandler.cc: Charge Conservation test for deexcitation fragments"
  • trunk/source/processes/hadronic/models/de_excitation/management/include/G4VEvaporationChannel.hh

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VEvaporationChannel.hh,v 1.6 2010/05/11 11:16:04 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     26// $Id: G4VEvaporationChannel.hh,v 1.7 2010/10/29 17:35:04 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2828//
    2929// Hadronic Process: Nuclear De-excitations
     
    5252  virtual ~G4VEvaporationChannel();
    5353
    54 private:
    55 
    56   G4VEvaporationChannel(const G4VEvaporationChannel & right);
    57   const G4VEvaporationChannel & operator=(const G4VEvaporationChannel & right);
    58 
    59 public:
    60 
    61   G4bool operator==(const G4VEvaporationChannel & right) const;
    62   G4bool operator!=(const G4VEvaporationChannel & right) const;
    63 
    6454  virtual void Initialize(const G4Fragment & fragment) = 0;
    6555
     
    7868  virtual G4double GetEmissionProbability(void) const = 0;
    7969
    80   G4String GetName() const {return Name;}
    81   void SetName(const G4String & aName) { Name = aName;}
     70  inline G4String GetName() const {return Name;}
     71  inline void SetName(const G4String & aName) { Name = aName;}
    8272
    8373  // for cross section selection
     
    9484  G4String Name;
    9585
     86  G4VEvaporationChannel(const G4VEvaporationChannel & right);
     87  const G4VEvaporationChannel & operator=(const G4VEvaporationChannel & right);
     88  G4bool operator==(const G4VEvaporationChannel & right) const;
     89  G4bool operator!=(const G4VEvaporationChannel & right) const;
     90
    9691};
    9792
  • trunk/source/processes/hadronic/models/de_excitation/management/src/G4VEvaporationChannel.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VEvaporationChannel.cc,v 1.6 2010/04/25 18:43:08 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     26// $Id: G4VEvaporationChannel.cc,v 1.7 2010/10/29 17:35:04 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2828//
    2929// Hadronic Process: Nuclear De-excitations
     
    3434//                          new virtual methods EmittedFragment(s) to allow more optimal
    3535//                          work with G4Fragment objects; removed unnecesary exceptions
     36// 28.10.2010 V.Ivanchenko defined members in constructor and cleaned up
    3637
    3738#include "G4VEvaporationChannel.hh"
    38 #include "G4HadronicException.hh"
    3939
    4040G4VEvaporationChannel::G4VEvaporationChannel(const G4String & aName)
    41   : Name(aName)
     41  :OPTxs(3),useSICB(false),Name(aName)
    4242{}
    4343
    4444G4VEvaporationChannel::~G4VEvaporationChannel()
    4545{}
    46 
    47 //G4VEvaporationChannel::G4VEvaporationChannel(const G4VEvaporationChannel &)
    48 //{
    49 // throw G4HadronicException(__FILE__, __LINE__, "G4VEvaporationChannel::copy_constructor meant to not be accessable");
    50 //}
    51 //const G4VEvaporationChannel & G4VEvaporationChannel::operator=(const G4VEvaporationChannel &)
    52 //{
    53 //  throw G4HadronicException(__FILE__, __LINE__, "G4VEvaporationChannel::operator= meant to not be accessable");
    54 //  return *this;
    55 //}
    56 
    57 G4bool G4VEvaporationChannel::operator==(const G4VEvaporationChannel &right) const
    58 {
    59   return (this == (G4VEvaporationChannel *) &right);
    60 }
    61 
    62 G4bool G4VEvaporationChannel::operator!=(const G4VEvaporationChannel &right) const
    63 {
    64   return (this != (G4VEvaporationChannel *) &right);
    65 }
    6646
    6747G4Fragment* G4VEvaporationChannel::EmittedFragment(G4Fragment*)
  • trunk/source/processes/hadronic/models/de_excitation/multifragmentation/include/G4StatMFMacroTemperature.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4StatMFMacroTemperature.hh,v 1.4 2010/04/16 17:04:08 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4StatMFMacroTemperature.hh,v 1.5 2010/10/29 17:35:04 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    7171public:
    7272
    73     G4double GetMeanMultiplicity(void) const {return _MeanMultiplicity;}
     73    inline G4double GetMeanMultiplicity(void) const {return _MeanMultiplicity;}
    7474       
    75     G4double GetChemicalPotentialMu(void) const {return _ChemPotentialMu;}
     75    inline G4double GetChemicalPotentialMu(void) const {return _ChemPotentialMu;}
    7676
    77     G4double GetChemicalPotentialNu(void) const {return _ChemPotentialNu;}
     77    inline G4double GetChemicalPotentialNu(void) const {return _ChemPotentialNu;}
    7878
    79     G4double GetTemperature(void) const {return _MeanTemperature;}
     79    inline G4double GetTemperature(void) const {return _MeanTemperature;}
    8080
    81     G4double GetEntropy(void) const {return _MeanEntropy;}
     81    inline G4double GetEntropy(void) const {return _MeanEntropy;}
    8282
    8383    G4double CalcTemperature(void);
  • trunk/source/processes/hadronic/models/de_excitation/multifragmentation/src/G4StatMF.cc

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4StatMF.cc,v 1.6 2008/07/25 11:20:47 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4StatMF.cc,v 1.7 2010/10/29 17:35:04 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    8181
    8282  if (theFragment.GetExcitationEnergy() <= 0.0) {
    83     G4FragmentVector * theResult = new G4FragmentVector;
    84     theResult->push_back(new G4Fragment(theFragment));
     83    //G4FragmentVector * theResult = new G4FragmentVector;
     84    //theResult->push_back(new G4Fragment(theFragment));
    8585    return 0;
    8686  }
  • trunk/source/processes/hadronic/models/de_excitation/multifragmentation/src/G4StatMFMacroTemperature.cc

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4StatMFMacroTemperature.cc,v 1.8 2010/04/16 17:04:08 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4StatMFMacroTemperature.cc,v 1.9 2010/10/29 17:35:04 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    3939//          to protect code from rare unwanted exception; moved constructor
    4040//          and destructor to source 
     41// 28.10.10 V.Ivanchenko defined members in constructor and cleaned up
    4142
    4243#include "G4StatMFMacroTemperature.hh"
     
    5455  _ChemPotentialMu(0.0),
    5556  _ChemPotentialNu(0.0),
     57  _MeanEntropy(0.0),
    5658  _theClusters(ClusterVector)
    57 {}
    58 
    59 G4StatMFMacroTemperature::G4StatMFMacroTemperature()
    6059{}
    6160       
    6261G4StatMFMacroTemperature::~G4StatMFMacroTemperature()
    6362{}
    64 
    65 // operators definitions
    66 G4StatMFMacroTemperature &
    67 G4StatMFMacroTemperature::operator=(const G4StatMFMacroTemperature & )
    68 {
    69     throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMacroTemperature::operator= meant to not be accessable");
    70     return *this;
    71 }
    72 
    73 G4bool G4StatMFMacroTemperature::operator==(const G4StatMFMacroTemperature & ) const
    74 {
    75     throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMacroTemperature::operator== meant to not be accessable");
    76     return false;
    77 }
    78 
    79 
    80 G4bool G4StatMFMacroTemperature::operator!=(const G4StatMFMacroTemperature & ) const
    81 {
    82     throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMacroTemperature::operator!= meant to not be accessable");
    83     return true;
    84 }
    85 
    86 
    8763
    8864
  • trunk/source/processes/hadronic/models/de_excitation/photon_evaporation/include/G4ContinuumGammaDeexcitation.hh

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4ContinuumGammaDeexcitation.hh,v 1.4 2010/04/25 18:43:21 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     26// $Id: G4ContinuumGammaDeexcitation.hh,v 1.5 2010/11/17 19:17:17 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2828//
    2929// -------------------------------------------------------------------
     
    4747//
    4848#ifndef G4ContinuumGammaDeexcitation_hh
    49 #define G4ContinuumGammaDeexcitation_hh
     49#define G4ContinuumGammaDeexcitation_hh 1
    5050
    5151#include "G4VGammaDeexcitation.hh"
  • trunk/source/processes/hadronic/models/de_excitation/photon_evaporation/include/G4ContinuumGammaTransition.hh

    r819 r1347  
    2424// ********************************************************************
    2525//
     26// $Id: G4ContinuumGammaTransition.hh,v 1.3 2010/11/17 19:17:17 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2628//
    2729// -------------------------------------------------------------------
     
    4951
    5052#ifndef G4ContinuumGammaTransition_hh
    51 #define G4ContinuumGammaTransition_hh
     53#define G4ContinuumGammaTransition_hh 1
    5254
    5355#include "globals.hh"
     
    6668
    6769  // Destructor
    68   ~G4ContinuumGammaTransition();
     70  virtual ~G4ContinuumGammaTransition();
    6971
    7072  // Functions
    7173
    72 //--  virtual G4double GammaEnergy();
    73 //--  virtual G4double GetEnergyTo() const;
    74   virtual void SetEnergyFrom(const G4double energy);
     74  //--  virtual G4double GammaEnergy();
     75  //--  virtual G4double GetEnergyTo() const;
     76  virtual void SetEnergyFrom(G4double energy);
    7577  virtual G4double GetGammaEnergy();
    7678  virtual G4double GetGammaCreationTime();
  • trunk/source/processes/hadronic/models/de_excitation/photon_evaporation/include/G4DiscreteGammaDeexcitation.hh

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4DiscreteGammaDeexcitation.hh,v 1.4 2010/04/25 18:43:21 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     26// $Id: G4DiscreteGammaDeexcitation.hh,v 1.5 2010/11/17 19:17:17 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2828//
    2929// -------------------------------------------------------------------
     
    8484  virtual G4bool CanDoTransition();
    8585
    86   void SetICM(G4bool hl) { _icm = hl; };
     86  inline void SetICM(G4bool hl) { _icm = hl; };
    8787
    88   void SetRDM(G4bool hl) { _rdm = hl; };
     88  inline void SetRDM(G4bool hl) { _rdm = hl; };
    8989 
    90   void SetHL(G4double hl) { _max_hl = hl; };
     90  inline void SetHL(G4double hl) { _max_hl = hl; };
    9191
    9292private:
  • trunk/source/processes/hadronic/models/de_excitation/photon_evaporation/include/G4DiscreteGammaTransition.hh

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4DiscreteGammaTransition.hh,v 1.5 2010/10/07 12:31:00 mkelsey Exp $
    27 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     26// $Id: G4DiscreteGammaTransition.hh,v 1.6 2010/11/17 19:17:17 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2828//
    2929// -------------------------------------------------------------------
     
    8181  // Constructor
    8282  G4DiscreteGammaTransition(const G4NuclearLevel& level);
    83 //JMQ 180410
    84 //  G4DiscreteGammaTransition(const G4NuclearLevel& level, G4int Z);
     83  //JMQ 180410
     84  //  G4DiscreteGammaTransition(const G4NuclearLevel& level, G4int Z);
    8585  G4DiscreteGammaTransition(const G4NuclearLevel& level, G4int Z, G4int A);
    8686
    8787  // Destructor
    88   ~G4DiscreteGammaTransition();
     88  virtual ~G4DiscreteGammaTransition();
    8989
    9090  // Functions
     
    9292public:
    9393
    94   virtual void SetEnergyFrom(const G4double energy);
     94  virtual void SetEnergyFrom(G4double energy);
    9595  virtual G4double GetGammaEnergy();
    9696  virtual G4double GetGammaCreationTime();
    9797  virtual void SelectGamma();
    9898
    99   void SetICM(G4bool ic) { _icm = ic;};
    100   G4double GetBondEnergy () {return _bondE;};
    101   G4int GetOrbitNumber () {return _orbitE;};
    102   G4bool IsAGamma() {return _aGamma;};
     99  inline void SetICM(G4bool ic) { _icm = ic;};
     100  inline G4double GetBondEnergy () {return _bondE;};
     101  inline G4int GetOrbitNumber () {return _orbitE;};
     102  inline G4bool IsAGamma() {return _aGamma;};
    103103 
    104104private:
  • trunk/source/processes/hadronic/models/de_excitation/photon_evaporation/include/G4E1Probability.hh

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4E1Probability.hh,v 1.5 2010/05/19 10:21:44 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     26// $Id: G4E1Probability.hh,v 1.6 2010/11/17 17:59:04 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2828//
    2929//---------------------------------------------------------------------
     
    5757  virtual ~G4E1Probability();
    5858
    59   G4double EmissionProbability(const G4Fragment& frag, const G4double excite);
    60   G4double EmissionProbDensity(const G4Fragment& frag, const G4double ePhoton);
     59  G4double EmissionProbability(const G4Fragment& frag, G4double excite);
     60  G4double EmissionProbDensity(const G4Fragment& frag, G4double ePhoton);
    6161
    6262private:
     
    6969
    7070  // Integrator (simple Gaussian quadrature)
    71   G4double EmissionIntegration(const G4Fragment& frag, const G4double excite,
    72                                const G4double lowLim, const G4double upLim,
    73                                const G4int numIters);
     71  G4double EmissionIntegration(const G4Fragment& frag,
     72                               G4double lowLim, G4double upLim);
    7473
    7574  // members
  • trunk/source/processes/hadronic/models/de_excitation/photon_evaporation/include/G4E1SingleProbability1.hh

    r819 r1347  
    2424// ********************************************************************
    2525//
     26// $Id: G4E1SingleProbability1.hh,v 1.3 2010/11/17 16:50:53 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2628//
    2729//
     
    4042public:
    4143
    42   G4E1SingleProbability1() {};
     44  G4E1SingleProbability1();
    4345
    44   ~G4E1SingleProbability1();
     46  virtual ~G4E1SingleProbability1();
    4547
    46   G4double EmissionProbability(const G4Fragment& frag, const G4double excite);
    47   G4double EmissionProbDensity(const G4Fragment& frag, const G4double ePhoton);
     48  G4double EmissionProbability(const G4Fragment& frag, G4double excite);
     49  G4double EmissionProbDensity(const G4Fragment& frag, G4double ePhoton);
    4850
    4951private:
    50 
    51   // G4E1SingleProbability1() {};
    5252
    5353  G4E1SingleProbability1(const G4E1SingleProbability1& right);
     
    5959  // Integrator (simple Gaussian quadrature)
    6060
    61   G4double EmissionIntegration(const G4Fragment& frag, const G4double excite,
    62                                const G4double lowLim, const G4double upLim,
    63                                const G4int numIters);
    64 
    65   // G4VLevelDensityParameter* _levelDensity; // Don't need this
     61  G4double EmissionIntegration(const G4Fragment& frag, G4double excite,
     62                               G4double lowLim, G4double upLim,
     63                               G4int numIters);
    6664
    6765};
  • trunk/source/processes/hadronic/models/de_excitation/photon_evaporation/include/G4NeutronRadCapture.hh

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4NeutronRadCapture.hh,v 1.1 2009/08/31 13:52:42 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     26// $Id: G4NeutronRadCapture.hh,v 1.2 2010/10/29 17:35:04 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2828//
    2929//
     
    4747#include "G4Nucleus.hh"
    4848
    49 class G4ParticleDefinition;
    5049class G4PhotonEvaporation;
    5150
     
    6463
    6564  G4double lowestEnergyLimit;
    66   G4ParticleDefinition* theNeutron;
    6765  G4PhotonEvaporation* photonEvaporation;
    6866};
  • trunk/source/processes/hadronic/models/de_excitation/photon_evaporation/include/G4NuclearLevel.hh

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4NuclearLevel.hh,v 1.4 2010/10/07 07:50:13 mkelsey Exp $
     26// $Id: G4NuclearLevel.hh,v 1.7 2010/11/17 19:17:17 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
     28//
    2729// -------------------------------------------------------------------
    2830//      GEANT 4 class file
     
    5052//              Added half-life, angular momentum, parity, emissioni type
    5153//              reading from experimental data.
     54//
     55//        28 October 2010, V.Ivanchenko moved copy constructor to source, cleanup
     56//
    5257//     
    5358// -------------------------------------------------------------------
    5459
    5560#ifndef G4NUCLEARLEVEL_HH
    56 #define G4NUCLEARLEVEL_HH
     61#define G4NUCLEARLEVEL_HH 1
    5762
    5863#include "globals.hh"
    59 #include "G4NuclearLevel.hh"
    6064#include <vector>
    6165
     
    6468
    6569public:
    66   G4NuclearLevel(const G4double energy, const G4double halfLife,
    67                  const G4double angularMomentum, const std::vector<double>& eGamma,
    68                  const std::vector<double>& wGamma, const std::vector<double>& polarities,
    69                  const std::vector<double>& kCC, const std::vector<double>& l1CC,
    70                  const std::vector<double>& l2CC, const std::vector<double>& l3CC,
    71                  const std::vector<double>& m1CC, const std::vector<double>& m2CC,
    72                  const std::vector<double>& m3CC, const std::vector<double>& m4CC,
    73                  const std::vector<double>& m5CC, const std::vector<double>& nPlusCC,
    74                  const std::vector<double>& totalCC);
     70  G4NuclearLevel(G4double energy, G4double halfLife,
     71                 G4double angularMomentum, const std::vector<G4double>& eGamma,
     72                 const std::vector<G4double>& wGamma, const std::vector<G4double>& polarities,
     73                 const std::vector<G4double>& kCC, const std::vector<G4double>& l1CC,
     74                 const std::vector<G4double>& l2CC, const std::vector<G4double>& l3CC,
     75                 const std::vector<G4double>& m1CC, const std::vector<G4double>& m2CC,
     76                 const std::vector<G4double>& m3CC, const std::vector<G4double>& m4CC,
     77                 const std::vector<G4double>& m5CC, const std::vector<G4double>& nPlusCC,
     78                 const std::vector<G4double>& totalCC);
    7579
    7680  ~G4NuclearLevel();
    7781
    78   const std::vector<double>& GammaEnergies() const;
     82  const std::vector<G4double>& GammaEnergies() const;
    7983 
    80   const std::vector<double>& GammaWeights() const;
     84  const std::vector<G4double>& GammaWeights() const;
    8185
    82   const std::vector<double>& GammaProbabilities() const;
     86  const std::vector<G4double>& GammaProbabilities() const;
    8387
    84   const std::vector<double>& GammaCumulativeProbabilities() const;
     88  const std::vector<G4double>& GammaCumulativeProbabilities() const;
    8589
    86   const std::vector<double>& GammaPolarities() const;
     90  const std::vector<G4double>& GammaPolarities() const;
    8791
    88   const std::vector<double>& KConvertionProbabilities() const;
     92  const std::vector<G4double>& KConvertionProbabilities() const;
    8993
    90   const std::vector<double>& L1ConvertionProbabilities() const;
     94  const std::vector<G4double>& L1ConvertionProbabilities() const;
    9195
    92   const std::vector<double>& L2ConvertionProbabilities() const;
     96  const std::vector<G4double>& L2ConvertionProbabilities() const;
    9397
    94   const std::vector<double>& L3ConvertionProbabilities() const;
     98  const std::vector<G4double>& L3ConvertionProbabilities() const;
    9599
    96   const std::vector<double>& M1ConvertionProbabilities() const;
     100  const std::vector<G4double>& M1ConvertionProbabilities() const;
    97101
    98   const std::vector<double>& M2ConvertionProbabilities() const;
     102  const std::vector<G4double>& M2ConvertionProbabilities() const;
    99103
    100   const std::vector<double>& M3ConvertionProbabilities() const;
     104  const std::vector<G4double>& M3ConvertionProbabilities() const;
    101105
    102   const std::vector<double>& M4ConvertionProbabilities() const;
     106  const std::vector<G4double>& M4ConvertionProbabilities() const;
    103107
    104   const std::vector<double>& M5ConvertionProbabilities() const;
     108  const std::vector<G4double>& M5ConvertionProbabilities() const;
    105109
    106   const std::vector<double>& NPlusConvertionProbabilities() const;
     110  const std::vector<G4double>& NPlusConvertionProbabilities() const;
    107111
    108   const std::vector<double>& TotalConvertionProbabilities() const;
     112  const std::vector<G4double>& TotalConvertionProbabilities() const;
    109113
    110114  G4double Energy() const;
     
    121125  G4bool operator!=(const G4NuclearLevel &right) const;
    122126  G4bool operator<(const G4NuclearLevel &right) const;
     127  const G4NuclearLevel& operator=(const G4NuclearLevel &right);
    123128
    124     const G4NuclearLevel& operator=(const G4NuclearLevel &right)
    125     {
    126       if(this != &right)
    127       {
    128       _energies = right._energies;
    129       _weights =right._weights;
    130       _prob =right._prob;
    131       _cumProb =right._cumProb;
    132       _polarities =right._polarities;
    133       _kCC = right._kCC;
    134       _l1CC =right._l1CC;
    135       _l2CC =right._l2CC;
    136       _l3CC =right._l3CC;
    137       _m1CC = right._m1CC;
    138       _m2CC = right._m2CC;
    139       _m3CC = right._m3CC;
    140       _m4CC = right._m4CC;
    141       _m5CC = right._m5CC;
    142       _nPlusCC = right._nPlusCC;
    143       _totalCC = right._totalCC;
    144       _energy = right._energy;
    145       _halfLife = right._halfLife;
    146       _angularMomentum = right._angularMomentum;
    147       _nGammas = right._nGammas;
    148       }
    149       return *this;
    150     }
    151 
    152     G4NuclearLevel(const G4NuclearLevel &right)
    153     {
    154       if(this != &right) *this = right;
    155 //      G4cout << "####### Incrementing "<<Increment(1)<<G4endl;
    156     }
    157 
    158 protected:
     129  G4NuclearLevel(const G4NuclearLevel &right);
    159130
    160131private: 
     132
    161133  friend class G4NuclearLevelManager;
    162134
    163135  G4NuclearLevel();
    164136
    165   G4NuclearLevel(const G4double energy, const G4double halfLife,
    166                  const G4double angularMomentum);
     137  G4NuclearLevel(G4double energy, G4double halfLife,
     138                 G4double angularMomentum);
    167139
    168140  void Finalize();
     
    173145  G4int Increment(G4int aF);
    174146 
    175   std::vector<double> _energies;
    176   std::vector<double> _weights;
    177   std::vector<double> _prob;
    178   std::vector<double> _cumProb;
    179   std::vector<double> _polarities;
    180   std::vector<double> _kCC;
    181   std::vector<double> _l1CC; 
    182   std::vector<double> _l2CC; 
    183   std::vector<double> _l3CC; 
    184   std::vector<double> _m1CC; 
    185   std::vector<double> _m2CC; 
    186   std::vector<double> _m3CC; 
    187   std::vector<double> _m4CC; 
    188   std::vector<double> _m5CC; 
    189   std::vector<double> _nPlusCC; 
    190   std::vector<double> _totalCC; 
     147  std::vector<G4double> _energies;
     148  std::vector<G4double> _weights;
     149  std::vector<G4double> _prob;
     150  std::vector<G4double> _cumProb;
     151  std::vector<G4double> _polarities;
     152  std::vector<G4double> _kCC;
     153  std::vector<G4double> _l1CC; 
     154  std::vector<G4double> _l2CC; 
     155  std::vector<G4double> _l3CC; 
     156  std::vector<G4double> _m1CC; 
     157  std::vector<G4double> _m2CC; 
     158  std::vector<G4double> _m3CC; 
     159  std::vector<G4double> _m4CC; 
     160  std::vector<G4double> _m5CC; 
     161  std::vector<G4double> _nPlusCC; 
     162  std::vector<G4double> _totalCC; 
    191163
    192164  G4double _energy;
     
    203175
    204176
    205 
    206 
    207 
    208 
    209 
    210 
    211 
    212 
    213 
    214 
    215 
    216 
    217 
    218 
  • trunk/source/processes/hadronic/models/de_excitation/photon_evaporation/include/G4NuclearLevelManager.hh

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4NuclearLevelManager.hh,v 1.5 2010/10/10 23:01:39 mkelsey Exp $
     26// $Id: G4NuclearLevelManager.hh,v 1.6 2010/11/17 16:50:53 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
     28//
    2729// -------------------------------------------------------------------
    2830//      GEANT 4 class file
     
    5153
    5254#ifndef G4NUCLEARLEVELMANAGER_HH
    53 #define G4NUCLEARLEVELMANAGER_HH
     55#define G4NUCLEARLEVELMANAGER_HH 1
    5456
    5557#include "globals.hh"
     
    6668
    6769  G4NuclearLevelManager();
    68   G4NuclearLevelManager(const G4int Z, const G4int A, const G4String& filename);
     70  G4NuclearLevelManager(G4int Z, G4int A, const G4String& filename);
    6971  G4NuclearLevelManager(const G4NuclearLevelManager & right); 
    7072
    7173  ~G4NuclearLevelManager();
    7274 
    73   void SetNucleus(const G4int Z, const G4int A, const G4String& filename);
     75  void SetNucleus(G4int Z, G4int A, const G4String& filename);
    7476
    75   G4bool IsValid() const { return _validity; }
     77  inline G4bool IsValid() const { return _validity; }
    7678
    77   G4int NumberOfLevels() const { return (_levels ? _levels->size() : 0); }
     79  inline G4int NumberOfLevels() const { return (_levels ? _levels->size() : 0); }
    7880
    7981  const G4NuclearLevel* GetLevel(G4int i) const;
    8082
    81   const G4NuclearLevel* NearestLevel(const G4double energy,
    82                                      const G4double eDiffMax=9999.*GeV) const;
     83  const G4NuclearLevel* NearestLevel(G4double energy,
     84                                     G4double eDiffMax=9999.*GeV) const;
    8385
    8486  const G4NuclearLevel* LowestLevel() const;
  • trunk/source/processes/hadronic/models/de_excitation/photon_evaporation/include/G4NuclearLevelStore.hh

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4NuclearLevelStore.hh,v 1.3 2010/10/07 07:50:13 mkelsey Exp $
     26// $Id: G4NuclearLevelStore.hh,v 1.4 2010/11/17 16:50:53 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2728//
    28 // 20101004  M. Kelsey -- Replace G4String keys with integers (ZZZAAA),
    29 //              move string operation to GenerateFilename()
     29// 04-10-2010  M. Kelsey -- Replace G4String keys with integers (ZZZAAA),
     30//                          move string operation to GenerateFilename()
     31// 17-11-2010 V. Ivanchenko - make as a classical singleton.
    3032
    3133#ifndef G4NuclearLevelStore_hh
     
    4244
    4345public:
     46
    4447  static G4NuclearLevelStore* GetInstance();
    4548
    46   G4NuclearLevelManager* GetManager(const G4int Z, const G4int A);
     49  G4NuclearLevelManager* GetManager(G4int Z, G4int A);
    4750  ~G4NuclearLevelStore();
    4851
    4952private:
    50   G4int GenerateKey(const G4int Z, const G4int A) const { return Z*1000+A; }
     53  G4int GenerateKey(G4int Z, G4int A) const { return Z*1000+A; }
    5154
    52   G4String GenerateFilename(const G4int Z, const G4int A) const;
     55  G4String GenerateFilename(G4int Z, G4int A) const;
    5356
    5457  typedef std::map<G4int,G4NuclearLevelManager*> ManagersMap;
     
    5659  ManagersMap theManagers;
    5760  G4String dirName;
     61
     62  static G4NuclearLevelStore* theInstance;
    5863};
    5964#endif
  • trunk/source/processes/hadronic/models/de_excitation/photon_evaporation/include/G4PhotonEvaporation.hh

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PhotonEvaporation.hh,v 1.7 2010/05/11 11:22:14 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     26// $Id: G4PhotonEvaporation.hh,v 1.8 2010/11/17 16:50:53 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2828//
    2929// -------------------------------------------------------------------
     
    6363
    6464#ifndef G4PHOTONEVAPORATION_HH
    65 #define G4PHOTONEVAPORATION_HH
     65#define G4PHOTONEVAPORATION_HH 1
    6666
    6767#include "globals.hh"
  • trunk/source/processes/hadronic/models/de_excitation/photon_evaporation/include/G4PtrLevelVector.hh

    r819 r1347  
    2424// ********************************************************************
    2525//
     26// $Id: G4PtrLevelVector.hh,v 1.3 2010/11/17 16:50:53 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2628//
    2729// -------------------------------------------------------------------
     
    4042// -------------------------------------------------------------------
    4143
    42 
    43 
    4444#ifndef G4PTRLEVELVECTOR_HH
    45 #define G4PTRLEVELVECTOR_HH
     45#define G4PTRLEVELVECTOR_HH 1
    4646
    4747#include "G4NuclearLevel.hh"
  • trunk/source/processes/hadronic/models/de_excitation/photon_evaporation/include/G4RandGeneralTmp.hh

    r819 r1347  
    2424// ********************************************************************
    2525//
     26// $Id: G4RandGeneralTmp.hh,v 1.5 2010/11/17 16:50:53 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
     28//
    2629// -----------------------------------------------------------------------
    2730
  • trunk/source/processes/hadronic/models/de_excitation/photon_evaporation/include/G4VGammaDeexcitation.hh

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VGammaDeexcitation.hh,v 1.8 2010/04/28 14:22:40 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     26// $Id: G4VGammaDeexcitation.hh,v 1.9 2010/11/17 16:50:53 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2828//
    2929// -------------------------------------------------------------------
     
    6363
    6464#ifndef G4VGAMMADEEXCITATION_HH
    65 #define G4VGAMMADEEXCITATION_HH
     65#define G4VGAMMADEEXCITATION_HH 1
    6666
    6767#include "globals.hh"
     
    9898  inline void Initialize();
    9999
    100   void SetEO(G4ElectronOccupancy eo) { _electronO = eo; };
    101   void SetVaccantSN( G4int val ) { _vSN = val;};
     100  inline void SetEO(G4ElectronOccupancy eo) { _electronO = eo; };
     101  inline void SetVaccantSN( G4int val ) { _vSN = val;};
    102102 
    103   G4ElectronOccupancy GetEO() { return _electronO; };   
    104   G4int GetVacantSN() {return _vSN;};
     103  inline G4ElectronOccupancy GetEO() { return _electronO; };   
     104  inline G4int GetVacantSN() {return _vSN;};
    105105
    106106protected:
  • trunk/source/processes/hadronic/models/de_excitation/photon_evaporation/include/G4VGammaTransition.hh

    r819 r1347  
    2424// ********************************************************************
    2525//
     26// $Id: G4VGammaTransition.hh,v 1.6 2010/11/17 19:17:17 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2628//
    2729// -------------------------------------------------------------------
     
    3840//      Modifications:
    3941//
    40 //        15 April 1999, Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
    41 //              Added creation time evaluation for products of evaporation
     42// 15.04.1999, Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
     43//             Added creation time evaluation for products of evaporation
     44// 30.10.2010  V.Ivanchenko moved constructor and destructor to the source
    4245//     
    4346// -------------------------------------------------------------------
    4447
    4548#ifndef G4VGAMMATRANSITION_HH
    46 #define G4VGAMMATRANSITION_HH
     49#define G4VGAMMATRANSITION_HH 1
    4750
    4851#include "globals.hh"
     
    5255public:
    5356
    54   G4VGammaTransition() {};
     57  G4VGammaTransition();
    5558
    56   virtual ~G4VGammaTransition() {};
     59  virtual ~G4VGammaTransition();
    5760 
    5861  virtual void SelectGamma() = 0;
     
    6063  virtual G4double GetGammaCreationTime() = 0;
    6164
    62   virtual void SetEnergyFrom(const G4double energy) = 0;
     65  virtual void SetEnergyFrom(G4double energy) = 0;
    6366
    6467private: 
  • trunk/source/processes/hadronic/models/de_excitation/photon_evaporation/include/G4VPhotonEvaporation.hh

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VPhotonEvaporation.hh,v 1.3 2010/04/25 18:43:21 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     26// $Id: G4VPhotonEvaporation.hh,v 1.4 2010/11/17 16:50:53 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2828//
    2929// -------------------------------------------------------------------
     
    3939//
    4040//      Modifications:
     41//
     42// 17-11-2010 V.Ivanchenko moved constructor an ddestructor to the source
    4143//     
    4244// -------------------------------------------------------------------
    4345
    4446#ifndef G4VPHOTONEVAPORATION_HH
    45 #define G4VPHOTONEVAPORATION_HH
     47#define G4VPHOTONEVAPORATION_HH 1
    4648
    4749#include "globals.hh"
     
    5254public:
    5355
    54   G4VPhotonEvaporation() {};
    55   virtual ~G4VPhotonEvaporation() {};
    56  
    57   G4bool operator==(const G4VPhotonEvaporation &right) const;
    58   G4bool operator!=(const G4VPhotonEvaporation &right) const;
    59  
     56  G4VPhotonEvaporation();
     57  virtual ~G4VPhotonEvaporation();
     58   
    6059  virtual G4FragmentVector* BreakItUp(const G4Fragment &theNucleus) = 0;
    6160 
     
    6362
    6463  G4VPhotonEvaporation(const G4VPhotonEvaporation &right);
    65     const G4VPhotonEvaporation& operator=(const G4VPhotonEvaporation &right);
     64  const G4VPhotonEvaporation& operator=(const G4VPhotonEvaporation &right);
     65
     66  G4bool operator==(const G4VPhotonEvaporation &right) const;
     67  G4bool operator!=(const G4VPhotonEvaporation &right) const;
    6668
    6769};
  • trunk/source/processes/hadronic/models/de_excitation/photon_evaporation/src/G4ContinuumGammaDeexcitation.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4ContinuumGammaDeexcitation.cc,v 1.7 2010/04/30 16:08:03 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     26// $Id: G4ContinuumGammaDeexcitation.cc,v 1.8 2010/11/17 19:17:17 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2828//
    2929// -------------------------------------------------------------------
     
    6767G4ContinuumGammaDeexcitation::G4ContinuumGammaDeexcitation()
    6868  : _nucleusZ(0), _nucleusA(0), _levelManager(0)
    69 { }
    70 
     69{}
    7170
    7271G4ContinuumGammaDeexcitation::~G4ContinuumGammaDeexcitation()
    73 { }
    74 
     72{}
    7573
    7674G4VGammaTransition* G4ContinuumGammaDeexcitation::CreateTransition()
    7775{
    7876  G4Fragment* nucleus = GetNucleus();
    79   G4int Z = static_cast<G4int>(nucleus->GetZ());
    80   G4int A = static_cast<G4int>(nucleus->GetA());
     77  G4int Z = nucleus->GetZ_asInt();
     78  G4int A = nucleus->GetA_asInt();
    8179  G4double excitation = nucleus->GetExcitationEnergy();
    8280
     
    9189    G4cout << "G4ContinuumGammaDeexcitation::CreateTransition - Created" << G4endl;
    9290  }
    93   G4VGammaTransition* gt =  new G4ContinuumGammaTransition(_levelManager,Z,A,excitation,_verbose );
     91  G4VGammaTransition* gt = 
     92    new G4ContinuumGammaTransition(_levelManager,Z,A,excitation,_verbose );
    9493
    9594  return gt;
     
    9998G4bool G4ContinuumGammaDeexcitation::CanDoTransition()
    10099{
    101   //JMQ: far too small, creating sometimes continuum gammas instead of the right discrete ones
    102   // (when excitation energy is slightly over maximum discrete  energy): changed
     100  //JMQ: far too small, creating sometimes continuum gammas instead
     101  //     of the right discrete ones (when excitation energy is slightly
     102  //     over maximum discrete  energy): changed
    103103  //  G4double tolerance = 10*eV;
    104104  const G4double tolerance = CLHEP::keV;
     
    116116  G4double excitation = nucleus->GetExcitationEnergy();
    117117
    118   //  G4int A = (G4int)nucleus->GetA();
    119   // G4int Z = (G4int)nucleus->GetZ();
    120   if (_nucleusA<2 || _nucleusZ<3)
     118  if (_nucleusZ < 2 || _nucleusA < 3)
    121119    {
    122120      if (_verbose > 1) {
  • trunk/source/processes/hadronic/models/de_excitation/photon_evaporation/src/G4ContinuumGammaTransition.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4ContinuumGammaTransition.cc,v 1.4 2010/10/07 07:50:13 mkelsey Exp $
     26// $Id: G4ContinuumGammaTransition.cc,v 1.5 2010/11/17 19:17:17 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
     28//
    2729// -------------------------------------------------------------------
    2830//      GEANT 4 class file
     
    4143//        15 April 1999, Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
    4244//              Added creation time evaluation for products of evaporation
    43 //        02 May 2003,   Vladimir Ivanchenko change interface to G4NuclearlevelManager
    44 //        06 Oct 2010, M. Kelsey -- follow changes to G4NuclearLevelManager
    45 // -------------------------------------------------------------------
     45//        02 May 2003,   V. Ivanchenko change interface to G4NuclearlevelManager
     46//        06 Oct 2010,   M. Kelsey -- follow changes to G4NuclearLevelManager
     47//        17 Nov 2010,   V. Ivanchenko use exponential law for sampling of time
     48//                                     and extra cleanup
     49// ----------------------------------------------------------------------------
    4650//
    4751//  Class G4ContinuumGammaTransition.cc
     
    5256#include "G4ConstantLevelDensityParameter.hh"
    5357#include "G4RandGeneralTmp.hh"
     58#include "Randomize.hh"
     59#include "G4Pow.hh"
     60
    5461//
    5562// Constructor
     
    8390  _eMin = 0.001 * MeV;
    8491  // Giant Dipole Resonance energy
    85   G4double energyGDR = (40.3 / std::pow(G4double(_nucleusA),0.2) ) * MeV;
     92  G4double energyGDR = (40.3 / G4Pow::GetInstance()->powZ(_nucleusA,0.2) ) * MeV;
    8693  // Giant Dipole Resonance width
    8794  G4double widthGDR = 0.30 * energyGDR;
     
    97104//
    98105
    99 G4ContinuumGammaTransition::~G4ContinuumGammaTransition() {}
    100 
    101 //
    102 // Override GammaEnergy function from G4VGammaTransition
    103 //
     106G4ContinuumGammaTransition::~G4ContinuumGammaTransition()
     107{}
    104108
    105109void G4ContinuumGammaTransition::SelectGamma()
     
    127131  G4double finalExcitation = _excitation - _eGamma;
    128132 
    129   if(_verbose > 10)
     133  if(_verbose > 10) {
    130134    G4cout << "*---*---* G4ContinuumTransition: eGamma = " << _eGamma
    131135           << "   finalExcitation = " << finalExcitation
    132136           << " random = " << random << G4endl;
    133 
    134 //  if (finalExcitation < 0)
     137  }
     138  //  if (finalExcitation < 0)
    135139  if(finalExcitation < _minLevelE/2.)
    136140    {
     
    148152  _gammaCreationTime = GammaTime();
    149153
    150   if(_verbose > 10)
     154  if(_verbose > 10) {
    151155    G4cout << "*---*---* G4ContinuumTransition: _gammaCreationTime = "
    152156           << _gammaCreationTime/second << G4endl;
    153 
     157  }
    154158  return; 
    155159}
     
    166170
    167171
    168 void G4ContinuumGammaTransition::SetEnergyFrom(const G4double energy)
    169 {
    170 
     172void G4ContinuumGammaTransition::SetEnergyFrom(G4double energy)
     173{
    171174  if (energy > 0.) _excitation = energy;
    172   return; 
    173 
    174175}
    175176
     
    178179{
    179180  G4double theProb = 0.0;
    180 
    181   if( (_excitation - e) < 0.0 || e < 0 || _excitation < 0) return theProb;
     181  G4double U = std::max(0.0, _excitation - e);
     182
     183  if(e < 0.0 || _excitation < 0.0) { return theProb; }
    182184
    183185  G4ConstantLevelDensityParameter ldPar;
    184   G4double aLevelDensityParam = ldPar.LevelDensityParameter(_nucleusA,_nucleusZ,_excitation);
    185 
    186   G4double levelDensBef = std::exp(2.0*std::sqrt(aLevelDensityParam*_excitation));
    187   G4double levelDensAft = std::exp(2.0*std::sqrt(aLevelDensityParam*(_excitation - e)));
    188 
    189   if(_verbose > 20)
    190     G4cout << _nucleusA << " LevelDensityParameter = " <<  aLevelDensityParam
    191            << " Bef Aft " << levelDensBef << " " << levelDensAft << G4endl;
     186  G4double aLevelDensityParam =
     187    ldPar.LevelDensityParameter(_nucleusA,_nucleusZ,_excitation);
     188
     189  //G4double levelDensBef = std::exp(2.0*std::sqrt(aLevelDensityParam*_excitation));
     190  //G4double levelDensAft = std::exp(2.0*std::sqrt(aLevelDensityParam*(_excitation - e)));
     191  G4double coeff = std::exp(2.0*(std::sqrt(aLevelDensityParam*U)
     192                                 - std::sqrt(aLevelDensityParam*_excitation)));
     193
     194  //if(_verbose > 20)
     195  //  G4cout << _nucleusA << " LevelDensityParameter = " <<  aLevelDensityParam
     196  //       << " Bef Aft " << levelDensBef << " " << levelDensAft << G4endl;
    192197 
    193198  // Now form the probability density
     
    199204  G4double sigma0 = 2.5 * _nucleusA; 
    200205
    201   G4double Egdp = (40.3 / std::pow(G4double(_nucleusA),0.2) )*MeV;
     206  G4double Egdp = (40.3 /G4Pow::GetInstance()->powZ(_nucleusA,0.2) )*MeV;
    202207  G4double GammaR = 0.30 * Egdp;
    203208 
    204   G4double normC = 1.0 / (pi * hbarc)*(pi * hbarc);
     209  const G4double normC = 1.0 / (pi * hbarc)*(pi * hbarc);
    205210
    206211  G4double numerator = sigma0 * e*e * GammaR*GammaR;
     
    210215  G4double sigmaAbs = numerator/denominator ;
    211216
    212   if(_verbose > 20)
     217  if(_verbose > 20) {
    213218    G4cout << ".. " << Egdp << " .. " << GammaR
    214219           << " .. " << normC << " .. " << sigmaAbs 
    215            << " .. " << e*e << " .. " << levelDensAft/levelDensBef
     220           << " .. " << e*e << " .. " << coeff
    216221           << G4endl;
     222  }
    217223
    218224  //  theProb = normC * sigmaAbs * e*e * levelDensAft/levelDensBef;
    219   theProb =  sigmaAbs * e*e * levelDensAft/levelDensBef;
     225  theProb =  sigmaAbs * e*e * coeff;
    220226
    221227  return theProb;
     
    226232{
    227233
    228   G4double GammaR = 0.30 * (40.3 / std::pow(G4double(_nucleusA),0.2) )*MeV;
     234  G4double GammaR = 0.30 * (40.3 /G4Pow::GetInstance()->powZ(_nucleusA,0.2) )*MeV;
    229235  G4double tau = hbar_Planck/GammaR;
    230 
     236  G4double creationTime = -tau*std::log(G4UniformRand());
     237  /*
    231238  G4double tMin = 0;
    232239  G4double tMax = 10.0 * tau;
     
    234241  G4double sampleArray[200];
    235242
    236   for(G4int i = 0;i<nBins;i++)
     243  for(G4int i = 0; i<nBins;i++)
    237244  {
    238245    G4double t = tMin + ((tMax-tMin)/nBins)*i;
     
    244251 
    245252  G4double creationTime = tMin + (tMax - tMin) * random;
    246 
     253  */
    247254  return creationTime;
    248255}
  • trunk/source/processes/hadronic/models/de_excitation/photon_evaporation/src/G4DiscreteGammaDeexcitation.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4DiscreteGammaDeexcitation.cc,v 1.15 2010/05/10 07:20:40 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     26// $Id: G4DiscreteGammaDeexcitation.cc,v 1.17 2010/11/17 19:17:17 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2828//
    2929// -------------------------------------------------------------------
     
    7676{
    7777  G4Fragment* nucleus = GetNucleus();
    78   G4int A = static_cast<G4int>(nucleus->GetA());
    79   G4int Z = static_cast<G4int>(nucleus->GetZ());
     78  G4int A = nucleus->GetA_asInt();
     79  G4int Z = nucleus->GetZ_asInt();
    8080  //  _verbose =2;
    8181  //  G4cout << "G4DiscreteGammaDeexcitation::CreateTransition: " << nucleus << G4endl;
     
    163163      }
    164164    } else {
    165       if (excitation > _levelManager->MaxLevelEnergy() + _tolerance) canDo = false;
     165      if (excitation > _levelManager->MaxLevelEnergy() + _tolerance) { canDo = false; }
    166166      //if (excitation < _levelManager->MinLevelEnergy() - _tolerance) canDo = false; 
    167167      // The following is a protection to avoid looping in case of elements with very low
     
    180180  if (canDo) {
    181181    const G4NuclearLevel* level = _levelManager->NearestLevel(excitation); 
    182     if (level != 0) { 
    183       if (level->HalfLife() > _max_hl && !_rdm ) canDo = false;
     182    if (!level) {
     183      canDo = false;
     184 
    184185    } else {
    185       canDo = false;
    186     }
    187     if (_verbose > 0) {
    188       G4cout << "G4DiscreteGammaDeexcitation::CanDoTransition -  Halflife "
    189              << level->HalfLife() << ", Calling from RDM "
    190              << (_rdm ? " True " : " False ")  << ", Max-HL = " <<  _max_hl << G4endl;
     186      if (level->HalfLife() > _max_hl && !_rdm ) { canDo = false; }
     187     
     188      if (_verbose > 0) {
     189        G4cout << "G4DiscreteGammaDeexcitation::CanDoTransition -  Halflife "
     190               << level->HalfLife() << ", Calling from RDM "
     191               << (_rdm ? " True " : " False ")  << ", Max-HL = " <<  _max_hl
     192               << G4endl;
     193      }
    191194    }
    192195  }
    193196  if (_verbose > 0) {
    194     G4cout <<"G4DiscreteGammaDeexcitation::CanDoTransition - CanDo:"
     197    G4cout <<"G4DiscreteGammaDeexcitation::CanDoTransition - CanDo: "
    195198           <<  (canDo ? " True " : " False ")  << G4endl;
    196199  }
  • trunk/source/processes/hadronic/models/de_excitation/photon_evaporation/src/G4DiscreteGammaTransition.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
     26// $Id: G4DiscreteGammaTransition.cc,v 1.12 2010/11/17 19:17:17 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2628//
    2729// -------------------------------------------------------------------
     
    7072G4DiscreteGammaTransition::G4DiscreteGammaTransition(const G4NuclearLevel& level):
    7173  _gammaEnergy(0.), _level(level), _excitation(0.), _gammaCreationTime(0.)
    72 { }
     74{
     75  _levelManager = 0;
     76}
    7377
    7478//JMQ: now A is also needed in the constructor
     
    7882  _level(level), _excitation(0.),  _gammaCreationTime(0.),_A(A),_Z(Z)
    7983{
     84  _levelManager = 0;
    8085  _verbose = 0;
    8186  //JMQ: added tolerence in the mismatch
     
    250255}
    251256
    252 void G4DiscreteGammaTransition::SetEnergyFrom(const G4double energy)
     257void G4DiscreteGammaTransition::SetEnergyFrom(G4double energy)
    253258{
    254259  _excitation = energy;
  • trunk/source/processes/hadronic/models/de_excitation/photon_evaporation/src/G4E1Probability.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4E1Probability.cc,v 1.9 2010/05/25 10:47:24 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     26// $Id: G4E1Probability.cc,v 1.11 2010/11/23 18:05:07 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2928//
    3029//---------------------------------------------------------------------
     
    3736// 18.05.2010 V.Ivanchenko trying to speedup the most slow method
    3837//            by usage of G4Pow, integer A and introduction of const members
    39 //
     38// 17.11.2010 V.Ivanchenko perform general cleanup and simplification
     39//            of integration method; low-limit of integration is defined
     40//            by gamma energy or is zero (was always zero before)
    4041//
    4142
    4243#include "G4E1Probability.hh"
    43 //#include "G4ConstantLevelDensityParameter.hh"
    4444#include "Randomize.hh"
    4545#include "G4Pow.hh"
     
    6363
    6464G4double G4E1Probability::EmissionProbDensity(const G4Fragment& frag,
    65                                               const G4double gammaE)
     65                                              G4double gammaE)
    6666{
    6767
     
    7777  G4int Afrag = frag.GetA_asInt();
    7878  G4double Uexcite = frag.GetExcitationEnergy();
     79  G4double U = std::max(0.0,Uexcite-gammaE);
    7980
    80   if( (Uexcite-gammaE) < 0.0 || gammaE < 0) { return theProb; }
     81  if(gammaE < 0.0) { return theProb; }
    8182
    8283  // Need a level density parameter.
     
    8990  //  G4double levelDensAft = std::exp(2*std::sqrt(aLevelDensityParam*(Uexcite-gammaE)));
    9091  // VI reduce number of calls to exp
    91   G4double levelDens = 1.0;
    92   if( aLevelDensityParam > 0.0 ) {
    93     levelDens = std::exp(2*(std::sqrt(aLevelDensityParam*(Uexcite-gammaE))
    94       - std::sqrt(aLevelDensityParam*Uexcite)));
    95   }
     92  G4double levelDens =
     93    std::exp(2*(std::sqrt(aLevelDensityParam*U)-std::sqrt(aLevelDensityParam*Uexcite)));
    9694  // Now form the probability density
    9795
     
    140138
    141139G4double G4E1Probability::EmissionProbability(const G4Fragment& frag,
    142                                                  const G4double gammaE)
     140                                              G4double gammaE)
    143141{
    144 
    145142  // From nuclear fragment properties and the excitation energy, calculate
    146143  // the probability for photon evaporation down to last ground level.
    147144  // fragment = nuclear fragment BEFORE de-excitation
    148145
    149   G4double theProb = 0.0;
     146  G4double upperLim = gammaE;
     147  G4double lowerLim = 0.0;
    150148
    151   G4double Uafter = 0.0;
    152   const G4double Uexcite = frag.GetExcitationEnergy();
    153 
    154   G4double normC = 3.0;
    155 
    156   const G4double upperLim = Uexcite;
    157   const G4double lowerLim = Uafter;
    158   const G4int numIters = 100;
    159 
    160   // Fall-back is a uniform random number
    161 
    162   //G4double uniformNum = G4UniformRand();
    163   //theProb = uniformNum;
     149  //G4cout << "G4E1Probability::EmissionProbability:  Emin= " << lowerLim
     150  //     << " Emax= " << upperLim << G4endl;
     151  if( upperLim - lowerLim <= CLHEP::keV ) { return 0.0; }
    164152
    165153  // Need to integrate EmissionProbDensity from lowerLim to upperLim
    166   // and multiply by normC
     154  // and multiply by factor 3 (?!)
    167155
    168   G4double integ = normC *
    169            EmissionIntegration(frag,gammaE,lowerLim,upperLim,numIters);
    170   if(integ > 0.0) theProb = integ/(upperLim-lowerLim);
     156  G4double integ = 3.0 * EmissionIntegration(frag,lowerLim,upperLim);
    171157
    172   return theProb;
     158  return integ;
    173159
    174160}
    175161
    176162G4double G4E1Probability::EmissionIntegration(const G4Fragment& frag,
    177                              const G4double ,
    178                              const G4double lowLim, const G4double upLim,
    179                              const G4int numIters)
     163                                              G4double lowLim, G4double upLim)
    180164
    181165{
     166  // Simple integration
     167  // VI replace by direct integration over 100 point
    182168
    183   // Simple Gaussian quadrature integration
     169  const G4int numIters = 100;
     170  G4double Step = (upLim-lowLim)/G4double(numIters);
    184171
    185   G4double x;
    186   G4double root3 = 1.0/std::sqrt(3.0);
     172  G4double res = 0.0;
     173  G4double x = lowLim - 0.5*Step;
    187174
    188   G4double Step = (upLim-lowLim)/(2.0*numIters);
    189   G4double Delta = Step*root3;
    190 
    191   G4double mean = 0.0;
    192 
    193   G4double theInt = 0.0;
    194 
    195   for(G4int i = 0; i < numIters; i++) {
    196 
    197     x = (2*i + 1)*Step;
    198     G4double E1ProbDensityA = EmissionProbDensity(frag,x+Delta);
    199     G4double E1ProbDensityB = EmissionProbDensity(frag,x-Delta);
    200 
    201     mean += E1ProbDensityA + E1ProbDensityB;
    202 
     175  for(G4int i = 0; i < numIters; ++i) {
     176    x += Step;
     177    res += EmissionProbDensity(frag, x);
    203178  }
    204179
    205   if(mean*Step > 0.0) theInt = mean*Step;
     180  if(res > 0.0) { res /= G4double(numIters); }
     181  else { res = 0.0; }
    206182
    207   return theInt;
     183  return res;
    208184
    209185}
  • trunk/source/processes/hadronic/models/de_excitation/photon_evaporation/src/G4E1SingleProbability1.cc

    r819 r1347  
    2424// ********************************************************************
    2525//
     26// $Id: G4E1SingleProbability1.cc,v 1.5 2010/11/17 16:50:53 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2628//
    2729//  Class G4E1SingleProbability1.cc
     
    3133#include "G4ConstantLevelDensityParameter.hh"
    3234#include "Randomize.hh"
     35#include "G4Pow.hh"
    3336
    3437// Constructors and operators
    3538//
    3639
    37 G4E1SingleProbability1::G4E1SingleProbability1(const G4E1SingleProbability1&
    38                                                ) : G4VEmissionProbability()
    39 {
     40G4E1SingleProbability1::G4E1SingleProbability1()
     41{}
    4042
    41   throw G4HadronicException(__FILE__, __LINE__, "G4E1SingleProbability1::copy_constructor meant to not be accessible");
    42 
    43 }
    44 
    45 const G4E1SingleProbability1& G4E1SingleProbability1::
    46 operator=(const G4E1SingleProbability1& )
    47 {
    48 
    49   throw G4HadronicException(__FILE__, __LINE__, "G4E1SingleProbability1::operator= meant to not be accessible");
    50   return *this;
    51 }
    52 
    53 G4bool G4E1SingleProbability1::operator==(const G4E1SingleProbability1&
    54                                           ) const
    55 {
    56 
    57   return false;
    58 
    59 }
    60 
    61 G4bool G4E1SingleProbability1::operator!=(const G4E1SingleProbability1& )
    62 const
    63 {
    64 
    65   return true;
    66 
    67 }
     43G4E1SingleProbability1::~G4E1SingleProbability1()
     44{}
    6845
    6946// Calculate the emission probability
     
    7148
    7249G4double G4E1SingleProbability1::EmissionProbDensity(const G4Fragment& frag,
    73                                                      const G4double exciteE)
     50                                                     G4double exciteE)
    7451{
    7552
     
    8461  G4double theProb = 0.0;
    8562
    86   const G4double Afrag = frag.GetA();
    87   const G4double Zfrag = frag.GetZ();
    88   const G4double Uexcite = frag.GetExcitationEnergy();
     63  G4int Afrag = frag.GetA_asInt();
     64  G4int Zfrag = frag.GetZ_asInt();
     65  G4double Uexcite = frag.GetExcitationEnergy();
    8966
    9067  if( (Uexcite-exciteE) < 0.0 || exciteE < 0 || Uexcite <= 0) return theProb;
     
    9572
    9673  G4ConstantLevelDensityParameter a;
    97   G4double aLevelDensityParam = a.LevelDensityParameter(static_cast<G4int>(Afrag),
    98                                                         static_cast<G4int>(Zfrag),
    99                                                         Uexcite);
     74  G4double aLevelDensityParam = a.LevelDensityParameter(Afrag,Zfrag,Uexcite);
    10075
    10176  G4double levelDensBef = std::exp(2.0*std::sqrt(aLevelDensityParam*Uexcite));
     
    10984  G4double sigma0 = 2.5 * Afrag * millibarn;  // millibarns
    11085
    111   G4double Egdp = (40.3 / std::pow(Afrag,0.2) )*MeV;
     86  G4double Egdp = (40.3 / G4Pow::GetInstance()->powZ(Afrag,0.2) )*MeV;
    11287  G4double GammaR = 0.30 * Egdp;
    11388 
    114   G4double normC = 1.0 / ((pi * hbarc)*(pi * hbarc));
     89  const G4double normC = 1.0 / ((pi * hbarc)*(pi * hbarc));
    11590
    11691  // CD
     
    144119
    145120G4double G4E1SingleProbability1::EmissionProbability(const G4Fragment& frag,
    146                                                      const G4double exciteE)
     121                                                     G4double exciteE)
    147122{
    148123
     
    178153
    179154G4double G4E1SingleProbability1::EmissionIntegration(const G4Fragment& frag,
    180                              const G4double ,
    181                              const G4double lowLim, const G4double upLim,
    182                              const G4int numIters)
     155                                                    G4double ,
     156                                                     G4double lowLim, G4double upLim,
     157                                                    G4int numIters)
    183158
    184159{
     
    187162
    188163  G4double x;
    189   G4double root3 = 1.0/std::sqrt(3.0);
     164  const G4double root3 = 1.0/std::sqrt(3.0);
    190165
    191166  G4double Step = (upLim-lowLim)/(2.0*numIters);
     
    212187}
    213188
    214 G4E1SingleProbability1::~G4E1SingleProbability1() {}
    215189
    216190
  • trunk/source/processes/hadronic/models/de_excitation/photon_evaporation/src/G4NeutronRadCapture.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4NeutronRadCapture.cc,v 1.5 2010/09/09 15:40:48 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     26// $Id: G4NeutronRadCapture.cc,v 1.6 2010/11/17 16:21:32 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2828//
    2929//
     
    4545#include "G4ParticleDefinition.hh"
    4646#include "G4ParticleTable.hh"
     47#include "G4IonTable.hh"
    4748#include "G4Deuteron.hh"
    4849#include "G4Triton.hh"
     
    108109
    109110    lv1 -= lv2;
    110     if(Z > 2 || A > 4)
    111       {
    112         theDef = G4ParticleTable::GetParticleTable()->FindIon(Z,A,0,Z);
    113       }
    114     else if (Z == 1 && A == 2) {theDef = G4Deuteron::Deuteron();}
     111    if      (Z == 1 && A == 2) {theDef = G4Deuteron::Deuteron();}
    115112    else if (Z == 1 && A == 3) {theDef = G4Triton::Triton();}
    116113    else if (Z == 2 && A == 3) {theDef = G4He3::He3();}
    117114    else if (Z == 2 && A == 4) {theDef = G4Alpha::Alpha();}
     115    else 
     116      {
     117        theDef =
     118          G4ParticleTable::GetParticleTable()->GetIonTable()->GetIon(Z,A,0.0);
     119      }
    118120
    119121    if (verboseLevel > 1) {
     
    155157        else
    156158          {
    157             theDef = G4ParticleTable::GetParticleTable()->FindIon(Z,A,0,Z);
     159            theDef =
     160              G4ParticleTable::GetParticleTable()->GetIonTable()->GetIon(Z,A,0.0);
    158161          }
    159162
  • trunk/source/processes/hadronic/models/de_excitation/photon_evaporation/src/G4NuclearLevel.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4NuclearLevel.cc,v 1.5 2010/10/10 23:01:39 mkelsey Exp $
     26// $Id: G4NuclearLevel.cc,v 1.7 2010/11/17 16:50:53 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
     28//
    2729// -------------------------------------------------------------------
    2830//      GEANT 4 class file
     
    5557//              reading from experimental data.
    5658//     
     59//        28 October 2010, V.Ivanchenko moved copy constructor to source, cleanup
     60//
    5761// -------------------------------------------------------------------
    5862
    5963#include "G4NuclearLevel.hh"
    60 
    6164#include "globals.hh"
    6265
     
    7376}
    7477
    75 G4NuclearLevel::G4NuclearLevel(const G4double energy, const G4double halfLife,
    76                                const G4double angularMomentum)
     78G4NuclearLevel::G4NuclearLevel(G4double energy, G4double halfLife,
     79                               G4double angularMomentum)
    7780  : _energy(energy), _halfLife(halfLife), _angularMomentum(angularMomentum),
    7881    _nGammas(0) {
     
    8083}
    8184
    82 G4NuclearLevel::G4NuclearLevel(const G4double energy, const G4double halfLife,
    83                                const G4double angularMomentum,
    84                                const std::vector<double>& eGamma,
    85                                const std::vector<double>& wGamma,
    86                                const std::vector<double>& polarities,
    87                                const std::vector<double>& kCC, const std::vector<double>& l1CC,
    88                                const std::vector<double>& l2CC, const std::vector<double>& l3CC,
    89                                const std::vector<double>& m1CC, const std::vector<double>& m2CC,
    90                                const std::vector<double>& m3CC, const std::vector<double>& m4CC,
    91                                const std::vector<double>& m5CC, const std::vector<double>& nPlusCC,
    92                                const std::vector<double>& totalCC)
     85G4NuclearLevel::G4NuclearLevel(G4double energy, G4double halfLife,
     86                               G4double angularMomentum,
     87                               const std::vector<G4double>& eGamma,
     88                               const std::vector<G4double>& wGamma,
     89                               const std::vector<G4double>& polarities,
     90                               const std::vector<G4double>& kCC, const std::vector<G4double>& l1CC,
     91                               const std::vector<G4double>& l2CC, const std::vector<G4double>& l3CC,
     92                               const std::vector<G4double>& m1CC, const std::vector<G4double>& m2CC,
     93                               const std::vector<G4double>& m3CC, const std::vector<G4double>& m4CC,
     94                               const std::vector<G4double>& m5CC, const std::vector<G4double>& nPlusCC,
     95                               const std::vector<G4double>& totalCC)
    9396
    9497  : _energies(eGamma), _weights(wGamma), _polarities(polarities),
     
    107110}
    108111
    109 
    110112G4bool G4NuclearLevel::operator==(const G4NuclearLevel &right) const
    111113{
     
    118120  return (this != (G4NuclearLevel *) &right);
    119121}
    120 
    121122
    122123G4bool G4NuclearLevel::operator<(const G4NuclearLevel &right) const 
     
    126127}
    127128
    128 
    129 const std::vector<double>& G4NuclearLevel::GammaEnergies() const
     129const std::vector<G4double>& G4NuclearLevel::GammaEnergies() const
    130130{
    131131  return _energies;
    132132}
    133133 
    134 const std::vector<double>& G4NuclearLevel::GammaWeights() const
     134const std::vector<G4double>& G4NuclearLevel::GammaWeights() const
    135135{
    136136  return _weights;
     
    138138 
    139139
    140 const std::vector<double>& G4NuclearLevel::GammaProbabilities() const
     140const std::vector<G4double>& G4NuclearLevel::GammaProbabilities() const
    141141{
    142142  return _prob;
     
    144144 
    145145
    146 const std::vector<double>& G4NuclearLevel::GammaCumulativeProbabilities() const
     146const std::vector<G4double>& G4NuclearLevel::GammaCumulativeProbabilities() const
    147147{
    148148  return _cumProb;
     
    150150 
    151151
    152 const std::vector<double>& G4NuclearLevel::GammaPolarities() const
     152const std::vector<G4double>& G4NuclearLevel::GammaPolarities() const
    153153{
    154154  return _polarities;
    155155}
    156156 
    157 const std::vector<double>& G4NuclearLevel::KConvertionProbabilities() const
     157const std::vector<G4double>& G4NuclearLevel::KConvertionProbabilities() const
    158158{
    159159  return _kCC;
    160160}
    161161 
    162 const std::vector<double>& G4NuclearLevel::L1ConvertionProbabilities() const
     162const std::vector<G4double>& G4NuclearLevel::L1ConvertionProbabilities() const
    163163{
    164164  return _l1CC;
    165165}
    166166 
    167 const std::vector<double>& G4NuclearLevel::L2ConvertionProbabilities() const
     167const std::vector<G4double>& G4NuclearLevel::L2ConvertionProbabilities() const
    168168{
    169169  return _l2CC;
    170170}
    171171 
    172 const std::vector<double>& G4NuclearLevel::L3ConvertionProbabilities() const
     172const std::vector<G4double>& G4NuclearLevel::L3ConvertionProbabilities() const
    173173{
    174174  return _l3CC;
    175175}
    176176 
    177 const std::vector<double>& G4NuclearLevel::M1ConvertionProbabilities() const
     177const std::vector<G4double>& G4NuclearLevel::M1ConvertionProbabilities() const
    178178{
    179179  return _m1CC;
    180180}
    181181 
    182 const std::vector<double>& G4NuclearLevel::M2ConvertionProbabilities() const
     182const std::vector<G4double>& G4NuclearLevel::M2ConvertionProbabilities() const
    183183{
    184184  return _m2CC;
    185185}
    186186 
    187 const std::vector<double>& G4NuclearLevel::M3ConvertionProbabilities() const
     187const std::vector<G4double>& G4NuclearLevel::M3ConvertionProbabilities() const
    188188{
    189189  return _m3CC;
    190190}
    191191 
    192 const std::vector<double>& G4NuclearLevel::M4ConvertionProbabilities() const
     192const std::vector<G4double>& G4NuclearLevel::M4ConvertionProbabilities() const
    193193{
    194194  return _m4CC;
    195195}
    196196 
    197 const std::vector<double>& G4NuclearLevel::M5ConvertionProbabilities() const
     197const std::vector<G4double>& G4NuclearLevel::M5ConvertionProbabilities() const
    198198{
    199199  return _m5CC;
    200200}
    201201 
    202 const std::vector<double>& G4NuclearLevel::NPlusConvertionProbabilities() const
     202const std::vector<G4double>& G4NuclearLevel::NPlusConvertionProbabilities() const
    203203{
    204204  return _nPlusCC;
    205205}
    206206 
    207 const std::vector<double>& G4NuclearLevel::TotalConvertionProbabilities() const
     207const std::vector<G4double>& G4NuclearLevel::TotalConvertionProbabilities() const
    208208{
    209209  return _totalCC;
     
    225225}
    226226 
    227 
    228227G4int G4NuclearLevel::NumberOfGammas() const
    229228{
     
    294293}
    295294
    296 
    297 
     295const G4NuclearLevel& G4NuclearLevel::operator=(const G4NuclearLevel &right)
     296{
     297  if(this != &right)
     298    {
     299      _energies = right._energies;
     300      _weights =right._weights;
     301      _prob =right._prob;
     302      _cumProb =right._cumProb;
     303      _polarities =right._polarities;
     304      _kCC = right._kCC;
     305      _l1CC =right._l1CC;
     306      _l2CC =right._l2CC;
     307      _l3CC =right._l3CC;
     308      _m1CC = right._m1CC;
     309      _m2CC = right._m2CC;
     310      _m3CC = right._m3CC;
     311      _m4CC = right._m4CC;
     312      _m5CC = right._m5CC;
     313      _nPlusCC = right._nPlusCC;
     314      _totalCC = right._totalCC;
     315      _energy = right._energy;
     316      _halfLife = right._halfLife;
     317      _angularMomentum = right._angularMomentum;
     318      _nGammas = right._nGammas;
     319    }
     320  return *this;
     321}
     322
     323G4NuclearLevel::G4NuclearLevel(const G4NuclearLevel &right)
     324{
     325  _energies = right._energies;
     326  _weights =right._weights;
     327  _prob =right._prob;
     328  _cumProb =right._cumProb;
     329  _polarities =right._polarities;
     330  _kCC = right._kCC;
     331  _l1CC =right._l1CC;
     332  _l2CC =right._l2CC;
     333  _l3CC =right._l3CC;
     334  _m1CC = right._m1CC;
     335  _m2CC = right._m2CC;
     336  _m3CC = right._m3CC;
     337  _m4CC = right._m4CC;
     338  _m5CC = right._m5CC;
     339  _nPlusCC = right._nPlusCC;
     340  _totalCC = right._totalCC;
     341  _energy = right._energy;
     342  _halfLife = right._halfLife;
     343  _angularMomentum = right._angularMomentum;
     344  _nGammas = right._nGammas;
     345}
     346
     347
     348
  • trunk/source/processes/hadronic/models/de_excitation/photon_evaporation/src/G4NuclearLevelManager.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4NuclearLevelManager.cc,v 1.13 2010/10/10 23:01:39 mkelsey Exp $
     26// $Id: G4NuclearLevelManager.cc,v 1.14 2010/11/17 16:50:53 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
     28//
    2729// -------------------------------------------------------------------
    2830//      GEANT 4 class file
     
    6365{ }
    6466
    65 G4NuclearLevelManager::G4NuclearLevelManager(const G4int Z, const G4int A, const G4String& filename) :
     67G4NuclearLevelManager::G4NuclearLevelManager(G4int Z, G4int A, const G4String& filename) :
    6668    _nucleusA(A), _nucleusZ(Z), _fileName(filename), _validity(false),
    6769    _levels(0), _levelEnergy(0), _gammaEnergy(0), _probability(0)
     
    7880}
    7981
    80 void G4NuclearLevelManager::SetNucleus(const G4int Z, const G4int A, const G4String& filename)
     82void G4NuclearLevelManager::SetNucleus(G4int Z, G4int A, const G4String& filename)
    8183{
    8284  if (A <= 0 || Z <= 0 || Z > A )
     
    9294}
    9395
    94 const G4NuclearLevel* G4NuclearLevelManager::GetLevel(int i) const {
     96const G4NuclearLevel* G4NuclearLevelManager::GetLevel(G4int i) const {
    9597  return (i>=0 && i<NumberOfLevels()) ? (*_levels)[i] : 0;
    9698}
     
    98100
    99101const G4NuclearLevel*
    100 G4NuclearLevelManager::NearestLevel(const G4double energy,
    101                                     const G4double eDiffMax) const {
     102G4NuclearLevelManager::NearestLevel(G4double energy,
     103                                    G4double eDiffMax) const
     104{
    102105  if (NumberOfLevels() <= 0) return 0;
    103106
     
    144147
    145148
    146 G4bool G4NuclearLevelManager::Read(std::ifstream& dataFile) {
     149G4bool G4NuclearLevelManager::Read(std::ifstream& dataFile)
     150{
    147151  G4bool goodRead = ReadDataLine(dataFile);
    148152 
     
    187191
    188192G4bool
    189 G4NuclearLevelManager::ReadDataItem(std::istream& dataFile, G4double& x) {
     193G4NuclearLevelManager::ReadDataItem(std::istream& dataFile, G4double& x)
     194{
    190195  G4bool okay = (dataFile >> buffer);           // Get next token
    191196  if (okay) x = strtod(buffer, NULL);
     
    194199}
    195200
    196 
    197 void G4NuclearLevelManager::ProcessDataLine() {
     201void G4NuclearLevelManager::ProcessDataLine()
     202{
    198203  const G4double minProbability = 1e-8;
    199204 
     
    259264}
    260265
    261 
    262266void G4NuclearLevelManager::MakeLevels()
    263267{
     
    304308
    305309G4NuclearLevel*
    306 G4NuclearLevelManager::UseLevelOrMakeNew(G4NuclearLevel* level) {
     310G4NuclearLevelManager::UseLevelOrMakeNew(G4NuclearLevel* level)
     311{
    307312  if (level && _levelEnergy == level->Energy()) return level;   // No change
    308313
     
    313318}
    314319
    315 void G4NuclearLevelManager::AddDataToLevel(G4NuclearLevel* level) {
     320void G4NuclearLevelManager::AddDataToLevel(G4NuclearLevel* level)
     321{
    316322  if (!level) return;           // Sanity check
    317323
     
    332338}
    333339
    334 void G4NuclearLevelManager::FinishLevel(G4NuclearLevel* level) {
     340void G4NuclearLevelManager::FinishLevel(G4NuclearLevel* level)
     341{
    335342  if (!level || !_levels) return;               // Sanity check
    336343
     
    353360    GetLevel(i)->PrintAll();
    354361}
    355 
    356362
    357363G4NuclearLevelManager::G4NuclearLevelManager(const G4NuclearLevelManager &right)
  • trunk/source/processes/hadronic/models/de_excitation/photon_evaporation/src/G4NuclearLevelStore.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4NuclearLevelStore.cc,v 1.4 2010/10/07 07:50:13 mkelsey Exp $
     26// $Id: G4NuclearLevelStore.cc,v 1.5 2010/11/17 16:50:53 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2728//
    28 // 20101006  M. Kelsey -- Drop static data members.
     29// 06-10-2010 M. Kelsey -- Drop static data members.
     30// 17-11-2010 V. Ivanchenko - make as a classical singleton.
    2931
    3032#include "G4NuclearLevelStore.hh"
    3133#include <sstream>
    3234
     35G4NuclearLevelStore* G4NuclearLevelStore::theInstance = 0;
     36
    3337G4NuclearLevelStore* G4NuclearLevelStore::GetInstance()
    3438{
    35   static G4NuclearLevelStore theInstance;
    36   return &theInstance;
     39  if(!theInstance) {
     40    static G4NuclearLevelStore store;
     41    theInstance = &store;
     42  }
     43  return theInstance;
    3744}
    3845
    3946G4NuclearLevelStore::G4NuclearLevelStore()
    4047{
    41     char* env = getenv("G4LEVELGAMMADATA");
    42     if (env == 0)
     48  char* env = getenv("G4LEVELGAMMADATA");
     49  if (env == 0)
    4350    {
    44         G4cout << "G4NuclarLevelStore: please set the G4LEVELGAMMADATA environment variable\n";
    45         dirName = "";
     51      G4cout << "G4NuclarLevelStore: please set the G4LEVELGAMMADATA environment variable\n";
     52      dirName = "";
    4653    }
    47     else
     54  else
    4855    {
    49         dirName = env;
    50         dirName += '/';
     56      dirName = env;
     57      dirName += '/';
    5158    }
    5259}
    5360
    54 
    5561G4NuclearLevelStore::~G4NuclearLevelStore()
    5662{
    57     ManagersMap::iterator i;
    58     for (i = theManagers.begin(); i != theManagers.end(); ++i)
    59       delete i->second;
     63  ManagersMap::iterator i;
     64  for (i = theManagers.begin(); i != theManagers.end(); ++i)
     65    delete i->second;
    6066}
    6167
    6268G4String
    63 G4NuclearLevelStore::GenerateFilename(const G4int Z, const G4int A) const {
    64     std::ostringstream streamName;
    65     streamName << 'z' << Z << ".a" << A;
    66     G4String name(streamName.str());
    67     return name;
     69G4NuclearLevelStore::GenerateFilename(G4int Z, G4int A) const
     70{
     71  std::ostringstream streamName;
     72  streamName << 'z' << Z << ".a" << A;
     73  G4String name(streamName.str());
     74  return name;
    6875}
    6976
    70 
    7177G4NuclearLevelManager*
    72 G4NuclearLevelStore::GetManager(const G4int Z, const G4int A) {
    73     G4NuclearLevelManager * result = 0;
    74     if (A < 1 || Z < 1 || A < Z)
     78G4NuclearLevelStore::GetManager(G4int Z, G4int A)
     79{
     80  G4NuclearLevelManager * result = 0;
     81  if (A < 1 || Z < 1 || A < Z)
    7582    {
    7683        G4cerr << "G4NuclearLevelStore::GetManager: Wrong values Z = " << Z
     
    7986    }
    8087
    81     // Generate the key = filename
    82     G4int key = GenerateKey(Z,A);
     88  // Generate the key = filename
     89  G4int key = GenerateKey(Z,A);
    8390   
    84     // Check if already exists that key
    85     ManagersMap::iterator idx = theManagers.find(key);
    86     // If doesn't exists then create it
    87     if ( idx == theManagers.end() )
     91  // Check if already exists that key
     92  ManagersMap::iterator idx = theManagers.find(key);
     93  // If doesn't exists then create it
     94  if ( idx == theManagers.end() )
    8895    {
    89         G4String file = GenerateFilename(Z,A);
    90         result = new G4NuclearLevelManager(Z,A,dirName + file);
    91         theManagers.insert(std::make_pair(key,result));
     96      G4String file = GenerateFilename(Z,A);
     97      result = new G4NuclearLevelManager(Z,A,dirName + file);
     98      theManagers.insert(std::make_pair(key,result));
    9299    }
    93     // But if it exists...
    94     else
     100  // But if it exists...
     101  else
    95102    {
    96         result = idx->second;
     103      result = idx->second;
    97104    }
    98105   
    99     return result;
     106  return result;
    100107}
  • trunk/source/processes/hadronic/models/de_excitation/photon_evaporation/src/G4PhotonEvaporation.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PhotonEvaporation.cc,v 1.13 2010/05/17 11:47:43 flei Exp $
    27 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     26// $Id: G4PhotonEvaporation.cc,v 1.16 2010/11/23 18:03:21 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2828//
    2929// -------------------------------------------------------------------
     
    7575{
    7676  _probAlgorithm = new G4E1Probability;
    77   _discrDeexcitation = new G4DiscreteGammaDeexcitation;
     77  G4DiscreteGammaDeexcitation* p = new G4DiscreteGammaDeexcitation();
     78  p->SetICM(false);
     79  _discrDeexcitation = p;
    7880  _contDeexcitation = new G4ContinuumGammaDeexcitation;
    79   (dynamic_cast <G4DiscreteGammaDeexcitation*> (_discrDeexcitation))->SetICM(false);
    80 }
    81 
     81  _nucleus = 0;
     82}
    8283
    8384G4PhotonEvaporation::~G4PhotonEvaporation()
     
    8788  delete _contDeexcitation;
    8889}
    89 
    9090
    9191void G4PhotonEvaporation::Initialize(const G4Fragment& fragment)
     
    290290G4double G4PhotonEvaporation::GetEmissionProbability() const
    291291{
    292   G4double prob = 0.;
    293   if (_probAlgorithm != 0) {
    294     prob = _probAlgorithm->EmissionProbability(*_nucleus,_gammaE);
    295   }
     292  G4double prob =
     293    _probAlgorithm->EmissionProbability(*_nucleus,_nucleus->GetExcitationEnergy());
    296294  return prob;
    297295}
     
    308306
    309307  _myOwnProbAlgorithm = false;
    310 
    311   return;
    312308}
    313309
     
    318314  _contDeexcitation->SetVerboseLevel(verbose);
    319315  _discrDeexcitation->SetVerboseLevel(verbose);
    320 
    321   return;
    322316}
    323317
     
    325319{
    326320 (dynamic_cast <G4DiscreteGammaDeexcitation*> (_discrDeexcitation))->SetICM(ic);
    327  return;
    328321}
    329322
     
    331324{
    332325 (dynamic_cast <G4DiscreteGammaDeexcitation*> (_discrDeexcitation))->SetHL(hl);
    333  return;
    334326}
    335327
     
    337329{
    338330 (dynamic_cast <G4DiscreteGammaDeexcitation*> (_discrDeexcitation))->SetRDM(fromRDM);
    339  return;
    340331}
    341332
     
    343334{
    344335  _discrDeexcitation->SetEO(eo);
    345   return;
    346336}
    347337
  • trunk/source/processes/hadronic/models/de_excitation/photon_evaporation/src/G4VGammaDeexcitation.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VGammaDeexcitation.cc,v 1.18 2010/06/25 09:46:13 gunter Exp $
    27 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     26// $Id: G4VGammaDeexcitation.cc,v 1.20 2010/11/17 19:17:17 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2828//
    2929// -------------------------------------------------------------------
     
    7474G4VGammaDeexcitation::G4VGammaDeexcitation(): _transition(0), _verbose(0),
    7575                                              _electronO (0), _vSN(-1)
    76 { }
     76{
     77  _nucleus = 0;
     78}
    7779
    7880G4VGammaDeexcitation::~G4VGammaDeexcitation()
     
    154156  G4ParticleDefinition* gamma = G4Gamma::Gamma();
    155157
    156   G4DiscreteGammaTransition* dtransition = 0;
    157   dtransition = dynamic_cast <G4DiscreteGammaTransition*> (_transition);
     158  G4DiscreteGammaTransition* dtransition =
     159    dynamic_cast <G4DiscreteGammaTransition*> (_transition);
    158160  if ( dtransition && !( dtransition->IsAGamma()) ) {
    159161    gamma = G4Electron::Electron();
  • trunk/source/processes/hadronic/models/de_excitation/photon_evaporation/src/G4VPhotonEvaporation.cc

    r1340 r1347  
    3838//      Modifications:
    3939//     
     40// 17-11-2010 V.Ivanchenko moved constructor an ddestructor to the source
     41//
    4042// -------------------------------------------------------------------
    4143//
    42 // $Id: G4VPhotonEvaporation.cc,v 1.3 2010/04/25 18:43:21 vnivanch Exp $
    43 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     44// $Id: G4VPhotonEvaporation.cc,v 1.4 2010/11/17 16:50:53 vnivanch Exp $
     45// GEANT4 tag $Name: geant4-09-04-ref-00 $
    4446
    4547
    4648#include "G4VPhotonEvaporation.hh"
    4749
     50G4VPhotonEvaporation::G4VPhotonEvaporation()
     51{}
    4852
    49 G4bool G4VPhotonEvaporation::operator==(const G4VPhotonEvaporation &right) const
    50 {
    51     return (this == (G4VPhotonEvaporation*) &right);
    52 }
    53 
    54 G4bool G4VPhotonEvaporation::operator!=(const G4VPhotonEvaporation &right) const
    55 {
    56     return (this != (G4VPhotonEvaporation*) &right);
    57 }
     53G4VPhotonEvaporation::~G4VPhotonEvaporation()
     54{}
    5855
    5956
     57
  • trunk/source/processes/hadronic/models/de_excitation/util/include/G4AlphaCoulombBarrier.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4AlphaCoulombBarrier.hh,v 1.4 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4AlphaCoulombBarrier.hh,v 1.5 2010/11/15 12:44:06 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    4040{
    4141public:
    42   G4AlphaCoulombBarrier() : G4CoulombBarrier(4,2) {};
    43   ~G4AlphaCoulombBarrier() {};
     42
     43  G4AlphaCoulombBarrier();
     44  virtual ~G4AlphaCoulombBarrier();
    4445
    4546private:
     
    5051  G4bool operator!=(const G4AlphaCoulombBarrier & right) const;
    5152 
    52 private:
    53 
    54   virtual G4double BarrierPenetrationFactor(const G4double aZ) const;
    55 
     53  virtual G4double BarrierPenetrationFactor(G4double aZ) const;
    5654
    5755};
  • trunk/source/processes/hadronic/models/de_excitation/util/include/G4ConstantLevelDensityParameter.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4ConstantLevelDensityParameter.hh,v 1.5 2009/03/04 11:05:02 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4ConstantLevelDensityParameter.hh,v 1.6 2010/11/15 16:09:46 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations (photon evaporation)
     
    4040{
    4141public:
    42   G4ConstantLevelDensityParameter() :  EvapLevelDensityParameter(0.125*(1./MeV)) {};
     42
     43  G4ConstantLevelDensityParameter();
    4344  virtual ~G4ConstantLevelDensityParameter();
    4445
     
    5657private:
    5758
    58   const G4double EvapLevelDensityParameter;
     59  G4double EvapLevelDensityParameter;
    5960
    6061};
  • trunk/source/processes/hadronic/models/de_excitation/util/include/G4CookPairingCorrections.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4CookPairingCorrections.hh,v 1.5 2009/03/04 11:05:02 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4CookPairingCorrections.hh,v 1.6 2010/11/15 16:09:46 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    5252  ~G4CookPairingCorrections();
    5353
    54   G4double GetParingCorrection(const G4int A, const G4int Z) const {
     54  G4double GetParingCorrection(G4int A, G4int Z) const {
    5555    return GetPairingZ(Z) + GetPairingN(A-Z);
    5656  }
    5757
    5858
    59   G4double GetPairingZ(const G4int Z) const {
     59  G4double GetPairingZ(G4int Z) const {
    6060    if ( this->IsInTableThisZ(Z) ) return PairingZTable[Z-ZTableMin]*MeV;
    6161    else {
  • trunk/source/processes/hadronic/models/de_excitation/util/include/G4CookShellCorrections.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4CookShellCorrections.hh,v 1.5 2009/03/04 11:05:02 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4CookShellCorrections.hh,v 1.6 2010/11/15 16:09:46 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    5454  ~G4CookShellCorrections();
    5555
    56   G4double GetShellCorrection(const G4int A, const G4int Z) const
     56  G4double GetShellCorrection(G4int A, G4int Z) const
    5757  {
    5858    return GetShellZ(Z) + GetShellN(A-Z);
  • trunk/source/processes/hadronic/models/de_excitation/util/include/G4CoulombBarrier.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4CoulombBarrier.hh,v 1.6 2009/03/04 11:05:02 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4CoulombBarrier.hh,v 1.8 2010/11/15 13:23:27 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
    3131// by V. Lara (Dec 1999)
     32//
     33// 15-11-2010 V.Ivanchenko cleanup
    3234
    3335#ifndef G4CoulombBarrier_h
     
    4143class G4CoulombBarrier : public G4VCoulombBarrier
    4244{
     45
    4346public:
     47
    4448  G4CoulombBarrier();
    45   G4CoulombBarrier(const G4int anA,const G4int aZ);
     49  G4CoulombBarrier(G4int anA, G4int aZ);
    4650  virtual ~G4CoulombBarrier();
     51
     52  G4double GetCoulombBarrier(G4int ARes, G4int ZRes, G4double U) const;
    4753
    4854private:
     
    5359  G4bool operator!=(const G4CoulombBarrier & right) const;
    5460 
    55 public:
    56   G4double GetCoulombBarrier(const G4int ARes, const G4int ZRes,
    57                              const G4double U) const;
     61  virtual G4double BarrierPenetrationFactor(G4double ) const;
    5862
    59 
    60 private:
    61 
    62   virtual G4double BarrierPenetrationFactor(const G4double ) const {return 1.0;}
    63 
    64   virtual G4double CalcCompoundRadius(const G4double ZRes) const
     63  inline G4double CalcCompoundRadius(const G4double ZRes) const
    6564  {
    6665    return 2.173*fermi*(1.0+0.006103*static_cast<G4double>(GetZ())*ZRes)/
  • trunk/source/processes/hadronic/models/de_excitation/util/include/G4DeuteronCoulombBarrier.hh

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4DeuteronCoulombBarrier.hh,v 1.5 2009/03/04 11:05:02 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     26// $Id: G4DeuteronCoulombBarrier.hh,v 1.6 2010/11/15 12:44:06 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2928//
    3029// Hadronic Process: Nuclear De-excitations
     
    4039{
    4140public:
    42         G4DeuteronCoulombBarrier() : G4CoulombBarrier(2,1) {}
    43         ~G4DeuteronCoulombBarrier() {}
     41
     42  G4DeuteronCoulombBarrier();
     43  virtual ~G4DeuteronCoulombBarrier();
    4444
    4545private:
    46         G4DeuteronCoulombBarrier(const G4DeuteronCoulombBarrier & right);
    4746
    48         const G4DeuteronCoulombBarrier & operator=(const G4DeuteronCoulombBarrier & right);
    49         G4bool operator==(const G4DeuteronCoulombBarrier & right) const;
    50         G4bool operator!=(const G4DeuteronCoulombBarrier & right) const;
     47  G4DeuteronCoulombBarrier(const G4DeuteronCoulombBarrier & right);
     48
     49  const G4DeuteronCoulombBarrier & operator=(const G4DeuteronCoulombBarrier & right);
     50  G4bool operator==(const G4DeuteronCoulombBarrier & right) const;
     51  G4bool operator!=(const G4DeuteronCoulombBarrier & right) const;
    5152 
    52 private:
    53 
    54         G4double BarrierPenetrationFactor(const G4double aZ) const;
     53  virtual G4double BarrierPenetrationFactor(G4double aZ) const;
    5554
    5655};
  • trunk/source/processes/hadronic/models/de_excitation/util/include/G4EvaporationLevelDensityParameter.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4EvaporationLevelDensityParameter.hh,v 1.5 2009/03/04 11:05:02 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4EvaporationLevelDensityParameter.hh,v 1.6 2010/11/15 16:09:46 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    5858 
    5959public:
    60   G4double LevelDensityParameter(const G4int A,const G4int Z,const G4double U) const;
     60
     61  G4double LevelDensityParameter(G4int A, G4int Z, G4double U) const;
    6162
    6263private:
    6364
    64   G4double ShellCorrection(const G4int Z, const G4int N) const
     65  inline G4double ShellCorrection(G4int Z, G4int N) const
    6566  {
    6667    G4CameronTruranHilfShellCorrections* SPtr = G4CameronTruranHilfShellCorrections::GetInstance();
  • trunk/source/processes/hadronic/models/de_excitation/util/include/G4He3CoulombBarrier.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4He3CoulombBarrier.hh,v 1.5 2009/03/04 11:05:02 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4He3CoulombBarrier.hh,v 1.6 2010/11/15 12:44:06 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    4040{
    4141public:
    42         G4He3CoulombBarrier() : G4CoulombBarrier(3,2) {}
    43         ~G4He3CoulombBarrier() {}
     42
     43  G4He3CoulombBarrier();
     44  virtual ~G4He3CoulombBarrier();
    4445
    4546private:
    46         G4He3CoulombBarrier(const G4He3CoulombBarrier & right);
    4747
    48         const G4He3CoulombBarrier & operator=(const G4He3CoulombBarrier & right);
    49         G4bool operator==(const G4He3CoulombBarrier & right) const;
    50         G4bool operator!=(const G4He3CoulombBarrier & right) const;
     48  G4He3CoulombBarrier(const G4He3CoulombBarrier & right);
     49
     50  const G4He3CoulombBarrier & operator=(const G4He3CoulombBarrier & right);
     51  G4bool operator==(const G4He3CoulombBarrier & right) const;
     52  G4bool operator!=(const G4He3CoulombBarrier & right) const;
    5153 
    52 private:
    53 
    54         G4double BarrierPenetrationFactor(const G4double aZ) const;
     54  virtual G4double BarrierPenetrationFactor(G4double aZ) const;
    5555
    5656};
  • trunk/source/processes/hadronic/models/de_excitation/util/include/G4NeutronCoulombBarrier.hh

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4NeutronCoulombBarrier.hh,v 1.5 2009/03/04 11:05:02 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     26// $Id: G4NeutronCoulombBarrier.hh,v 1.6 2010/11/15 12:44:06 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2928//
    3029// Hadronic Process: Nuclear De-excitations
     
    4039{
    4140public:
    42         G4NeutronCoulombBarrier() : G4CoulombBarrier(1,0) {}
    43         ~G4NeutronCoulombBarrier() {}
     41
     42  G4NeutronCoulombBarrier();
     43  virtual ~G4NeutronCoulombBarrier();
    4444
    4545private:
    46         G4NeutronCoulombBarrier(const G4NeutronCoulombBarrier & right);
     46  G4NeutronCoulombBarrier(const G4NeutronCoulombBarrier & right);
    4747
    48         const G4NeutronCoulombBarrier & operator=(const G4NeutronCoulombBarrier & right);
    49         G4bool operator==(const G4NeutronCoulombBarrier & right) const;
    50         G4bool operator!=(const G4NeutronCoulombBarrier & right) const;
     48  const G4NeutronCoulombBarrier & operator=(const G4NeutronCoulombBarrier & right);
     49  G4bool operator==(const G4NeutronCoulombBarrier & right) const;
     50  G4bool operator!=(const G4NeutronCoulombBarrier & right) const;
    5151 
    52 private:
    53 
    54         G4double BarrierPenetrationFactor(const G4double ) const
    55         { return 1.0;}
    56 
    5752};
    5853
  • trunk/source/processes/hadronic/models/de_excitation/util/include/G4PairingCorrection.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4PairingCorrection.hh,v 1.6 2009/03/04 11:05:02 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4PairingCorrection.hh,v 1.8 2010/11/15 12:39:27 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    3838#include "G4CameronGilbertPairingCorrections.hh"
    3939//#include "G4CameronTruranHilfPairingCorrections.hh"
    40 
    4140
    4241class G4PairingCorrection
     
    5554  ~G4PairingCorrection();
    5655
    57   G4double GetPairingCorrection(const G4int A, const G4int Z) const
    58   {
    59     G4double PCorrection = 0.0;
    60     const G4int N = A - Z;
    61     if (theCookPairingCorrections->IsInTableThisN(N) &&
    62         theCookPairingCorrections->IsInTableThisZ(Z))
    63       PCorrection = theCookPairingCorrections->GetParingCorrection(A,Z);
    64     else if (theCameronGilbertPairingCorrections->IsInTableThisN(N) &&
    65              theCameronGilbertPairingCorrections->IsInTableThisZ(Z))
    66       PCorrection = theCameronGilbertPairingCorrections->GetPairingCorrection(A,Z);
    67     else {
    68       const G4double PairingConstant = 12.0*MeV;
    69       G4double Pair = (1.0 - static_cast<G4double>(Z) + 2.0*(Z/2)) + (1.0 - static_cast<G4double>(N) + 2.0*(N/2));
    70       PCorrection = Pair*PairingConstant/std::sqrt(static_cast<G4double>(A));
    71     }
    72     return std::max(PCorrection,0.0);
    73   }
     56  G4double GetPairingCorrection(G4int A, G4int Z) const;
    7457
    75 
    76   G4double GetFissionPairingCorrection(const G4int A, const G4int Z) const
    77   {
    78     const G4double PairingConstant = 14.0*MeV;
    79     const G4int N = A - Z;
    80     G4double Pair = (1.0 - static_cast<G4double>(Z) + 2.0*(Z/2)) + (1.0 - static_cast<G4double>(N) + 2.0*(N/2));
    81     G4double PCorrection = Pair*PairingConstant/std::sqrt(static_cast<G4double>(A));
    82     return PCorrection;
    83   }
     58  G4double GetFissionPairingCorrection(G4int A, G4int Z) const;
    8459
    8560private:
     
    8762 
    8863  G4CookPairingCorrections* theCookPairingCorrections;
    89 //  G4CameronTruranHilfPairingCorrections* theCameronTruranHilfPairingCorrections;
     64  //  G4CameronTruranHilfPairingCorrections* theCameronTruranHilfPairingCorrections;
    9065  G4CameronGilbertPairingCorrections* theCameronGilbertPairingCorrections;
    9166
  • trunk/source/processes/hadronic/models/de_excitation/util/include/G4ProtonCoulombBarrier.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4ProtonCoulombBarrier.hh,v 1.5 2009/03/04 11:05:02 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4ProtonCoulombBarrier.hh,v 1.6 2010/11/15 12:44:06 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    4040{
    4141public:
    42         G4ProtonCoulombBarrier() : G4CoulombBarrier(1,1) {}
    43         ~G4ProtonCoulombBarrier() {}
     42
     43  G4ProtonCoulombBarrier();
     44  virtual ~G4ProtonCoulombBarrier();
    4445
    4546private:
    46         G4ProtonCoulombBarrier(const G4ProtonCoulombBarrier & right);
     47  G4ProtonCoulombBarrier(const G4ProtonCoulombBarrier & right);
    4748
    48         const G4ProtonCoulombBarrier & operator=(const G4ProtonCoulombBarrier & right);
    49         G4bool operator==(const G4ProtonCoulombBarrier & right) const;
    50         G4bool operator!=(const G4ProtonCoulombBarrier & right) const;
     49  const G4ProtonCoulombBarrier & operator=(const G4ProtonCoulombBarrier & right);
     50  G4bool operator==(const G4ProtonCoulombBarrier & right) const;
     51  G4bool operator!=(const G4ProtonCoulombBarrier & right) const;
    5152 
    5253private:
    5354
    54         G4double BarrierPenetrationFactor(const G4double aZ) const;
     55  virtual G4double BarrierPenetrationFactor(G4double aZ) const;
    5556
    5657};
  • trunk/source/processes/hadronic/models/de_excitation/util/include/G4TritonCoulombBarrier.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4TritonCoulombBarrier.hh,v 1.5 2009/03/04 11:05:02 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4TritonCoulombBarrier.hh,v 1.6 2010/11/15 12:44:06 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    4040{
    4141public:
    42     G4TritonCoulombBarrier() : G4CoulombBarrier(3,1) {}
    43     ~G4TritonCoulombBarrier() {}
     42
     43  G4TritonCoulombBarrier();
     44  virtual ~G4TritonCoulombBarrier();
    4445
    4546private:
     
    5051    G4bool operator!=(const G4TritonCoulombBarrier & right) const;
    5152 
    52 private:
    53 
    54     G4double BarrierPenetrationFactor(const G4double aZ) const;
     53    virtual G4double BarrierPenetrationFactor(G4double aZ) const;
    5554
    5655};
  • trunk/source/processes/hadronic/models/de_excitation/util/include/G4VEmissionProbability.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4VEmissionProbability.hh,v 1.5 2009/03/04 11:05:02 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4VEmissionProbability.hh,v 1.7 2010/11/15 20:30:26 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    4343#include "globals.hh"
    4444#include "G4Fragment.hh"
     45#include "G4PairingCorrection.hh"
     46#include "G4EvaporationLevelDensityParameter.hh"
     47#include "G4Pow.hh"
    4548
    4649class G4VEmissionProbability
     
    6467  // for superimposed Coulomb Barrier for inverse cross sections       
    6568  inline void UseSICB(G4bool use) { useSICB = use; }   
     69
    6670protected:
    67    G4int OPTxs;
    68    G4bool useSICB;
     71  G4int OPTxs;
     72  G4bool useSICB;
     73
     74  G4Pow*   fG4pow;
     75  G4PairingCorrection* fPairCorr;
     76  G4EvaporationLevelDensityParameter * theEvapLDPptr;
    6977
    7078};
  • trunk/source/processes/hadronic/models/de_excitation/util/src/G4AlphaCoulombBarrier.cc

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4AlphaCoulombBarrier.cc,v 1.5 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4AlphaCoulombBarrier.cc,v 1.6 2010/11/15 12:44:06 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    3535#include "G4HadronicException.hh"
    3636
    37 G4AlphaCoulombBarrier::G4AlphaCoulombBarrier(const G4AlphaCoulombBarrier & ) : G4CoulombBarrier()
    38 {
    39     throw G4HadronicException(__FILE__, __LINE__, "G4AlphaCoulombBarrier::copy_constructor meant to not be accessable.");
    40 }
     37G4AlphaCoulombBarrier::G4AlphaCoulombBarrier() : G4CoulombBarrier(4,2) {}
     38G4AlphaCoulombBarrier::~G4AlphaCoulombBarrier() {}
    4139
    4240
    43 const G4AlphaCoulombBarrier & G4AlphaCoulombBarrier::operator=(const G4AlphaCoulombBarrier & )
    44 {
    45     throw G4HadronicException(__FILE__, __LINE__, "G4AlphaCoulombBarrier::operator= meant to not be accessable.");
    46     return *this;
    47 }
    48 
    49 G4bool G4AlphaCoulombBarrier::operator==(const G4AlphaCoulombBarrier & ) const
    50 {
    51     return false;
    52 }
    53 
    54 G4bool G4AlphaCoulombBarrier::operator!=(const G4AlphaCoulombBarrier & ) const
    55 {
    56     return true;
    57 }
    58 
    59 
    60 G4double G4AlphaCoulombBarrier::BarrierPenetrationFactor(const G4double aZ) const
     41G4double G4AlphaCoulombBarrier::BarrierPenetrationFactor(G4double aZ) const
    6142{
    6243    // Data comes from
  • trunk/source/processes/hadronic/models/de_excitation/util/src/G4CameronGilbertPairingCorrections.cc

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4CameronGilbertPairingCorrections.cc,v 1.6 2009/11/30 10:33:33 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4CameronGilbertPairingCorrections.cc,v 1.7 2010/11/15 16:09:46 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    7979G4CameronGilbertPairingCorrections* G4CameronGilbertPairingCorrections::GetInstance()
    8080{
    81   static G4CameronGilbertPairingCorrections theCorrections;
    82   if (!theInstance)  { theInstance = &theCorrections; }
     81  if (!theInstance)  {
     82    static G4CameronGilbertPairingCorrections theCorrections;
     83    theInstance = &theCorrections;
     84  }
    8385  return theInstance;
    8486}
  • trunk/source/processes/hadronic/models/de_excitation/util/src/G4CameronGilbertShellCorrections.cc

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4CameronGilbertShellCorrections.cc,v 1.6 2009/11/30 10:33:33 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4CameronGilbertShellCorrections.cc,v 1.7 2010/11/15 16:09:46 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    7979G4CameronGilbertShellCorrections* G4CameronGilbertShellCorrections::GetInstance()
    8080{
    81   static G4CameronGilbertShellCorrections theCorrections;
    82   if (!theInstance)  { theInstance = &theCorrections; }
     81  if (!theInstance)  {
     82    static G4CameronGilbertShellCorrections theCorrections;
     83    theInstance = &theCorrections;
     84  }
    8385  return theInstance;
    8486}
  • trunk/source/processes/hadronic/models/de_excitation/util/src/G4CameronShellPlusPairingCorrections.cc

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4CameronShellPlusPairingCorrections.cc,v 1.6 2009/11/30 10:33:33 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4CameronShellPlusPairingCorrections.cc,v 1.7 2010/11/15 16:09:46 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    9797G4CameronShellPlusPairingCorrections* G4CameronShellPlusPairingCorrections::GetInstance()
    9898{
    99   static G4CameronShellPlusPairingCorrections theCorrections;
    100   if (!theInstance)  { theInstance = &theCorrections; }
     99  if (!theInstance)  {
     100    static G4CameronShellPlusPairingCorrections theCorrections;
     101    theInstance = &theCorrections;
     102  }
    101103  return theInstance;
    102104}
  • trunk/source/processes/hadronic/models/de_excitation/util/src/G4CameronTruranHilfPairingCorrections.cc

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4CameronTruranHilfPairingCorrections.cc,v 1.6 2009/11/30 10:33:33 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4CameronTruranHilfPairingCorrections.cc,v 1.7 2010/11/15 16:09:46 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    8484G4CameronTruranHilfPairingCorrections* G4CameronTruranHilfPairingCorrections::GetInstance()
    8585{
    86   static G4CameronTruranHilfPairingCorrections theCorrections;
    87   if (!theInstance)  { theInstance = &theCorrections; }
     86  if (!theInstance)  {
     87    static G4CameronTruranHilfPairingCorrections theCorrections;
     88    theInstance = &theCorrections;
     89  }
    8890  return theInstance;
    8991}
  • trunk/source/processes/hadronic/models/de_excitation/util/src/G4CameronTruranHilfShellCorrections.cc

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4CameronTruranHilfShellCorrections.cc,v 1.6 2009/11/30 10:33:33 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4CameronTruranHilfShellCorrections.cc,v 1.7 2010/11/15 16:09:46 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    8686G4CameronTruranHilfShellCorrections* G4CameronTruranHilfShellCorrections::GetInstance()
    8787{
    88   static G4CameronTruranHilfShellCorrections theCorrections;
    89   if (!theInstance)  { theInstance = &theCorrections; }
     88  if (!theInstance)  {
     89    static G4CameronTruranHilfShellCorrections theCorrections;
     90    theInstance = &theCorrections;
     91  }
    9092  return theInstance;
    9193}
  • trunk/source/processes/hadronic/models/de_excitation/util/src/G4ConstantLevelDensityParameter.cc

    r1055 r1347  
    3535#include "G4HadronicException.hh"
    3636
    37 G4ConstantLevelDensityParameter::
    38 G4ConstantLevelDensityParameter(const G4ConstantLevelDensityParameter& ) :
    39  G4VLevelDensityParameter(),  EvapLevelDensityParameter(0.125*(1./MeV))
    40 {
    41   throw G4HadronicException(__FILE__, __LINE__, "G4ConstantLevelDensityParameter::copy_constructor meant to not be accessable");
    42 }
     37G4ConstantLevelDensityParameter::G4ConstantLevelDensityParameter()
     38  :  EvapLevelDensityParameter(0.125/MeV)
     39{}
    4340
    4441G4ConstantLevelDensityParameter::~G4ConstantLevelDensityParameter()
    45 {
    46 }
     42{}
    4743
    48 const G4ConstantLevelDensityParameter & G4ConstantLevelDensityParameter::
    49 operator=(const G4ConstantLevelDensityParameter &)
    50 {
    51   throw G4HadronicException(__FILE__, __LINE__, "G4ConstantLevelDensityParameter::operator= meant to not be accessable");
    52   return *this;
    53 }
    54 
    55 
    56 G4bool G4ConstantLevelDensityParameter::operator==(const G4ConstantLevelDensityParameter &) const
    57 {
    58   return false;
    59 }
    60 
    61 G4bool G4ConstantLevelDensityParameter::operator!=(const G4ConstantLevelDensityParameter &) const
    62 {
    63   return true;
    64 }
    65 
    66 
    67 
    68 
    69 
  • trunk/source/processes/hadronic/models/de_excitation/util/src/G4CookPairingCorrections.cc

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4CookPairingCorrections.cc,v 1.6 2009/11/30 10:33:33 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4CookPairingCorrections.cc,v 1.7 2010/11/15 16:09:46 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    7878G4CookPairingCorrections* G4CookPairingCorrections::GetInstance()
    7979{
    80   static G4CookPairingCorrections theCorrections;
    81   if (!theInstance)  { theInstance = &theCorrections; }
     80  if (!theInstance)  {
     81    static G4CookPairingCorrections theCorrections;
     82    theInstance = &theCorrections;
     83  }
    8284  return theInstance;
    8385}
  • trunk/source/processes/hadronic/models/de_excitation/util/src/G4CookShellCorrections.cc

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4CookShellCorrections.cc,v 1.6 2009/11/30 10:33:33 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4CookShellCorrections.cc,v 1.7 2010/11/15 16:09:46 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    7878G4CookShellCorrections* G4CookShellCorrections::GetInstance()
    7979{
    80   static G4CookShellCorrections theCorrections;
    81   if (!theInstance)  { theInstance = &theCorrections; }
     80  if (!theInstance) {
     81    static G4CookShellCorrections theCorrections;
     82    theInstance = &theCorrections;
     83  }
    8284  return theInstance;
    8385}
  • trunk/source/processes/hadronic/models/de_excitation/util/src/G4CoulombBarrier.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4CoulombBarrier.cc,v 1.9 2009/03/04 11:05:02 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     26// $Id: G4CoulombBarrier.cc,v 1.10 2010/11/15 12:44:06 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2928//
    3029// Hadronic Process: Nuclear De-excitations
    3130// by V. Lara (Dec 1999)
    32 // modified barrier by JMQ (test30) by 14-11-07
     31//
     32// 14-11-2007 modified barrier by JMQ (test30)
     33// 15-11-2010 V.Ivanchenko use G4Pow and cleanup
    3334
    3435#include "G4CoulombBarrier.hh"
    3536#include "G4HadronicException.hh"
     37#include "G4Pow.hh"
    3638#include <sstream>
    3739
    38 G4CoulombBarrier::G4CoulombBarrier()
    39   : G4VCoulombBarrier(1,0) {}
     40G4CoulombBarrier::G4CoulombBarrier(): G4VCoulombBarrier(1,0)
     41{}
    4042
    41 G4CoulombBarrier::G4CoulombBarrier(const G4int anA,const G4int aZ)
    42   : G4VCoulombBarrier(anA,aZ) {}
     43G4CoulombBarrier::G4CoulombBarrier(G4int anA, G4int aZ)
     44  : G4VCoulombBarrier(anA,aZ)
     45{}
    4346
    44 G4CoulombBarrier::~G4CoulombBarrier() {}
     47G4CoulombBarrier::~G4CoulombBarrier()
     48{}
    4549
    46 G4CoulombBarrier::G4CoulombBarrier(const G4CoulombBarrier & ) : G4VCoulombBarrier()
     50G4double G4CoulombBarrier::BarrierPenetrationFactor(G4double ) const
    4751{
    48   throw G4HadronicException(__FILE__, __LINE__, "G4CoulombBarrier::copy_constructor meant to not be accessable.");
     52  return 1.0;
    4953}
    50 
    51 
    52 const G4CoulombBarrier & G4CoulombBarrier::operator=(const G4CoulombBarrier & )
    53 {
    54   throw G4HadronicException(__FILE__, __LINE__, "G4CoulombBarrier::operator= meant to not be accessable.");
    55   return *this;
    56 }
    57 
    58 G4bool G4CoulombBarrier::operator==(const G4CoulombBarrier & ) const
    59 {
    60   return false;
    61 }
    62 
    63 G4bool G4CoulombBarrier::operator!=(const G4CoulombBarrier & ) const
    64 {
    65   return true;
    66 }
    67 
    68 
    6954
    7055G4double G4CoulombBarrier::GetCoulombBarrier(const G4int ARes, const G4int ZRes, const G4double) const
     
    8570  } else {
    8671
    87 // JMQ: old coulomb barrier commented since it does not agree with Dostrovski's prescription
    88 // and too low  barriers are obtained (for protons at least)
    89 // calculation of K penetration factor is correct
    90 //    G4double CompoundRadius = CalcCompoundRadius(static_cast<G4double>(ZRes));
    91 //    Barrier = elm_coupling/CompoundRadius * static_cast<G4double>(GetZ())*static_cast<G4double>(ZRes)/
    92 //      (std::pow(static_cast<G4double>(GetA()),1./3.) + std::pow(static_cast<G4double>(ARes),1./3.));
     72    // JMQ: old coulomb barrier commented since it does not agree with Dostrovski's prescription
     73    // and too low  barriers are obtained (for protons at least)
     74    // calculation of K penetration factor is correct
     75    //    G4double CompoundRadius = CalcCompoundRadius(static_cast<G4double>(ZRes));
     76    //    Barrier = elm_coupling/CompoundRadius * static_cast<G4double>(GetZ())*static_cast<G4double>(ZRes)/
     77    //      (std::pow(static_cast<G4double>(GetA()),1./3.) + std::pow(static_cast<G4double>(ARes),1./3.));
    9378
    94 ///New coulomb Barrier according to original Dostrovski's paper
    95    G4double rho=1.2*fermi;
    96    if(GetA()==1 && GetZ()==1){  rho=0.0;} 
     79    ///New coulomb Barrier according to original Dostrovski's paper
     80    G4double rho=1.2*fermi;
     81    if(GetA()==1 && GetZ()==1){  rho=0.0;} 
    9782
    98    G4double RN=1.5*fermi; 
    99 Barrier=elm_coupling* static_cast<G4double>(GetZ())*static_cast<G4double>(ZRes)/(RN*std::pow(static_cast<G4double>(ARes),1./3.)+rho);
     83    G4double RN=1.5*fermi; 
     84    // VI cleanup
     85    Barrier=elm_coupling*(GetZ()*ZRes)/(RN * G4Pow::GetInstance()->Z13(ARes) + rho);
    10086
    10187    // Barrier penetration coeficient
    10288    G4double K = BarrierPenetrationFactor(ZRes);
    10389
    104 
    10590    Barrier *= K;
    106 //
    107 
    108        
    109 
    11091               
    111 // JMQ : the following statement has unknown origin and dimensionally is meaningless( energy divided by mass number in argument of sqrt function). Energy dependence of Coulomb barrier penetrability should be included in proper way (if needed..)
    112 //   Barrier /= (1.0 + std::sqrt(U/(2.0*static_cast<G4double>(ARes))));
    113 //
     92    // JMQ : the following statement has unknown origin and dimensionally is meaningless( energy divided by mass number in argument of sqrt function). Energy dependence of Coulomb barrier penetrability should be included in proper way (if needed..)
     93    //   Barrier /= (1.0 + std::sqrt(U/(2.0*static_cast<G4double>(ARes))));
     94    //
    11495  }
    11596  return Barrier;
  • trunk/source/processes/hadronic/models/de_excitation/util/src/G4DeuteronCoulombBarrier.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4DeuteronCoulombBarrier.cc,v 1.5 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     26// $Id: G4DeuteronCoulombBarrier.cc,v 1.6 2010/11/15 12:44:06 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2928//
    3029// Hadronic Process: Nuclear De-excitations
     
    3433#include "G4DeuteronCoulombBarrier.hh"
    3534
    36 G4DeuteronCoulombBarrier::G4DeuteronCoulombBarrier(const G4DeuteronCoulombBarrier & ) : G4CoulombBarrier()
    37 {
    38     throw G4HadronicException(__FILE__, __LINE__, "G4DeuteronCoulombBarrier::copy_constructor meant to not be accessable.");
    39 }
     35G4DeuteronCoulombBarrier::G4DeuteronCoulombBarrier() : G4CoulombBarrier(2,1) {}
     36G4DeuteronCoulombBarrier::~G4DeuteronCoulombBarrier() {}
    4037
    41 
    42 const G4DeuteronCoulombBarrier & G4DeuteronCoulombBarrier::operator=(const G4DeuteronCoulombBarrier & )
    43 {
    44     throw G4HadronicException(__FILE__, __LINE__, "G4DeuteronCoulombBarrier::operator= meant to not be accessable.");
    45     return *this;
    46 }
    47 
    48 G4bool G4DeuteronCoulombBarrier::operator==(const G4DeuteronCoulombBarrier & ) const
    49 {
    50     return false;
    51 }
    52 
    53 G4bool G4DeuteronCoulombBarrier::operator!=(const G4DeuteronCoulombBarrier & ) const
    54 {
    55     return true;
    56 }
    57 
    58 
    59 G4double G4DeuteronCoulombBarrier::BarrierPenetrationFactor(const G4double aZ) const
     38G4double G4DeuteronCoulombBarrier::BarrierPenetrationFactor(G4double aZ) const
    6039{
    6140    // Data comes from
  • trunk/source/processes/hadronic/models/de_excitation/util/src/G4EvaporationLevelDensityParameter.cc

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4EvaporationLevelDensityParameter.cc,v 1.9 2009/03/04 11:05:02 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4EvaporationLevelDensityParameter.cc,v 1.10 2010/11/15 16:09:46 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    4242
    4343//JMQ 17-04-08 these are not used at present in G4Evaporation
    44 const G4double G4EvaporationLevelDensityParameter::ConstEvapLevelDensityParameter = 0.125*(1./MeV);
    45 //const G4double G4EvaporationLevelDensityParameter::ConstEvapLevelDensityParameter= 0.0769231*(1./MeV);
    46 const G4double G4EvaporationLevelDensityParameter::alpha = 0.072*(1./MeV);
    47 const G4double G4EvaporationLevelDensityParameter::beta = 0.257*(1./MeV);
    48 const G4double G4EvaporationLevelDensityParameter::gamma = 0.059*(1./MeV);
     44const G4double G4EvaporationLevelDensityParameter::ConstEvapLevelDensityParameter = 0.125/MeV;
     45//const G4double G4EvaporationLevelDensityParameter::ConstEvapLevelDensityParameter= 0.0769231/MeV;
     46const G4double G4EvaporationLevelDensityParameter::alpha = 0.072/MeV;
     47const G4double G4EvaporationLevelDensityParameter::beta = 0.257/MeV;
     48const G4double G4EvaporationLevelDensityParameter::gamma = 0.059/MeV;
    4949const G4double G4EvaporationLevelDensityParameter::Bs = 1.0;
    5050
     
    5252G4EvaporationLevelDensityParameter::~G4EvaporationLevelDensityParameter() {}
    5353
    54 G4EvaporationLevelDensityParameter::
    55 G4EvaporationLevelDensityParameter(const G4EvaporationLevelDensityParameter &) : G4VLevelDensityParameter()
    56 {
    57     throw G4HadronicException(__FILE__, __LINE__, "G4EvaporationLevelDensityParameter::copy_constructor meant to not be accessable");
    58 }
    59 
    60 
    61 const G4EvaporationLevelDensityParameter & G4EvaporationLevelDensityParameter::
    62 operator=(const G4EvaporationLevelDensityParameter &)
    63 {
    64     throw G4HadronicException(__FILE__, __LINE__, "G4EvaporationLevelDensityParameter::operator= meant to not be accessable");
    65     return *this;
    66 }
    67 
    68 
    69 G4bool G4EvaporationLevelDensityParameter::operator==(const G4EvaporationLevelDensityParameter &) const
    70 {
    71     return false;
    72 }
    73 
    74 G4bool G4EvaporationLevelDensityParameter::operator!=(const G4EvaporationLevelDensityParameter &) const
    75 {
    76     return true;
    77 }
    78 
    79 G4double G4EvaporationLevelDensityParameter::LevelDensityParameter(const G4int A,const G4int,
    80                                                                    const G4double) const
     54G4double
     55G4EvaporationLevelDensityParameter::LevelDensityParameter(G4int A, G4int, G4double) const
    8156//JMQ (Apr .08) this is the method used in G4Evaporation
    8257{
    8358
    84 //JMQ 25/04/08  a=A/10 according to original Gudima's prescription
    85  G4double a=static_cast<G4double>(A)/10.;
    86     return a;
     59  //JMQ 25/04/08  a=A/10 according to original Gudima's prescription
     60  G4double a=static_cast<G4double>(A)/10.;
     61  return a;
    8762//
    8863
  • trunk/source/processes/hadronic/models/de_excitation/util/src/G4He3CoulombBarrier.cc

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4He3CoulombBarrier.cc,v 1.5 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4He3CoulombBarrier.cc,v 1.6 2010/11/15 12:44:06 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    3434#include "G4He3CoulombBarrier.hh"
    3535
    36 G4He3CoulombBarrier::G4He3CoulombBarrier(const G4He3CoulombBarrier & ) : G4CoulombBarrier()
    37 {
    38     throw G4HadronicException(__FILE__, __LINE__, "G4He3CoulombBarrier::copy_constructor meant to not be accessable.");
    39 }
     36G4He3CoulombBarrier::G4He3CoulombBarrier() : G4CoulombBarrier(3,2) {}
     37G4He3CoulombBarrier::~G4He3CoulombBarrier() {}
    4038
    41 
    42 const G4He3CoulombBarrier & G4He3CoulombBarrier::operator=(const G4He3CoulombBarrier & )
    43 {
    44     throw G4HadronicException(__FILE__, __LINE__, "G4He3CoulombBarrier::operator= meant to not be accessable.");
    45     return *this;
    46 }
    47 
    48 G4bool G4He3CoulombBarrier::operator==(const G4He3CoulombBarrier & ) const
    49 {
    50     return false;
    51 }
    52 
    53 G4bool G4He3CoulombBarrier::operator!=(const G4He3CoulombBarrier & ) const
    54 {
    55     return true;
    56 }
    57 
    58 
    59 G4double G4He3CoulombBarrier::BarrierPenetrationFactor(const G4double aZ) const
     39G4double G4He3CoulombBarrier::BarrierPenetrationFactor(G4double aZ) const
    6040{
    6141    // Data comes from
  • trunk/source/processes/hadronic/models/de_excitation/util/src/G4NeutronCoulombBarrier.cc

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4NeutronCoulombBarrier.cc,v 1.5 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4NeutronCoulombBarrier.cc,v 1.6 2010/11/15 12:44:06 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
     
    3434#include "G4NeutronCoulombBarrier.hh"
    3535
    36 G4NeutronCoulombBarrier::G4NeutronCoulombBarrier(const G4NeutronCoulombBarrier & ) : G4CoulombBarrier()
    37 {
    38     throw G4HadronicException(__FILE__, __LINE__, "G4NeutronCoulombBarrier::copy_constructor meant to not be accessable.");
    39 }
     36G4NeutronCoulombBarrier::G4NeutronCoulombBarrier() : G4CoulombBarrier(1,0) {}
     37G4NeutronCoulombBarrier::~G4NeutronCoulombBarrier() {}
    4038
    4139
    42 const G4NeutronCoulombBarrier & G4NeutronCoulombBarrier::operator=(const G4NeutronCoulombBarrier & )
    43 {
    44     throw G4HadronicException(__FILE__, __LINE__, "G4NeutronCoulombBarrier::operator= meant to not be accessable.");
    45     return *this;
    46 }
    47 
    48 G4bool G4NeutronCoulombBarrier::operator==(const G4NeutronCoulombBarrier & ) const
    49 {
    50     return false;
    51 }
    52 
    53 G4bool G4NeutronCoulombBarrier::operator!=(const G4NeutronCoulombBarrier & ) const
    54 {
    55     return true;
    56 }
    57 
  • trunk/source/processes/hadronic/models/de_excitation/util/src/G4PairingCorrection.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4PairingCorrection.cc,v 1.6 2009/11/30 10:33:33 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     26// $Id: G4PairingCorrection.cc,v 1.8 2010/11/15 12:41:58 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2928//
    3029// Hadronic Process: Nuclear De-excitations
     
    3332
    3433#include "G4PairingCorrection.hh"
    35 
    3634
    3735G4PairingCorrection* G4PairingCorrection::theInstance = 0;
     
    4947G4PairingCorrection* G4PairingCorrection::GetInstance()
    5048{
    51   static G4PairingCorrection theCorrections;
    52   if (!theInstance)  { theInstance = &theCorrections; }
     49  if (!theInstance)  {
     50    static G4PairingCorrection theCorrections;
     51    theInstance = &theCorrections;
     52  }
    5353  return theInstance;
    5454}   
     55
     56G4double G4PairingCorrection::GetPairingCorrection(G4int A, G4int Z) const
     57{
     58  G4double PCorrection = 0.0;
     59  G4int N = A - Z;
     60  if (theCookPairingCorrections->IsInTableThisN(N) &&
     61      theCookPairingCorrections->IsInTableThisZ(Z))
     62    PCorrection = theCookPairingCorrections->GetParingCorrection(A,Z);
     63  else if (theCameronGilbertPairingCorrections->IsInTableThisN(N) &&
     64           theCameronGilbertPairingCorrections->IsInTableThisZ(Z))
     65    PCorrection = theCameronGilbertPairingCorrections->GetPairingCorrection(A,Z);
     66  else {
     67    const G4double PairingConstant = 12.0*MeV;
     68    G4double Pair = (1 - Z + 2*(Z/2)) + (1 - N + 2*(N/2));
     69    PCorrection = Pair*PairingConstant/std::sqrt(static_cast<G4double>(A));
     70  }
     71  return std::max(PCorrection,0.0);
     72}
     73
     74
     75G4double G4PairingCorrection::GetFissionPairingCorrection(G4int A, G4int Z) const
     76{
     77  const G4double PairingConstant = 14.0*MeV;
     78  G4int N = A - Z;
     79  G4double Pair = (1 - Z + 2*(Z/2)) + (1 - N + 2*(N/2));
     80  G4double PCorrection = Pair*PairingConstant/std::sqrt(static_cast<G4double>(A));
     81  return PCorrection;
     82}
  • trunk/source/processes/hadronic/models/de_excitation/util/src/G4ProtonCoulombBarrier.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4ProtonCoulombBarrier.cc,v 1.5 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     26// $Id: G4ProtonCoulombBarrier.cc,v 1.6 2010/11/15 12:44:06 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2928//
    3029// Hadronic Process: Nuclear De-excitations
     
    3433#include "G4ProtonCoulombBarrier.hh"
    3534
    36 G4ProtonCoulombBarrier::G4ProtonCoulombBarrier(const G4ProtonCoulombBarrier & ) : G4CoulombBarrier()
    37 {
    38     throw G4HadronicException(__FILE__, __LINE__, "G4ProtonCoulombBarrier::copy_constructor meant to not be accessable.");
    39 }
     35G4ProtonCoulombBarrier::G4ProtonCoulombBarrier() : G4CoulombBarrier(1,1)
     36{}
    4037
     38G4ProtonCoulombBarrier::~G4ProtonCoulombBarrier()
     39{}
    4140
    42 const G4ProtonCoulombBarrier & G4ProtonCoulombBarrier::operator=(const G4ProtonCoulombBarrier & )
    43 {
    44     throw G4HadronicException(__FILE__, __LINE__, "G4ProtonCoulombBarrier::operator= meant to not be accessable.");
    45     return *this;
    46 }
    47 
    48 G4bool G4ProtonCoulombBarrier::operator==(const G4ProtonCoulombBarrier & ) const
    49 {
    50     return false;
    51 }
    52 
    53 G4bool G4ProtonCoulombBarrier::operator!=(const G4ProtonCoulombBarrier & ) const
    54 {
    55     return true;
    56 }
    57 
    58 
    59 G4double G4ProtonCoulombBarrier::BarrierPenetrationFactor(const G4double aZ) const
     41G4double G4ProtonCoulombBarrier::BarrierPenetrationFactor(G4double aZ) const
    6042{
    6143    // Data comes from
  • trunk/source/processes/hadronic/models/de_excitation/util/src/G4ShellCorrection.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4ShellCorrection.cc,v 1.6 2009/11/30 10:33:33 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     26// $Id: G4ShellCorrection.cc,v 1.7 2010/11/15 11:47:18 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2928//
    3029// Hadronic Process: Nuclear De-excitations
    3130// by V. Lara
    32 
     31//
    3332
    3433#include "G4ShellCorrection.hh"
     
    5049G4ShellCorrection* G4ShellCorrection::GetInstance()
    5150{
    52   static G4ShellCorrection theCorrections;
    53   if (!theInstance)  { theInstance = &theCorrections; }
     51  if (!theInstance)  {
     52    static G4ShellCorrection theCorrections;
     53    theInstance = &theCorrections;
     54  }
    5455  return theInstance;
    5556}   
  • trunk/source/processes/hadronic/models/de_excitation/util/src/G4TritonCoulombBarrier.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4TritonCoulombBarrier.cc,v 1.5 2008/09/19 13:32:54 ahoward Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     26// $Id: G4TritonCoulombBarrier.cc,v 1.6 2010/11/15 12:44:06 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2928//
    3029// Hadronic Process: Nuclear De-excitations
     
    3433#include "G4TritonCoulombBarrier.hh"
    3534
    36 G4TritonCoulombBarrier::G4TritonCoulombBarrier(const G4TritonCoulombBarrier & ) : G4CoulombBarrier()
    37 {
    38     throw G4HadronicException(__FILE__, __LINE__, "G4TritonCoulombBarrier::copy_constructor meant to not be accessable.");
    39 }
     35G4TritonCoulombBarrier::G4TritonCoulombBarrier() : G4CoulombBarrier(3,1) {}
     36G4TritonCoulombBarrier::~G4TritonCoulombBarrier() {}
    4037
    41 
    42 const G4TritonCoulombBarrier & G4TritonCoulombBarrier::operator=(const G4TritonCoulombBarrier & )
    43 {
    44     throw G4HadronicException(__FILE__, __LINE__, "G4TritonCoulombBarrier::operator= meant to not be accessable.");
    45     return *this;
    46 }
    47 
    48 G4bool G4TritonCoulombBarrier::operator==(const G4TritonCoulombBarrier & ) const
    49 {
    50     return false;
    51 }
    52 
    53 G4bool G4TritonCoulombBarrier::operator!=(const G4TritonCoulombBarrier & ) const
    54 {
    55     return true;
    56 }
    57 
    58 
    59 G4double G4TritonCoulombBarrier::BarrierPenetrationFactor(const G4double aZ) const
     38G4double G4TritonCoulombBarrier::BarrierPenetrationFactor(G4double aZ) const
    6039{
    6140    // Data comes from
  • trunk/source/processes/hadronic/models/de_excitation/util/src/G4VEmissionProbability.cc

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4VEmissionProbability.cc,v 1.7 2009/03/04 11:05:02 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4VEmissionProbability.cc,v 1.10 2010/11/15 20:30:26 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Hadronic Process: Nuclear De-excitations
    3131// by V. Lara (Oct 1998)
    3232//
    33 
     33// Modifications:
     34// 28.10.2010 V.Ivanchenko defined members in constructor and cleaned up
    3435
    3536#include "G4VEmissionProbability.hh"
    36 #include "G4HadronicException.hh"
    3737
    38 
    39 G4VEmissionProbability::G4VEmissionProbability() {}
    40 G4VEmissionProbability::~G4VEmissionProbability() {}
    41 
    42 
    43 G4VEmissionProbability::G4VEmissionProbability(const G4VEmissionProbability &)
     38G4VEmissionProbability::G4VEmissionProbability():OPTxs(3),useSICB(false)
    4439{
    45     throw G4HadronicException(__FILE__, __LINE__, "G4VEmissionProbability::copy_constructor meant to not be accessable");
     40  fG4pow = G4Pow::GetInstance();
     41  fPairCorr = G4PairingCorrection::GetInstance();
     42  theEvapLDPptr = new G4EvaporationLevelDensityParameter;
    4643}
    4744
    48 
    49 const G4VEmissionProbability & G4VEmissionProbability::operator=(const G4VEmissionProbability &)
     45G4VEmissionProbability::~G4VEmissionProbability()
    5046{
    51     throw G4HadronicException(__FILE__, __LINE__, "G4VEmissionProbability::operator= meant to not be accessable");
    52     return *this;
     47  delete theEvapLDPptr;
    5348}
    54 
    55 
    56 G4bool G4VEmissionProbability::operator==(const G4VEmissionProbability &) const
    57 {
    58     return false;
    59 }
    60 
    61 G4bool G4VEmissionProbability::operator!=(const G4VEmissionProbability &) const
    62 {
    63     return true;
    64 }
    65 
    66 
    67 
    68 
    69 
  • trunk/source/processes/hadronic/models/high_energy/History

    r1315 r1347  
    1414  * Please list in reverse chronological order (last date on top)
    1515  ---------------------------------------------------------------
     16
     17 3 Dec 2010 - Dennis Wright (hadr-hep-V09-03-03)
     18------------------------------------------------
     19- more CoVerity bug fixes in G4HEInelastic.cc :
     20  array overrun in method QuasiElasticScattering (change pvmx[4] to
     21    pvmx[0]
     22  dead code due to bools dummy and dum always being false
     23  memory leak in methods HighEnergyCascading, MediumEnergyCascading,
     24    QuasiElasticScattering
     25  use of loop variable outside of for loop
     26
     2727 Nov 2010 - Dennis Wright (hadr-hep-V09-03-02)
     28------------------------------------------------
     29- more CoVerity bug fixes:  G4HEInelastic.hh (init verboseLevel),
     30- make incidentParticle and targetParticle args const &
     31
     3212 Nov 2010 - Dennis Wright (hadr-hep-V09-03-01)
     33------------------------------------------------
     34- Fix uninitialized variable (vecLength = 0) in header files of
     35    G4HEAntiLambdaInelastic, G4HEAntiNeutronInelastic
     36    G4HEAntiOmegaMinusInelastic, G4HEAntiProtonInelastic
     37    G4HEAntiSigmaMinusInelastic, G4HEAntiSigmaPlusInelastic
     38    G4HEAntiXiMinusInelastic, G4HEAntiXiZeroInelastic
     39    G4HEKaonMinusInelastic, G4HEKaonPlusInelastic
     40    G4HEKaonZeroInelastic, G4HELambdaInelastic
     41    G4HENeutronInelastic,  G4HEOmegaMinusInelastic
     42    G4HEPionMinusInelastic,  G4HEPionPlusInelastic
     43    G4HEProtonInelastic,  G4HESigmaMinusInelastic
     44    G4HESigmaPlusInelastic,  G4HEXiMinusInelastic
     45    G4HEXiZeroInelastic
     46  and remove dead code in .cc files of above
     47
     48- Fix uninitialized variable (MAXPART = 0) in header file of
     49    G4HEInelastic
     50- Initialize theQuarkContent and theAntiQuarkContent
     51    in G4HEVector.hh
    1652
    175323 Jan 2010 - Dennis Wright (hadr-hep-V09-03-00)
  • trunk/source/processes/hadronic/models/high_energy/include/G4HEAntiKaonZeroInelastic.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4HEAntiKaonZeroInelastic.hh,v 1.14 2007/04/11 18:11:30 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4HEAntiKaonZeroInelastic.hh,v 1.15 2010/11/27 02:02:19 dennis Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030//
     
    5757   G4HEAntiKaonZeroInelastic() : G4HEInelastic("G4HEAntiKaonZeroInelastic")
    5858   {
    59      theMinEnergy =  20*GeV;
     59     theMinEnergy = 20*GeV;
    6060     theMaxEnergy = 10*TeV;
    6161     MAXPART      = 2048;
     
    6767   G4int vecLength;
    6868       
    69    G4HadFinalState * ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus );
     69   G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,
     70                                  G4Nucleus& targetNucleus);
    7071
    71    G4int  GetNumberOfSecondaries()
     72   G4int GetNumberOfSecondaries()
    7273      { return vecLength; }         
    7374
    7475
    75    void   FirstIntInCasAntiKaonZero(G4bool &inElastic, const G4double availableEnergy,
    76                                     G4HEVector pv[],
    77                                     G4int &vecLen,
    78                                     G4HEVector incidentParticle,
    79                                     G4HEVector targetParticle);
     76   void FirstIntInCasAntiKaonZero(G4bool& inElastic,
     77                                  const G4double availableEnergy,
     78                                  G4HEVector pv[],
     79                                  G4int& vecLen,
     80                                  const G4HEVector& incidentParticle,
     81                                  const G4HEVector& targetParticle);
    8082};
    8183#endif                     
    82                                          
    8384
  • trunk/source/processes/hadronic/models/high_energy/include/G4HEAntiLambdaInelastic.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4HEAntiLambdaInelastic.hh,v 1.14 2007/04/11 18:11:30 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4HEAntiLambdaInelastic.hh,v 1.16 2010/11/27 02:02:59 dennis Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030//
     
    5757   G4HEAntiLambdaInelastic() : G4HEInelastic("G4HEAntiLambdaInelastic")
    5858   {
     59     vecLength = 0;
    5960     theMinEnergy =  20*GeV;
    6061     theMaxEnergy = 10*TeV;
     
    6768   G4int vecLength;
    6869       
    69    G4HadFinalState * ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus );
     70   G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,
     71                                  G4Nucleus& targetNucleus);
    7072
    71    G4int  GetNumberOfSecondaries()
    72         { return vecLength; }         
     73   G4int GetNumberOfSecondaries() {return vecLength;}
    7374
    74    void   FirstIntInCasAntiLambda(G4bool &inElastic, const G4double availableEnergy,
    75                                   G4HEVector pv[],
    76                                   G4int &vecLen,
    77                                   G4HEVector incidentParticle,
    78                                   G4HEVector targetParticle,
    79                                   const G4double atomicWeight);
     75   void FirstIntInCasAntiLambda(G4bool& inElastic,
     76                                const G4double availableEnergy,
     77                                G4HEVector pv[],
     78                                G4int& vecLen,
     79                                const G4HEVector& incidentParticle,
     80                                const G4HEVector& targetParticle,
     81                                const G4double atomicWeight);
    8082};
    8183#endif                     
  • trunk/source/processes/hadronic/models/high_energy/include/G4HEAntiNeutronInelastic.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4HEAntiNeutronInelastic.hh,v 1.14 2007/04/11 18:11:30 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4HEAntiNeutronInelastic.hh,v 1.16 2010/11/29 05:45:06 dennis Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030//
     
    5757   G4HEAntiNeutronInelastic() : G4HEInelastic("G4HEAntiNeutronInelastic")
    5858   {
     59     vecLength = 0;
    5960     theMinEnergy =  20*GeV;
    6061     theMaxEnergy = 10*TeV;
     
    6768   G4int vecLength;
    6869       
    69    G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus);
     70   G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack,
     71                                  G4Nucleus &targetNucleus);
    7072
    71    G4int GetNumberOfSecondaries()
    72         { return vecLength; }         
     73   G4int GetNumberOfSecondaries() {return vecLength;}         
    7374
    74    void FirstIntInCasAntiNeutron(G4bool &inElastic, const G4double availableEnergy,
     75   void FirstIntInCasAntiNeutron(G4bool &inElastic,
     76                                 const G4double availableEnergy,
    7577                                 G4HEVector pv[],
    7678                                 G4int &vecLen,
    77                                  G4HEVector incidentParticle,
    78                                  G4HEVector targetParticle,
     79                                 const G4HEVector& incidentParticle,
     80                                 const G4HEVector& targetParticle,
    7981                                 const G4double atomicWeight);
    8082};
  • trunk/source/processes/hadronic/models/high_energy/include/G4HEAntiOmegaMinusInelastic.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4HEAntiOmegaMinusInelastic.hh,v 1.14 2007/04/11 18:11:30 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4HEAntiOmegaMinusInelastic.hh,v 1.16 2010/11/29 05:45:06 dennis Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030//
     
    5757   G4HEAntiOmegaMinusInelastic() : G4HEInelastic("G4HEAntiOmegaMinusInelastic")
    5858   {
     59     vecLength = 0;
    5960     theMinEnergy =  20*GeV;
    6061     theMaxEnergy = 10*TeV;
     
    6768   G4int vecLength;
    6869       
    69    G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus);
     70   G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,
     71                                  G4Nucleus& targetNucleus);
    7072
    71    G4int GetNumberOfSecondaries()
    72        { return vecLength; }         
     73   G4int GetNumberOfSecondaries() {return vecLength;}         
    7374
    74    void FirstIntInCasAntiOmegaMinus(G4bool &inElastic, const G4double availableEnergy,
     75   void FirstIntInCasAntiOmegaMinus(G4bool& inElastic,
     76                                    const G4double availableEnergy,
    7577                                    G4HEVector pv[],
    76                                     G4int &vecLen,
    77                                     G4HEVector incidentParticle,
    78                                     G4HEVector targetParticle,
     78                                    G4int& vecLen,
     79                                    const G4HEVector& incidentParticle,
     80                                    const G4HEVector& targetParticle,
    7981                                    const G4double atomicWeight);
    8082};
    81 #endif                     
    82                                          
     83#endif
    8384
  • trunk/source/processes/hadronic/models/high_energy/include/G4HEAntiProtonInelastic.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4HEAntiProtonInelastic.hh,v 1.15 2007/04/11 18:11:30 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4HEAntiProtonInelastic.hh,v 1.17 2010/11/29 05:45:06 dennis Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030//
     
    5757   G4HEAntiProtonInelastic() : G4HEInelastic("G4HEAntiProtonInelastic")
    5858   {
     59     vecLength = 0;
    5960     theMinEnergy =  20*GeV;
    6061     theMaxEnergy = 10*TeV;
     
    6768   G4int vecLength;
    6869       
    69    G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus);
     70   G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack,
     71                                  G4Nucleus &targetNucleus);
    7072
    71    G4int GetNumberOfSecondaries()
    72       { return vecLength; }         
     73   G4int GetNumberOfSecondaries() {return vecLength;}         
    7374
    74    void FirstIntInCasAntiProton(G4bool &inElastic, const G4double availableEnergy,
     75   void FirstIntInCasAntiProton(G4bool& inElastic,
     76                                const G4double availableEnergy,
    7577                                G4HEVector pv[],
    76                                 G4int &vecLen,
    77                                 G4HEVector incidentParticle,
    78                                 G4HEVector targetParticle,
     78                                G4int& vecLen,
     79                                const G4HEVector& incidentParticle,
     80                                const G4HEVector& targetParticle,
    7981                                const G4double atomicWeight);
    8082};
    81 #endif                     
    82                                          
     83#endif                                   
    8384
  • trunk/source/processes/hadronic/models/high_energy/include/G4HEAntiSigmaMinusInelastic.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4HEAntiSigmaMinusInelastic.hh,v 1.14 2007/04/11 18:11:30 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4HEAntiSigmaMinusInelastic.hh,v 1.16 2010/11/29 05:45:06 dennis Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030//
     
    5757   G4HEAntiSigmaMinusInelastic() : G4HEInelastic("G4HEAntiSigmaMinusInelastic")
    5858   {
     59     vecLength = 0;
    5960     theMinEnergy =  20*GeV;
    6061     theMaxEnergy = 10*TeV;
     
    6768   G4int vecLength;
    6869       
    69    G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus);
     70   G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,
     71                                  G4Nucleus& targetNucleus);
    7072
    71    G4int GetNumberOfSecondaries()
    72       { return vecLength; }         
     73   G4int GetNumberOfSecondaries() {return vecLength;}         
    7374
    74    void FirstIntInCasAntiSigmaMinus(G4bool &inElastic, const G4double availableEnergy,
     75   void FirstIntInCasAntiSigmaMinus(G4bool& inElastic,
     76                                    const G4double availableEnergy,
    7577                                    G4HEVector pv[],
    76                                     G4int &vecLen,
    77                                     G4HEVector incidentParticle,
    78                                     G4HEVector targetParticle,
     78                                    G4int& vecLen,
     79                                    const G4HEVector& incidentParticle,
     80                                    const G4HEVector& targetParticle,
    7981                                    const G4double atomicWeight);
    8082};
    81 #endif                     
    82                                          
     83#endif
    8384
  • trunk/source/processes/hadronic/models/high_energy/include/G4HEAntiSigmaPlusInelastic.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4HEAntiSigmaPlusInelastic.hh,v 1.14 2007/04/11 18:11:30 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4HEAntiSigmaPlusInelastic.hh,v 1.16 2010/11/29 05:45:06 dennis Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030//
     
    5757   G4HEAntiSigmaPlusInelastic() : G4HEInelastic("G4HEAntiSigmaPlusInelastic")
    5858   {
    59      theMinEnergy =  20*GeV;
     59     vecLength = 0;
     60     theMinEnergy = 20*GeV;
    6061     theMaxEnergy = 10*TeV;
    6162     MAXPART      = 2048;
     
    6768   G4int vecLength;
    6869       
    69    G4HadFinalState* ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus );
     70   G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,
     71                                  G4Nucleus& targetNucleus);
    7072
    71    G4int GetNumberOfSecondaries()
    72        { return vecLength; }         
     73   G4int GetNumberOfSecondaries() {return vecLength;}
    7374
    74    void FirstIntInCasAntiSigmaPlus(G4bool &inElastic, const G4double availableEnergy,
     75   void FirstIntInCasAntiSigmaPlus(G4bool& inElastic,
     76                                   const G4double availableEnergy,
    7577                                   G4HEVector pv[],
    76                                    G4int &vecLen,
    77                                    G4HEVector incidentParticle,
    78                                    G4HEVector targetParticle,
     78                                   G4int& vecLen,
     79                                   const G4HEVector& incidentParticle,
     80                                   const G4HEVector& targetParticle,
    7981                                   const G4double atomicWeight);
    8082};
    81 #endif                     
    82                                          
     83#endif
    8384
  • trunk/source/processes/hadronic/models/high_energy/include/G4HEAntiSigmaZeroInelastic.hh

    r1340 r1347  
    2626//
    2727// $Id: G4HEAntiSigmaZeroInelastic.hh,v 1.14 2007/04/11 18:11:30 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030//
  • trunk/source/processes/hadronic/models/high_energy/include/G4HEAntiXiMinusInelastic.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4HEAntiXiMinusInelastic.hh,v 1.14 2007/04/11 18:11:30 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4HEAntiXiMinusInelastic.hh,v 1.16 2010/11/29 05:45:06 dennis Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030//
     
    5757   G4HEAntiXiMinusInelastic() : G4HEInelastic("G4HEAntiXiMinusInelastic")
    5858   {
    59      theMinEnergy =  20*GeV;
     59     vecLength = 0;
     60     theMinEnergy = 20*GeV;
    6061     theMaxEnergy = 10*TeV;
    6162     MAXPART      = 2048;
     
    6768   G4int vecLength;
    6869       
    69    G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus);
     70   G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,
     71                                  G4Nucleus& targetNucleus);
    7072
    71    G4int GetNumberOfSecondaries()
    72         { return vecLength; }         
     73   G4int GetNumberOfSecondaries() {return vecLength;}
    7374
    74    void FirstIntInCasAntiXiMinus(G4bool &inElastic, const G4double availableEnergy,
     75   void FirstIntInCasAntiXiMinus(G4bool& inElastic,
     76                                 const G4double availableEnergy,
    7577                                 G4HEVector pv[],
    76                                  G4int &vecLen,
    77                                  G4HEVector incidentParticle,
    78                                  G4HEVector targetParticle,
     78                                 G4int& vecLen,
     79                                 const G4HEVector& incidentParticle,
     80                                 const G4HEVector& targetParticle,
    7981                                 const G4double atomicWeight);
    8082};
    81 #endif                     
    82                                          
     83#endif
    8384
  • trunk/source/processes/hadronic/models/high_energy/include/G4HEAntiXiZeroInelastic.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4HEAntiXiZeroInelastic.hh,v 1.14 2007/04/11 18:11:30 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4HEAntiXiZeroInelastic.hh,v 1.16 2010/11/29 05:45:06 dennis Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030//
     
    5757   G4HEAntiXiZeroInelastic() : G4HEInelastic("G4HEAntiXiZeroInelastic")
    5858   {
    59      theMinEnergy =  20*GeV;
     59     vecLength = 0;
     60     theMinEnergy = 20*GeV;
    6061     theMaxEnergy = 10*TeV;
    6162     MAXPART      = 2048;
     
    6768   G4int vecLength;
    6869       
    69    G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus);
     70   G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,
     71                                  G4Nucleus& targetNucleus);
    7072
    71    G4int GetNumberOfSecondaries()
    72        { return vecLength; }         
     73   G4int GetNumberOfSecondaries() {return vecLength;}
    7374
    74    void FirstIntInCasAntiXiZero(G4bool &inElastic, const G4double availableEnergy,
     75   void FirstIntInCasAntiXiZero(G4bool& inElastic,
     76                                const G4double availableEnergy,
    7577                                G4HEVector pv[],
    76                                 G4int &vecLen,
    77                                 G4HEVector incidentParticle,
    78                                 G4HEVector targetParticle,
     78                                G4int& vecLen,
     79                                const G4HEVector& incidentParticle,
     80                                const G4HEVector& targetParticle,
    7981                                const G4double atomicWeight);
    8082};
    81 #endif                     
    82                                          
     83#endif
    8384
  • trunk/source/processes/hadronic/models/high_energy/include/G4HEInelastic.hh

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HEInelastic.hh,v 1.14 2007/04/11 18:11:30 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     26// $Id: G4HEInelastic.hh,v 1.17 2010/11/29 05:45:06 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2928//
    3029//
     
    7170   {
    7271     SetParticles();
     72     verboseLevel = 0;
     73     MAXPART = 0;
    7374     conserveEnergy = true;
    7475   };
     
    7677   ~G4HEInelastic(){ };
    7778         
    78    void       SetMaxNumberOfSecondaries( const G4int maxnumber )
    79                    { MAXPART = maxnumber;}     
     79   void SetMaxNumberOfSecondaries(const G4int maxnumber)
     80            {MAXPART = maxnumber;}     
    8081 
    81    void       SetVerboseLevel( const G4int level)
    82                    { verboseLevel = level;}
    83 
    84    G4int      verboseLevel;
    85    G4int      MAXPART;
    86    G4bool     conserveEnergy;
    87 
    88    void       ForceEnergyConservation(G4bool energyConservation)
    89                    { conserveEnergy = energyConservation;}
    90    G4bool     EnergyConservation(void)
    91                    { return conserveEnergy;}
    92 
    93    G4double   Amin(G4double a, G4double b);
    94    G4double   Amax(G4double a, G4double b);
    95    G4int      Imin(G4int a, G4int b);
    96    G4int      Imax(G4int a, G4int b);
     82   void SetVerboseLevel(const G4int level) {verboseLevel = level;}
     83
     84   G4int verboseLevel;
     85   G4int MAXPART;
     86   G4bool conserveEnergy;
     87
     88   void ForceEnergyConservation(G4bool energyConservation)
     89              {conserveEnergy = energyConservation;}
     90
     91   G4bool EnergyConservation(void) {return conserveEnergy;}
     92
     93   G4double Amin(G4double a, G4double b);
     94   G4double Amax(G4double a, G4double b);
     95   G4int Imin(G4int a, G4int b);
     96   G4int Imax(G4int a, G4int b);
    9797 
    98    void       FillParticleChange(G4HEVector pv[], G4int aVecLength);
    99 
    100    G4double   pmltpc(G4int np, G4int nm, G4int nz, G4int n, G4double b, G4double c);
    101 
    102    G4int      Factorial(G4int n);
    103 
    104    G4double   NuclearInelasticity(G4double incidentKineticEnergy,
    105                                   G4double atomicWeight,
    106                                   G4double atomicNumber);
    107    G4double   NuclearExcitation(G4double  incidentKineticEnergy,
    108                                 G4double  atomicWeight,
    109                                 G4double  atomicNumber,
    110                                 G4double& excitationEnergyCascade,
    111                                 G4double& excitationEnergyEvaporation);
     98   void FillParticleChange(G4HEVector pv[], G4int aVecLength);
     99
     100   G4double pmltpc(G4int np, G4int nm, G4int nz,
     101                   G4int n, G4double b, G4double c);
     102
     103   G4int Factorial(G4int n);
     104
     105   G4double NuclearInelasticity(G4double incidentKineticEnergy,
     106                                G4double atomicWeight,
     107                                G4double atomicNumber);
     108
     109   G4double NuclearExcitation(G4double  incidentKineticEnergy,
     110                              G4double  atomicWeight,
     111                              G4double  atomicNumber,
     112                              G4double& excitationEnergyCascade,
     113                              G4double& excitationEnergyEvaporation);
    112114   
    113    void       HighEnergyCascading(G4bool &successful,
    114                                   G4HEVector pv[],
    115                                   G4int &vecLen,
    116                                   G4double &excitationEnergyGNP,
    117                                   G4double &excitationEnergyDTA,
    118                                   G4HEVector incidentParticle,
    119                                   G4HEVector targetParticle,
    120                                   G4double atomicWeight,
    121                                   G4double atomicNumber);                       
    122 
    123    void       HighEnergyClusterProduction(G4bool &successful,
    124                                           G4HEVector pv[],
    125                                           G4int &vecLen,
    126                                           G4double &excitationEnergyGNP,
    127                                           G4double &excitationEnergyDTA,
    128                                           G4HEVector incidentParticle,
    129                                           G4HEVector targetParticle,
    130                                           G4double atomicWeight,
    131                                           G4double atomicNumber);             
    132 
    133    void       TuningOfHighEnergyCascading(G4HEVector pv[],
    134                                           G4int &vecLen,
    135                                           G4HEVector incidentParticle,
    136                                           G4HEVector targetParticle,
    137                                           G4double atomicWeight,
    138                                           G4double atomicNumber);   
    139 
    140    void       MediumEnergyCascading(G4bool &successful,
     115   void HighEnergyCascading(G4bool& successful,
     116                            G4HEVector pv[],
     117                            G4int& vecLen,
     118                            G4double& excitationEnergyGNP,
     119                            G4double& excitationEnergyDTA,
     120                            const G4HEVector& incidentParticle,
     121                            const G4HEVector& targetParticle,
     122                            G4double atomicWeight,
     123                            G4double atomicNumber);
     124
     125   void HighEnergyClusterProduction(G4bool& successful,
    141126                                    G4HEVector pv[],
    142                                     G4int &vecLen,
    143                                     G4double &excitationEnergyGNP,
    144                                     G4double &excitationEnergyDTA,
    145                                     G4HEVector incidentParticle,
    146                                     G4HEVector targetParticle,
     127                                    G4int& vecLen,
     128                                    G4double& excitationEnergyGNP,
     129                                    G4double& excitationEnergyDTA,
     130                                    const G4HEVector& incidentParticle,
     131                                    const G4HEVector& targetParticle,
    147132                                    G4double atomicWeight,
    148                                     G4double atomicNumber);           
    149 
    150    void       MediumEnergyClusterProduction(G4bool &successful,
    151                                             G4HEVector pv[],
    152                                             G4int &vecLen,
    153                                             G4double &excitationEnergyGNP,
    154                                             G4double &excitationEnergyDTA,
    155                                             G4HEVector incidentParticle,
    156                                             G4HEVector targetParticle,
    157                                             G4double atomicWeight,
    158                                             G4double atomicNumber);           
    159 
    160    void       QuasiElasticScattering(G4bool &successful,
    161                                      G4HEVector pv[],
    162                                      G4int &vecLen,
    163                                      G4double &excitationEnergyGNP,
    164                                      G4double &excitationEnergyDTA,
    165                                      G4HEVector incidentParticle,
    166                                      G4HEVector targetParticle,
    167                                      G4double atomicWeight,
    168                                      G4double atomicNumber);
    169 
    170    void       ElasticScattering(G4bool &successful,
    171                                 G4HEVector pv[],
    172                                 G4int &vecLen,                     
    173                                 G4HEVector incidentParticle,
    174                                 G4double atomicWeight,
    175                                 G4double atomicNumber);
    176 
    177    G4int      rtmi(G4double *x, G4double xli, G4double xri, G4double eps,
    178                    G4int iend, G4double aa, G4double bb, G4double cc,
    179                    G4double dd, G4double rr);
    180 
    181    G4double   fctcos(G4double t, G4double aa, G4double bb,G4double cc,
    182                      G4double dd, G4double rr);     
     133                                    G4double atomicNumber);             
     134
     135   void TuningOfHighEnergyCascading(G4HEVector pv[],
     136                                    G4int& vecLen,
     137                                    const G4HEVector& incidentParticle,
     138                                    const G4HEVector& targetParticle,
     139                                    G4double atomicWeight,
     140                                    G4double atomicNumber);   
     141
     142   void MediumEnergyCascading(G4bool& successful,
     143                              G4HEVector pv[],
     144                              G4int& vecLen,
     145                              G4double& excitationEnergyGNP,
     146                              G4double& excitationEnergyDTA,
     147                              const G4HEVector& incidentParticle,
     148                              const G4HEVector& targetParticle,
     149                              G4double atomicWeight,
     150                              G4double atomicNumber);           
     151
     152   void MediumEnergyClusterProduction(G4bool& successful,
     153                                      G4HEVector pv[],
     154                                      G4int& vecLen,
     155                                      G4double& excitationEnergyGNP,
     156                                      G4double& excitationEnergyDTA,
     157                                      const G4HEVector& incidentParticle,
     158                                      const G4HEVector& targetParticle,
     159                                      G4double atomicWeight,
     160                                      G4double atomicNumber);           
     161
     162   void QuasiElasticScattering(G4bool& successful,
     163                               G4HEVector pv[],
     164                               G4int& vecLen,
     165                               G4double& excitationEnergyGNP,
     166                               G4double& excitationEnergyDTA,
     167                               const G4HEVector& incidentParticle,
     168                               const G4HEVector& targetParticle,
     169                               G4double atomicWeight,
     170                               G4double atomicNumber);
     171
     172   void ElasticScattering(G4bool& successful,
     173                          G4HEVector pv[],
     174                          G4int& vecLen,                     
     175                          const G4HEVector& incidentParticle,
     176                          G4double atomicWeight,
     177                          G4double atomicNumber);
     178
     179   G4int rtmi(G4double *x, G4double xli, G4double xri, G4double eps,
     180              G4int iend, G4double aa, G4double bb, G4double cc,
     181              G4double dd, G4double rr);
     182
     183   G4double fctcos(G4double t, G4double aa, G4double bb,G4double cc,
     184                   G4double dd, G4double rr);     
    183185       
    184    void       StrangeParticlePairProduction(const G4double availableEnergy,
    185                                             const G4double centerOfMassEnergy,
    186                                             G4HEVector pv[],
    187                                             G4int &vecLen,
    188                                             G4HEVector incidentParticle,
    189                                             G4HEVector targetParticle);
    190 
    191    G4double   NBodyPhaseSpace(const G4double totalEnergy,
    192                               const G4bool   constantCrossSection,
    193                               G4HEVector pv[],
    194                               G4int &vecLen);
     186   void StrangeParticlePairProduction(const G4double availableEnergy,
     187                                      const G4double centerOfMassEnergy,
     188                                      G4HEVector pv[],
     189                                      G4int& vecLen,
     190                                      const G4HEVector& incidentParticle,
     191                                      const G4HEVector& targetParticle);
     192
     193   G4double NBodyPhaseSpace(const G4double totalEnergy,
     194                            const G4bool   constantCrossSection,
     195                            G4HEVector pv[],
     196                            G4int &vecLen);
    195197     
    196    G4double   NBodyPhaseSpace(G4int npart,
    197                               G4HEVector pv[],
    198                               G4double wmax,
    199                               G4double wfcn,
    200                               G4int maxtrial,
    201                               G4int ntrial);
    202 
    203    G4double   gpdk(G4double a, G4double b, G4double c);
    204 
    205    void       QuickSort(G4double arr[], const G4int lidx, const G4int ridx);
    206 
    207    G4double   Alam(G4double a, G4double b, G4double c);
     198   G4double NBodyPhaseSpace(G4int npart,
     199                            G4HEVector pv[],
     200                            G4double wmax,
     201                            G4double wfcn,
     202                            G4int maxtrial,
     203                            G4int ntrial);
     204
     205   G4double gpdk(G4double a, G4double b, G4double c);
     206
     207   void QuickSort(G4double arr[], const G4int lidx, const G4int ridx);
     208
     209   G4double Alam(G4double a, G4double b, G4double c);
    208210 
    209    G4double   CalculatePhaseSpaceWeight( G4int npart);
     211   G4double CalculatePhaseSpaceWeight( G4int npart);
    210212       
    211    G4double   normal(void);
    212    G4double   GammaRand(G4double avalue);
    213    G4double   Erlang(G4int mvalue);
    214    G4int      Poisson(G4double x);
    215    void       SetParticles(void);
     213   G4double normal(void);
     214   G4double GammaRand(G4double avalue);
     215   G4double Erlang(G4int mvalue);
     216   G4int Poisson(G4double x);
     217   void SetParticles(void);
    216218
    217219   G4HEVector PionPlus;
     
    248250};
    249251
    250 #endif                     
    251                                          
    252 
     252#endif
  • trunk/source/processes/hadronic/models/high_energy/include/G4HEKaonMinusInelastic.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4HEKaonMinusInelastic.hh,v 1.14 2007/04/11 18:11:30 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4HEKaonMinusInelastic.hh,v 1.16 2010/11/29 05:45:06 dennis Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030//
     
    5757   G4HEKaonMinusInelastic() : G4HEInelastic("G4HEKaonMinusInelastic")
    5858   {
    59      theMinEnergy =  20*GeV;
     59     vecLength = 0;
     60     theMinEnergy = 20*GeV;
    6061     theMaxEnergy = 10*TeV;
    6162     MAXPART      = 2048;
     
    6768   G4int vecLength;
    6869       
    69    G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus);
     70   G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,
     71                                  G4Nucleus& targetNucleus);
    7072
    71    G4int GetNumberOfSecondaries()
    72        { return vecLength; }         
     73   G4int GetNumberOfSecondaries() {return vecLength;}
    7374
    74    void FirstIntInCasKaonMinus(G4bool &inElastic, const G4double availableEnergy,
     75   void FirstIntInCasKaonMinus(G4bool& inElastic,
     76                               const G4double availableEnergy,
    7577                               G4HEVector pv[],
    76                                G4int &vecLen,
    77                                G4HEVector incidentParticle,
    78                                G4HEVector targetParticle);
     78                               G4int& vecLen,
     79                               const G4HEVector& incidentParticle,
     80                               const G4HEVector& targetParticle);
    7981};
    80 #endif                     
    81                                          
     82#endif                                   
    8283
  • trunk/source/processes/hadronic/models/high_energy/include/G4HEKaonPlusInelastic.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4HEKaonPlusInelastic.hh,v 1.14 2007/04/11 18:11:30 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4HEKaonPlusInelastic.hh,v 1.16 2010/11/29 05:45:06 dennis Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030//
     
    5757   G4HEKaonPlusInelastic() : G4HEInelastic("G4HEKaonPlusInelastic")
    5858   {
    59      theMinEnergy =  20*GeV;
     59     vecLength = 0;
     60     theMinEnergy = 20*GeV;
    6061     theMaxEnergy = 10*TeV;
    6162     MAXPART      = 2048;
     
    6768   G4int vecLength;
    6869       
    69    G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus);
     70   G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,
     71                                  G4Nucleus& targetNucleus);
    7072
    71    G4int GetNumberOfSecondaries()
    72        { return vecLength; }         
     73   G4int GetNumberOfSecondaries() {return vecLength;}
    7374
    74    void FirstIntInCasKaonPlus(G4bool &inElastic, const G4double availableEnergy,
     75   void FirstIntInCasKaonPlus(G4bool& inElastic,
     76                              const G4double availableEnergy,
    7577                              G4HEVector pv[],
    76                               G4int &vecLen,
    77                               G4HEVector incidentParticle,
    78                               G4HEVector targetParticle,
     78                              G4int& vecLen,
     79                              const G4HEVector& incidentParticle,
     80                              const G4HEVector& targetParticle,
    7981                              const G4double atomicWeight);
    8082};
    81 #endif                     
    82                                          
     83#endif                                   
    8384
  • trunk/source/processes/hadronic/models/high_energy/include/G4HEKaonZeroInelastic.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4HEKaonZeroInelastic.hh,v 1.13 2007/04/11 18:11:30 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4HEKaonZeroInelastic.hh,v 1.15 2010/11/29 05:45:06 dennis Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030//
     
    5757   G4HEKaonZeroInelastic() : G4HEInelastic("G4HEKaonZeroInelastic")
    5858   {
    59      theMinEnergy =  20*GeV;
     59     vecLength = 0;
     60     theMinEnergy = 20*GeV;
    6061     theMaxEnergy = 10*TeV;
    6162     MAXPART      = 2048;
     
    6768   G4int vecLength;
    6869       
    69    G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus);
     70   G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,
     71                                  G4Nucleus& targetNucleus);
    7072
    71    G4int GetNumberOfSecondaries()
    72         { return vecLength; }         
     73   G4int GetNumberOfSecondaries() {return vecLength;}
    7374
    7475
    75    void FirstIntInCasKaonZero(G4bool &inElastic, const G4double availableEnergy,
     76   void FirstIntInCasKaonZero(G4bool& inElastic,
     77                              const G4double availableEnergy,
    7678                              G4HEVector pv[],
    77                               G4int &vecLen,
    78                               G4HEVector incidentParticle,
    79                               G4HEVector targetParticle,
     79                              G4int& vecLen,
     80                              const G4HEVector& incidentParticle,
     81                              const G4HEVector& targetParticle,
    8082                              const G4double atomicWeight);
    8183};
    82 #endif                     
    83                                          
     84#endif                                   
    8485
  • trunk/source/processes/hadronic/models/high_energy/include/G4HEKaonZeroLongInelastic.hh

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4HEKaonZeroLongInelastic.hh,v 1.15 2010/02/09 21:58:09 dennis Exp $
    27 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     26// $Id: G4HEKaonZeroLongInelastic.hh,v 1.16 2010/11/29 05:45:06 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2828//
    2929//
     
    5656   G4HEKaonZeroLongInelastic() : G4HEInelastic("G4HEKaonZeroLongInelastic")
    5757   {
    58      theMinEnergy =  20*GeV;
     58     theMinEnergy = 20*GeV;
    5959     theMaxEnergy = 10*TeV;
    6060     MAXPART      = 2048;
     
    6464   ~G4HEKaonZeroLongInelastic(){ };
    6565         
    66   //   G4int verboseLevel;
    6766   G4int vecLength;
    6867
    69    G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus);
     68   G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,
     69                                  G4Nucleus& targetNucleus);
    7070
    7171   G4int GetNumberOfSecondaries()
    7272        { return vecLength;};           
    7373
    74    void FirstIntInCasKaonZero(G4bool &inElastic, const G4double availableEnergy,
     74   void FirstIntInCasKaonZero(G4bool& inElastic,
     75                              const G4double availableEnergy,
    7576                              G4HEVector pv[],
    76                               G4int &vecLen,
    77                               G4HEVector incidentParticle,
    78                               G4HEVector targetParticle,
     77                              G4int& vecLen,
     78                              const G4HEVector& incidentParticle,
     79                              const G4HEVector& targetParticle,
    7980                              const G4double atomicWeight);
    8081
    81    void FirstIntInCasAntiKaonZero(G4bool &inElastic, const G4double availableEnergy,
     82   void FirstIntInCasAntiKaonZero(G4bool& inElastic,
     83                                  const G4double availableEnergy,
    8284                                  G4HEVector pv[],
    83                                   G4int &vecLen,
    84                                   G4HEVector incidentParticle,
    85                                   G4HEVector targetParticle);
     85                                  G4int& vecLen,
     86                                  const G4HEVector& incidentParticle,
     87                                  const G4HEVector& targetParticle);
     88};
     89#endif
    8690
    87   //   void SetVerboseLevel(G4int verbose)
    88   //        { verboseLevel = verbose;};
    89 
    90 
    91 };
    92 #endif                     
    93                                          
    94 
  • trunk/source/processes/hadronic/models/high_energy/include/G4HEKaonZeroShortInelastic.hh

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4HEKaonZeroShortInelastic.hh,v 1.15 2010/02/09 21:58:33 dennis Exp $
    27 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     26// $Id: G4HEKaonZeroShortInelastic.hh,v 1.16 2010/11/29 05:45:06 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2828//
    2929//
     
    5656   G4HEKaonZeroShortInelastic() : G4HEInelastic("G4HEKaonZeroShortInelastic")
    5757   {
    58      theMinEnergy =  20*GeV;
     58     theMinEnergy = 20*GeV;
    5959     theMaxEnergy = 10*TeV;
    6060     MAXPART      = 2048;
     
    6666   G4int vecLength;
    6767
    68    G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus);
     68   G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,
     69                                  G4Nucleus& targetNucleus);
    6970
    7071   G4int GetNumberOfSecondaries()
    7172        { return vecLength;};           
    7273
    73    void FirstIntInCasKaonZero(G4bool &inElastic, const G4double availableEnergy,
     74   void FirstIntInCasKaonZero(G4bool& inElastic,
     75                              const G4double availableEnergy,
    7476                              G4HEVector pv[],
    75                               G4int &vecLen,
    76                               G4HEVector incidentParticle,
    77                               G4HEVector targetParticle,
     77                              G4int& vecLen,
     78                              const G4HEVector& incidentParticle,
     79                              const G4HEVector& targetParticle,
    7880                              const G4double atomicWeight);
    7981
    80    void FirstIntInCasAntiKaonZero(G4bool &inElastic, const G4double availableEnergy,
     82   void FirstIntInCasAntiKaonZero(G4bool& inElastic,
     83                                  const G4double availableEnergy,
    8184                                  G4HEVector pv[],
    82                                   G4int &vecLen,
    83                                   G4HEVector incidentParticle,
    84                                   G4HEVector targetParticle);
     85                                  G4int& vecLen,
     86                                  const G4HEVector& incidentParticle,
     87                                  const G4HEVector& targetParticle);
     88};
     89#endif
    8590
    86 };
    87 #endif                     
    88                                          
    89 
  • trunk/source/processes/hadronic/models/high_energy/include/G4HELambdaInelastic.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4HELambdaInelastic.hh,v 1.14 2007/04/11 18:11:30 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4HELambdaInelastic.hh,v 1.16 2010/11/29 05:45:06 dennis Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030//
     
    5757   G4HELambdaInelastic() : G4HEInelastic("G4HELambdaInelastic")
    5858   {
    59      theMinEnergy =  20*GeV;
     59     vecLength = 0;
     60     theMinEnergy = 20*GeV;
    6061     theMaxEnergy = 10*TeV;
    6162     MAXPART      = 2048;
     
    6768   G4int vecLength;
    6869       
    69    G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus);
     70   G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,
     71                                  G4Nucleus& targetNucleus);
    7072
    71    G4int GetNumberOfSecondaries()
    72         { return vecLength; }         
     73   G4int GetNumberOfSecondaries() {return vecLength;}
    7374
    74    void FirstIntInCasLambda(G4bool &inElastic, const G4double availableEnergy,
     75   void FirstIntInCasLambda(G4bool& inElastic,
     76                            const G4double availableEnergy,
    7577                            G4HEVector pv[],
    76                             G4int &vecLen,
    77                             G4HEVector incidentParticle,
    78                             G4HEVector targetParticle,
     78                            G4int& vecLen,
     79                            const G4HEVector& incidentParticle,
     80                            const G4HEVector& targetParticle,
    7981                            const G4double atomicWeight);
    8082};
    81 #endif                     
    82                                          
     83#endif
    8384
  • trunk/source/processes/hadronic/models/high_energy/include/G4HENeutronInelastic.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4HENeutronInelastic.hh,v 1.15 2007/04/11 18:11:30 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4HENeutronInelastic.hh,v 1.17 2010/11/29 05:45:06 dennis Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030//
     
    5757  G4HENeutronInelastic() : G4HEInelastic("G4HENeutronInelastic")
    5858  {
    59     theMinEnergy =  45*GeV;
     59    vecLength = 0;
     60    theMinEnergy = 45*GeV;
    6061    theMaxEnergy = 10*TeV;
    6162    MAXPART      = 2048;
     
    6768  G4int vecLength;
    6869       
    69   G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus);
     70  G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,
     71                                 G4Nucleus& targetNucleus);
    7072
    71   G4int GetNumberOfSecondaries()
    72       { return vecLength; }         
     73  G4int GetNumberOfSecondaries() {return vecLength;}
    7374
    74   void FirstIntInCasNeutron(G4bool &inElastic, const G4double availableEnergy,
     75  void FirstIntInCasNeutron(G4bool& inElastic,
     76                            const G4double availableEnergy,
    7577                            G4HEVector pv[],
    76                             G4int &vecLen,
    77                             G4HEVector incidentParticle,
    78                             G4HEVector targetParticle,
     78                            G4int& vecLen,
     79                            const G4HEVector& incidentParticle,
     80                            const G4HEVector& targetParticle,
    7981                            const G4double atomicWeight);
    8082};
    81 #endif                     
    82                                          
     83#endif
    8384
  • trunk/source/processes/hadronic/models/high_energy/include/G4HEOmegaMinusInelastic.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4HEOmegaMinusInelastic.hh,v 1.14 2007/04/11 18:11:30 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4HEOmegaMinusInelastic.hh,v 1.16 2010/11/29 05:45:06 dennis Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030//
     
    5757   G4HEOmegaMinusInelastic() : G4HEInelastic("G4HEOmegaMinusInelastic")
    5858   {
    59      theMinEnergy =  20*GeV;
     59     vecLength = 0;
     60     theMinEnergy = 20*GeV;
    6061     theMaxEnergy = 10*TeV;
    6162     MAXPART      = 2048;
     
    6768   G4int vecLength;
    6869       
    69    G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus);
     70   G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,
     71                                  G4Nucleus& targetNucleus);
    7072
    71    G4int GetNumberOfSecondaries()
    72         { return vecLength; }         
     73   G4int GetNumberOfSecondaries() {return vecLength;}
    7374
    74    void FirstIntInCasOmegaMinus(G4bool &inElastic, const G4double availableEnergy,
     75   void FirstIntInCasOmegaMinus(G4bool& inElastic,
     76                                const G4double availableEnergy,
    7577                                G4HEVector pv[],
    76                                 G4int &vecLen,
    77                                 G4HEVector incidentParticle,
    78                                 G4HEVector targetParticle,
     78                                G4int& vecLen,
     79                                const G4HEVector& incidentParticle,
     80                                const G4HEVector& targetParticle,
    7981                                const G4double atomicWeight);
    8082};
    81 #endif                     
    82                                          
     83#endif
    8384
  • trunk/source/processes/hadronic/models/high_energy/include/G4HEPionMinusInelastic.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4HEPionMinusInelastic.hh,v 1.15 2007/04/11 18:11:30 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4HEPionMinusInelastic.hh,v 1.17 2010/11/29 05:45:06 dennis Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030//
     
    5757   G4HEPionMinusInelastic() : G4HEInelastic("G4HEPionMinusInelastic")
    5858   {
    59      theMinEnergy =  45*GeV;
     59     vecLength = 0;
     60     theMinEnergy = 45*GeV;
    6061     theMaxEnergy = 10*TeV;
    6162     MAXPART      = 2048;
     
    6768   G4int vecLength;
    6869       
    69    G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus);
     70   G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,
     71                                  G4Nucleus& targetNucleus);
    7072
    71    G4int GetNumberOfSecondaries()
    72         { return vecLength; }         
     73   G4int GetNumberOfSecondaries() {return vecLength;}
    7374
    74    void FirstIntInCasPionMinus(G4bool &inElastic, const G4double availableEnergy,
     75   void FirstIntInCasPionMinus(G4bool& inElastic,
     76                               const G4double availableEnergy,
    7577                               G4HEVector pv[],
    76                                G4int &vecLen,
    77                                G4HEVector incidentParticle,
    78                                G4HEVector targetParticle);
     78                               G4int& vecLen,
     79                               const G4HEVector& incidentParticle,
     80                               const G4HEVector& targetParticle);
    7981};
    80 #endif                     
    81                                          
     82#endif
    8283
  • trunk/source/processes/hadronic/models/high_energy/include/G4HEPionPlusInelastic.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4HEPionPlusInelastic.hh,v 1.15 2007/04/11 18:11:30 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4HEPionPlusInelastic.hh,v 1.17 2010/11/29 05:45:06 dennis Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030//
     
    5757   G4HEPionPlusInelastic() : G4HEInelastic("G4HEPionPlusInelastic")
    5858   {
    59      theMinEnergy =  45*GeV;
     59     vecLength = 0;
     60     theMinEnergy = 45*GeV;
    6061     theMaxEnergy = 10*TeV;
    6162     MAXPART      = 2048;
     
    6768   G4int vecLength;
    6869       
    69    G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus);
     70   G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,
     71                                  G4Nucleus& targetNucleus);
    7072
    71    G4int GetNumberOfSecondaries()
    72        { return vecLength; }         
     73   G4int GetNumberOfSecondaries() {return vecLength;}
    7374
    74    void FirstIntInCasPionPlus(G4bool &inElastic, const G4double availableEnergy,
     75   void FirstIntInCasPionPlus(G4bool& inElastic,
     76                              const G4double availableEnergy,
    7577                              G4HEVector pv[],
    76                               G4int &vecLen,
    77                               G4HEVector incidentParticle,
    78                               G4HEVector targetParticle,
     78                              G4int& vecLen,
     79                              const G4HEVector& incidentParticle,
     80                              const G4HEVector& targetParticle,
    7981                              const G4double atomicWeight);
    8082};
    81 #endif                     
    82                                          
     83#endif
    8384
  • trunk/source/processes/hadronic/models/high_energy/include/G4HEProtonInelastic.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4HEProtonInelastic.hh,v 1.15 2007/04/11 18:11:30 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4HEProtonInelastic.hh,v 1.17 2010/11/29 05:45:06 dennis Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030//
     
    5757   G4HEProtonInelastic() : G4HEInelastic("G4HEProtonInelastic")
    5858   {
    59      theMinEnergy =  45*GeV;
     59     vecLength = 0;
     60     theMinEnergy = 45*GeV;
    6061     theMaxEnergy = 10*TeV;
    6162     MAXPART      = 2048;
     
    6768   G4int vecLength;
    6869       
    69    G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus);
     70   G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,
     71                                  G4Nucleus& targetNucleus);
    7072
    71    G4int  GetNumberOfSecondaries()
    72         { return vecLength; }         
     73   G4int GetNumberOfSecondaries() {return vecLength;}
    7374
    74    void   FirstIntInCasProton(G4bool &inElastic, const G4double availableEnergy,
    75                               G4HEVector pv[],
    76                               G4int &vecLen,
    77                               G4HEVector incidentParticle,
    78                               G4HEVector targetParticle,
    79                               const G4double atomicWeight);
     75   void FirstIntInCasProton(G4bool& inElastic,
     76                            const G4double availableEnergy,
     77                            G4HEVector pv[],
     78                            G4int& vecLen,
     79                            const G4HEVector& incidentParticle,
     80                            const G4HEVector& targetParticle,
     81                            const G4double atomicWeight);
    8082};
    81 #endif                     
    82                                          
     83#endif
    8384
  • trunk/source/processes/hadronic/models/high_energy/include/G4HESigmaMinusInelastic.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4HESigmaMinusInelastic.hh,v 1.14 2007/04/11 18:11:30 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4HESigmaMinusInelastic.hh,v 1.16 2010/11/29 05:45:06 dennis Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030//
     
    5757   G4HESigmaMinusInelastic() : G4HEInelastic("G4HESigmaMinusInelastic")
    5858   {
    59      theMinEnergy =  20*GeV;
     59     vecLength = 0;
     60     theMinEnergy = 20*GeV;
    6061     theMaxEnergy = 10*TeV;
    6162     MAXPART      = 2048;
     
    6768   G4int vecLength;
    6869       
    69    G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus);
     70   G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,
     71                                  G4Nucleus& targetNucleus);
    7072
    71    G4int GetNumberOfSecondaries()
    72         { return vecLength; }         
     73   G4int GetNumberOfSecondaries() {return vecLength;}
    7374
    74    void FirstIntInCasSigmaMinus(G4bool &inElastic, const G4double availableEnergy,
     75   void FirstIntInCasSigmaMinus(G4bool& inElastic,
     76                                const G4double availableEnergy,
    7577                                G4HEVector pv[],
    76                                 G4int &vecLen,
    77                                 G4HEVector incidentParticle,
    78                                 G4HEVector targetParticle,
     78                                G4int& vecLen,
     79                                const G4HEVector& incidentParticle,
     80                                const G4HEVector& targetParticle,
    7981                                const G4double atomicWeight);
    8082};
    81 #endif                     
    82                                          
     83#endif
    8384
  • trunk/source/processes/hadronic/models/high_energy/include/G4HESigmaPlusInelastic.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4HESigmaPlusInelastic.hh,v 1.14 2007/04/11 18:11:30 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4HESigmaPlusInelastic.hh,v 1.16 2010/11/29 05:45:06 dennis Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030//
     
    5757   G4HESigmaPlusInelastic() : G4HEInelastic("G4HESigmaPlusInelastic")
    5858   {
    59      theMinEnergy =  20*GeV;
     59     vecLength = 0;
     60     theMinEnergy = 20*GeV;
    6061     theMaxEnergy = 10*TeV;
    6162     MAXPART      = 2048;
     
    6768   G4int vecLength;
    6869       
    69    G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus);
     70   G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,
     71                                  G4Nucleus& targetNucleus);
    7072
    71    G4int GetNumberOfSecondaries()
    72         { return vecLength; }         
     73   G4int GetNumberOfSecondaries() {return vecLength;}
    7374
    74    void FirstIntInCasSigmaPlus(G4bool &inElastic, const G4double availableEnergy,
     75   void FirstIntInCasSigmaPlus(G4bool& inElastic,
     76                               const G4double availableEnergy,
    7577                               G4HEVector pv[],
    76                                G4int &vecLen,
    77                                G4HEVector incidentParticle,
    78                                G4HEVector targetParticle,
     78                               G4int& vecLen,
     79                               const G4HEVector& incidentParticle,
     80                               const G4HEVector& targetParticle,
    7981                               const G4double atomicWeight);
    8082};
    81 #endif                     
    82                                          
     83#endif
    8384
  • trunk/source/processes/hadronic/models/high_energy/include/G4HESigmaZeroInelastic.hh

    r1340 r1347  
    2626//
    2727// $Id: G4HESigmaZeroInelastic.hh,v 1.14 2007/04/11 18:11:30 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030//
  • trunk/source/processes/hadronic/models/high_energy/include/G4HEVector.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4HEVector.hh,v 1.12 2006/06/29 20:29:48 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4HEVector.hh,v 1.15 2010/11/29 05:45:06 dennis Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030//
     
    9191     baryon           = 0;
    9292     strangeness      = 0;
     93     for (G4int i = 0; i < NumberOfQuarkFlavor; i++) {
     94       theQuarkContent[i] = 0;
     95       theAntiQuarkContent[i] = 0;
     96     }
    9397   }
    9498
     
    150154   const G4ParticleMomentum getMomentum() const ;
    151155
    152    G4double getTotalMomentum();
     156   G4double getTotalMomentum() const;
    153157
    154158   void setMomentum( G4double x, G4double y, G4double z);
     
    172176   void setKineticEnergyAndUpdate(G4double ekin);
    173177
    174    G4double getEnergy();
    175 
    176    G4double getKineticEnergy();
     178   G4double getEnergy() const;
     179
     180   G4double getKineticEnergy() const;
    177181
    178182   void setMass( G4double m );
     
    180184   void setMassAndUpdate( G4double m );
    181185
    182    G4double getMass();
     186   G4double getMass() const;
    183187
    184188   void setCharge( G4double c );
    185189
    186    G4double getCharge();
     190   G4double getCharge() const;
    187191
    188192   void setTOF( G4double t );
     
    200204   void setCode( G4int c );
    201205
    202    G4int getCode();
    203 
    204    G4String getName();
    205 
    206    G4int getBaryonNumber();
    207 
    208    G4int getStrangenessNumber();
     206   G4int getCode() const;
     207
     208   G4String getName() const;
     209
     210   G4int getBaryonNumber() const;
     211
     212   G4int getStrangenessNumber() const;
    209213
    210214   G4int getQuarkContent(G4int flavor);
     
    214218   void setZero();
    215219
    216    G4String getType();
     220   G4String getType() const;
    217221
    218222   void Add( const G4HEVector & p1, const G4HEVector & p2 );
     
    222226   void Lor( const G4HEVector & p1, const G4HEVector & p2 );
    223227
    224    G4double CosAng( const G4HEVector & p );
     228   G4double CosAng(const G4HEVector& p) const;
    225229
    226230   G4double Ang(const G4HEVector & p );
     
    244248   void Norz( const G4HEVector & p );
    245249
    246    G4double Length();
     250   G4double Length() const;
    247251
    248252   void Exch( G4HEVector & p1);
     
    260264   G4int FillQuarkContent();
    261265
    262    void Print( G4int L);
     266   void Print(G4int L) const;
    263267};
    264268
    265269#endif
    266270
    267 
  • trunk/source/processes/hadronic/models/high_energy/include/G4HEXiMinusInelastic.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4HEXiMinusInelastic.hh,v 1.14 2007/04/11 18:11:30 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4HEXiMinusInelastic.hh,v 1.16 2010/11/29 05:45:06 dennis Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030//
     
    5757   G4HEXiMinusInelastic() : G4HEInelastic("G4HEXiMinusInelastic")
    5858   {
    59      theMinEnergy =  20*GeV;
     59     vecLength = 0;
     60     theMinEnergy = 20*GeV;
    6061     theMaxEnergy = 10*TeV;
    6162     MAXPART      = 2048;
     
    6768   G4int vecLength;
    6869       
    69    G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus);
     70   G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,
     71                                  G4Nucleus& targetNucleus);
    7072
    71    G4int GetNumberOfSecondaries()
    72        { return vecLength; }         
     73   G4int GetNumberOfSecondaries() {return vecLength;}
    7374
    74    void FirstIntInCasXiMinus(G4bool &inElastic, const G4double availableEnergy,
     75   void FirstIntInCasXiMinus(G4bool& inElastic,
     76                             const G4double availableEnergy,
    7577                             G4HEVector pv[],
    76                              G4int &vecLen,
    77                              G4HEVector incidentParticle,
    78                              G4HEVector targetParticle,
     78                             G4int& vecLen,
     79                             const G4HEVector& incidentParticle,
     80                             const G4HEVector& targetParticle,
    7981                             const G4double atomicWeight);
    8082};
    81 #endif                     
    82                                          
     83#endif
    8384
  • trunk/source/processes/hadronic/models/high_energy/include/G4HEXiZeroInelastic.hh

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4HEXiZeroInelastic.hh,v 1.14 2007/04/11 18:11:30 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4HEXiZeroInelastic.hh,v 1.16 2010/11/29 05:45:06 dennis Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030//
     
    5757   G4HEXiZeroInelastic() : G4HEInelastic("G4HEXiZeroInelastic")
    5858   {
    59      theMinEnergy =  20*GeV;
     59     vecLength = 0;
     60     theMinEnergy = 20*GeV;
    6061     theMaxEnergy = 10*TeV;
    6162     MAXPART      = 2048;
     
    6768   G4int vecLength;
    6869       
    69    G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus);
     70   G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,
     71                                  G4Nucleus& targetNucleus);
    7072
    71    G4int GetNumberOfSecondaries()
    72        { return vecLength; }         
     73   G4int GetNumberOfSecondaries() {return vecLength;}
    7374
    74    void FirstIntInCasXiZero(G4bool &inElastic, const G4double availableEnergy,
     75   void FirstIntInCasXiZero(G4bool& inElastic,
     76                            const G4double availableEnergy,
    7577                            G4HEVector pv[],
    76                             G4int &vecLen,
    77                             G4HEVector incidentParticle,
    78                             G4HEVector targetParticle,
     78                            G4int& vecLen,
     79                            const G4HEVector& incidentParticle,
     80                            const G4HEVector& targetParticle,
    7981                            const G4double atomicWeight);
    8082};
    81 #endif                     
    82                                          
     83#endif
    8384
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEAntiKaonZeroInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HEAntiKaonZeroInelastic.cc,v 1.16 2010/02/09 22:02:04 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HEAntiKaonZeroInelastic.cc,v 1.18 2010/11/27 00:06:50 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
     35// and the low energy two-body model. Not included is the low energy stuff like
    3936// nuclear reactions, nuclear fission without any cascading and all processes for
    4037// particles at rest. 
     
    4542#include "G4HEAntiKaonZeroInelastic.hh"
    4643
    47 G4HadFinalState *  G4HEAntiKaonZeroInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double atomicWeight = targetNucleus.GetN();
    54     const G4double atomicNumber = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
    56 
    57     G4int    incidentCode          = incidentParticle.getCode();
    58     G4double incidentMass          = incidentParticle.getMass();
    59     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    60     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    61     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    62 
    63     if(incidentKineticEnergy < 1.)
    64       {
    65         G4cout << "GHEAntiKaonZeroInelastic: incident energy < 1 GeV" << G4endl;
    66       }
    67     if(verboseLevel > 1)
    68       {
    69         G4cout << "G4HEAntiKaonZeroInelastic::ApplyYourself" << G4endl;
    70         G4cout << "incident particle " << incidentParticle.getName()
    71              << "mass "              << incidentMass
    72              << "kinetic energy "    << incidentKineticEnergy
    73              << G4endl;
    74         G4cout << "target material with (A,Z) = ("
    75              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    76       }
     44G4HadFinalState*
     45G4HEAntiKaonZeroInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     46                                         G4Nucleus& targetNucleus)
     47{
     48  G4HEVector* pv = new G4HEVector[MAXPART];
     49  const G4HadProjectile* aParticle = &aTrack;
     50  const G4double atomicWeight = targetNucleus.GetN();
     51  const G4double atomicNumber = targetNucleus.GetZ();
     52  G4HEVector incidentParticle(aParticle);
     53
     54  G4int incidentCode = incidentParticle.getCode();
     55  G4double incidentMass = incidentParticle.getMass();
     56  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     57  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     58  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     59
     60  if (incidentKineticEnergy < 1.)
     61    G4cout << "GHEAntiKaonZeroInelastic: incident energy < 1 GeV" << G4endl;
     62
     63  if (verboseLevel > 1) {
     64    G4cout << "G4HEAntiKaonZeroInelastic::ApplyYourself" << G4endl;
     65    G4cout << "incident particle " << incidentParticle.getName()
     66           << "mass "              << incidentMass
     67           << "kinetic energy "    << incidentKineticEnergy
     68           << G4endl;
     69    G4cout << "target material with (A,Z) = ("
     70           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     71  }
    7772   
    78     G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
    79                                                  atomicWeight, atomicNumber);
    80     if(verboseLevel > 1)
    81         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     73  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     74                                              atomicWeight, atomicNumber);
     75  if (verboseLevel > 1)
     76    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    8277   
    83     incidentKineticEnergy -= inelasticity;
     78  incidentKineticEnergy -= inelasticity;
    8479   
    85     G4double excitationEnergyGNP = 0.;
    86     G4double excitationEnergyDTA = 0.;
    87 
    88     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    89                                                atomicWeight, atomicNumber,
    90                                                excitationEnergyGNP,
    91                                                excitationEnergyDTA);
    92     if(verboseLevel > 1)
    93       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     80  G4double excitationEnergyGNP = 0.;
     81  G4double excitationEnergyDTA = 0.;
     82
     83  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     84                                          atomicWeight, atomicNumber,
     85                                          excitationEnergyGNP,
     86                                          excitationEnergyDTA);
     87  if (verboseLevel > 1)
     88    G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    9489           << excitationEnergyDTA << G4endl;             
    9590
    9691
    97     incidentKineticEnergy -= excitation;
    98     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    99     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    100                                   *(incidentTotalEnergy+incidentMass));
    101 
    102 
    103     G4HEVector targetParticle;
    104     if(G4UniformRand() < atomicNumber/atomicWeight)
    105       {
    106         targetParticle.setDefinition("Proton");
    107       }
    108     else
    109       {
    110         targetParticle.setDefinition("Neutron");
    111       }
    112 
    113     G4double targetMass         = targetParticle.getMass();
    114     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    115                                        + 2.0*targetMass*incidentTotalEnergy);
    116     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    117 
    118                                                                 // this was the meaning of inElastic in the
    119                                                                 // original Gheisha stand-alone version.
    120 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    121 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    122                                                                 // by unknown reasons, it has been replaced
    123                                                                 // to the following code in Geant???
    124     G4bool inElastic = true;
    125 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    126 
    127     vecLength = 0;           
     92  incidentKineticEnergy -= excitation;
     93  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     94  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)
     95                                    *(incidentTotalEnergy+incidentMass));
     96
     97  G4HEVector targetParticle;
     98  if (G4UniformRand() < atomicNumber/atomicWeight) {
     99    targetParticle.setDefinition("Proton");
     100  } else {
     101    targetParticle.setDefinition("Neutron");
     102  }
     103
     104  G4double targetMass = targetParticle.getMass();
     105  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     106                                         + targetMass*targetMass
     107                                         + 2.0*targetMass*incidentTotalEnergy);
     108  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     109
     110  vecLength = 0;           
    128111       
    129     if(verboseLevel > 1)
    130       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     112  if (verboseLevel > 1)
     113    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    131114           << incidentCode << G4endl;
    132115
    133     G4bool successful = false;
    134    
    135     if(inElastic || (!inElastic && atomicWeight < 1.5))
    136       {
    137         FirstIntInCasAntiKaonZero(inElastic, availableEnergy, pv, vecLength,
    138                                   incidentParticle, targetParticle );
    139 
    140         if(verboseLevel > 1)
    141            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    142 
    143 
    144         if ((vecLength > 0) && (availableEnergy > 1.))
    145                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    146                                                   pv, vecLength,
    147                                                   incidentParticle, targetParticle);
    148             HighEnergyCascading( successful, pv, vecLength,
    149                                  excitationEnergyGNP, excitationEnergyDTA,
    150                                  incidentParticle, targetParticle,
    151                                  atomicWeight, atomicNumber);
    152         if (!successful)
    153             HighEnergyClusterProduction( successful, pv, vecLength,
    154                                          excitationEnergyGNP, excitationEnergyDTA,
    155                                          incidentParticle, targetParticle,
    156                                          atomicWeight, atomicNumber);
    157         if (!successful)
    158             MediumEnergyCascading( successful, pv, vecLength,
    159                                    excitationEnergyGNP, excitationEnergyDTA,
    160                                    incidentParticle, targetParticle,
    161                                    atomicWeight, atomicNumber);
    162 
    163         if (!successful)
    164             MediumEnergyClusterProduction( successful, pv, vecLength,
    165                                            excitationEnergyGNP, excitationEnergyDTA,       
    166                                            incidentParticle, targetParticle,
    167                                            atomicWeight, atomicNumber);
    168         if (!successful)
    169             QuasiElasticScattering( successful, pv, vecLength,
    170                                     excitationEnergyGNP, excitationEnergyDTA,
    171                                     incidentParticle, targetParticle,
    172                                     atomicWeight, atomicNumber);
    173       }
    174     if (!successful)
    175       {
    176             ElasticScattering( successful, pv, vecLength,
    177                                incidentParticle,   
    178                                atomicWeight, atomicNumber);
    179       }
    180 
    181     if (!successful)
    182       G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
    183              << G4endl;
    184 
    185       FillParticleChange(pv,  vecLength);
    186       delete [] pv;
    187       theParticleChange.SetStatusChange(stopAndKill);
    188       return & theParticleChange;
    189   }
     116  G4bool successful = false;
     117
     118  G4bool inElastic = true;
     119  FirstIntInCasAntiKaonZero(inElastic, availableEnergy, pv, vecLength,
     120                            incidentParticle, targetParticle );
     121
     122  if (verboseLevel > 1)
     123    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl;
     124
     125  if ((vecLength > 0) && (availableEnergy > 1.))
     126    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     127                                  pv, vecLength,
     128                                  incidentParticle, targetParticle);
     129  HighEnergyCascading(successful, pv, vecLength,
     130                      excitationEnergyGNP, excitationEnergyDTA,
     131                      incidentParticle, targetParticle,
     132                      atomicWeight, atomicNumber);
     133  if (!successful)
     134    HighEnergyClusterProduction(successful, pv, vecLength,
     135                                excitationEnergyGNP, excitationEnergyDTA,
     136                                incidentParticle, targetParticle,
     137                                atomicWeight, atomicNumber);
     138  if (!successful)
     139    MediumEnergyCascading(successful, pv, vecLength,
     140                          excitationEnergyGNP, excitationEnergyDTA,
     141                          incidentParticle, targetParticle,
     142                          atomicWeight, atomicNumber);
     143  if (!successful)
     144    MediumEnergyClusterProduction(successful, pv, vecLength,
     145                                  excitationEnergyGNP, excitationEnergyDTA,       
     146                                  incidentParticle, targetParticle,
     147                                  atomicWeight, atomicNumber);
     148  if (!successful)
     149    QuasiElasticScattering(successful, pv, vecLength,
     150                           excitationEnergyGNP, excitationEnergyDTA,
     151                           incidentParticle, targetParticle,
     152                           atomicWeight, atomicNumber);
     153  if (!successful)
     154    ElasticScattering(successful, pv, vecLength,
     155                      incidentParticle,   
     156                      atomicWeight, atomicNumber);
     157
     158  if (!successful)
     159    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     160           << G4endl;
     161
     162  FillParticleChange(pv,  vecLength);
     163  delete [] pv;
     164  theParticleChange.SetStatusChange(stopAndKill);
     165  return &theParticleChange;
     166}
     167
    190168
    191169void
    192 G4HEAntiKaonZeroInelastic::FirstIntInCasAntiKaonZero( G4bool &inElastic,
    193                                                       const G4double availableEnergy,
    194                                                       G4HEVector pv[],
    195                                                       G4int &vecLen,
    196                                                       G4HEVector incidentParticle,
    197                                                       G4HEVector targetParticle )
    198 
    199 // AntiKaon0 undergoes interaction with nucleon within a nucleus.  Check if it is
    200 // energetically possible to produce pions/kaons.  In not, assume nuclear excitation
    201 // occurs and input particle is degraded in energy. No other particles are produced.
     170G4HEAntiKaonZeroInelastic::FirstIntInCasAntiKaonZero(G4bool& inElastic,
     171                                                     const G4double availableEnergy,
     172                                                     G4HEVector pv[],
     173                                                     G4int &vecLen,
     174                                                     const G4HEVector& incidentParticle,
     175                                                     const G4HEVector& targetParticle)
     176
     177// AntiKaon0 undergoes interaction with nucleon within a nucleus.  Check if it
     178// is energetically possible to produce pions/kaons.  In not, assume nuclear
     179// excitation occurs and input particle is degraded in energy.  No other
     180// particles are produced.
    202181// If reaction is possible, find the correct number of pions/protons/neutrons
    203182// produced using an interpolation to multiplicity data.  Replace some pions or
    204183// protons/neutrons by kaons or strange baryons according to the average
    205184// multiplicity per inelastic reaction.
    206 
    207  {
    208    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    209    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    210 
    211    static const G4double protb = 0.7;
    212    static const G4double neutb = 0.7;
    213    static const G4double     c = 1.25;
    214 
    215    static const G4int   numMul = 1200;
    216    static const G4int   numSec = 60;
    217 
    218    G4int              neutronCode = Neutron.getCode();
    219    G4int               protonCode = Proton.getCode();
    220    G4int            kaonMinusCode = KaonMinus.getCode();
    221    G4int             kaonZeroCode = KaonZero.getCode();
    222    G4int         antiKaonZeroCode = AntiKaonZero.getCode(); 
    223 
    224    G4int               targetCode = targetParticle.getCode();
    225 //   G4double          incidentMass = incidentParticle.getMass();
    226 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    227    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    228 
    229    static G4bool first = true;
    230    static G4double protmul[numMul], protnorm[numSec];  // proton constants
    231    static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
    232 
    233 //                                misc. local variables
    234 //                                np = number of pi+,  nm = number of pi-,  nz = number of pi0
    235 
    236    G4int i, counter, nt, np, nm, nz;
     185{
     186  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     187  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     188
     189  static const G4double protb = 0.7;
     190  static const G4double neutb = 0.7;
     191  static const G4double     c = 1.25;
     192
     193  static const G4int numMul = 1200;
     194  static const G4int numSec = 60;
     195
     196  G4int neutronCode = Neutron.getCode();
     197  G4int protonCode = Proton.getCode();
     198  G4int kaonMinusCode = KaonMinus.getCode();
     199  G4int kaonZeroCode = KaonZero.getCode();
     200  G4int antiKaonZeroCode = AntiKaonZero.getCode(); 
     201
     202  G4int targetCode = targetParticle.getCode();
     203  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     204
     205  static G4bool first = true;
     206  static G4double protmul[numMul], protnorm[numSec];  // proton constants
     207  static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
     208
     209  // misc. local variables
     210  // np = number of pi+,  nm = number of pi-,  nz = number of pi0
     211
     212  G4int i, counter, nt, np, nm, nz;
    237213
    238214   if( first )
    239      {                         // compute normalization constants, this will only be done once
     215     {                   // compute normalization constants, this will only be done once
    240216       first = false;
    241217       for( i=0; i<numMul; i++ )protmul[i]  = 0.0;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEAntiLambdaInelastic.cc

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4HEAntiLambdaInelastic.cc,v 1.15 2008/03/17 20:49:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     27// $Id: G4HEAntiLambdaInelastic.cc,v 1.17 2010/11/27 02:00:07 dennis Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3029//
    3130
     
    3332#include "G4ios.hh"
    3433
    35 //
    3634// G4 Process: Gheisha High Energy Collision model.
    3735// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     36// and the low energy two-body model. Not included are the low energy stuff
     37// like nuclear reactions, nuclear fission without any cascading and all
     38// processes for particles at rest. 
    4139// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4240// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4543#include "G4HEAntiLambdaInelastic.hh"
    4644
    47 G4HadFinalState *  G4HEAntiLambdaInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double atomicWeight = targetNucleus.GetN();
    54     const G4double atomicNumber = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
    56 
    57     G4int    incidentCode          = incidentParticle.getCode();
    58     G4double incidentMass          = incidentParticle.getMass();
    59     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    60     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    61     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    62 
    63     if(incidentKineticEnergy < 1.)
    64       {
    65         G4cout << "GHEAntiLambdaInelastic: incident energy < 1 GeV" << G4endl;
    66       }
    67     if(verboseLevel > 1)
    68       {
    69         G4cout << "G4HEAntiLambdaInelastic::ApplyYourself" << G4endl;
    70         G4cout << "incident particle " << incidentParticle.getName()
    71              << "mass "              << incidentMass
    72              << "kinetic energy "    << incidentKineticEnergy
    73              << G4endl;
    74         G4cout << "target material with (A,Z) = ("
    75              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    76       }
    77 
    78     G4double inelasticity  = NuclearInelasticity(incidentKineticEnergy,
    79                                                  atomicWeight, atomicNumber);
    80     if(verboseLevel > 1)
    81         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     45
     46G4HadFinalState*
     47G4HEAntiLambdaInelastic::ApplyYourself(const G4HadProjectile &aTrack,
     48                                       G4Nucleus &targetNucleus)
     49{
     50  G4HEVector * pv = new G4HEVector[MAXPART];
     51  const G4HadProjectile *aParticle = &aTrack;
     52  const G4double atomicWeight = targetNucleus.GetN();
     53  const G4double atomicNumber = targetNucleus.GetZ();
     54  G4HEVector incidentParticle(aParticle);
     55
     56  G4int incidentCode = incidentParticle.getCode();
     57  G4double incidentMass = incidentParticle.getMass();
     58  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     59  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     60  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     61
     62  if (incidentKineticEnergy < 1.)
     63    G4cout << "GHEAntiLambdaInelastic: incident energy < 1 GeV" << G4endl;
     64
     65  if (verboseLevel > 1) {
     66    G4cout << "G4HEAntiLambdaInelastic::ApplyYourself" << G4endl;
     67    G4cout << "incident particle " << incidentParticle.getName()
     68           << "mass "              << incidentMass
     69           << "kinetic energy "    << incidentKineticEnergy
     70           << G4endl;
     71    G4cout << "target material with (A,Z) = ("
     72           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     73  }
     74
     75  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     76                                              atomicWeight, atomicNumber);
     77  if (verboseLevel > 1)
     78    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    8279   
    83     incidentKineticEnergy -= inelasticity;
     80  incidentKineticEnergy -= inelasticity;
    8481   
    85     G4double excitationEnergyGNP = 0.;
    86     G4double excitationEnergyDTA = 0.;
    87 
    88     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    89                                                atomicWeight, atomicNumber,
    90                                                excitationEnergyGNP,
    91                                                excitationEnergyDTA);
    92     if(verboseLevel > 1)
    93       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     82  G4double excitationEnergyGNP = 0.;
     83  G4double excitationEnergyDTA = 0.;
     84
     85  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     86                                          atomicWeight, atomicNumber,
     87                                          excitationEnergyGNP,
     88                                          excitationEnergyDTA);
     89  if (verboseLevel > 1)
     90    G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    9491           << excitationEnergyDTA << G4endl;             
    9592
    96 
    97     incidentKineticEnergy -= excitation;
    98     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    99     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    100                                   *(incidentTotalEnergy+incidentMass));
    101 
    102 
    103     G4HEVector targetParticle;
    104     if(G4UniformRand() < atomicNumber/atomicWeight)
    105       {
    106         targetParticle.setDefinition("Proton");
    107       }
    108     else
    109       {
    110         targetParticle.setDefinition("Neutron");
    111       }
    112 
    113     G4double targetMass         = targetParticle.getMass();
    114     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    115                                        + 2.0*targetMass*incidentTotalEnergy);
    116     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    117 
    118                                                                 // this was the meaning of inElastic in the
    119                                                                 // original Gheisha stand-alone version.
    120 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    121 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    122                                                                 // by unknown reasons, it has been replaced
    123                                                                 // to the following code in Geant???
    124     G4bool inElastic = true;
    125 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    126 
    127     vecLength = 0;           
     93  incidentKineticEnergy -= excitation;
     94  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     95  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)
     96                         *(incidentTotalEnergy+incidentMass));
     97
     98  G4HEVector targetParticle;
     99  if (G4UniformRand() < atomicNumber/atomicWeight) {
     100    targetParticle.setDefinition("Proton");
     101  } else {
     102    targetParticle.setDefinition("Neutron");
     103  }
     104
     105  G4double targetMass = targetParticle.getMass();
     106  G4double centerOfMassEnergy =
     107       std::sqrt( incidentMass*incidentMass + targetMass*targetMass
     108       + 2.0*targetMass*incidentTotalEnergy);
     109  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     110
     111  G4bool inElastic = true;
     112  vecLength = 0;           
    128113       
    129     if(verboseLevel > 1)
    130       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     114  if (verboseLevel > 1)
     115    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    131116           << incidentCode << G4endl;
    132117
    133     G4bool successful = false;
     118  G4bool successful = false;
    134119   
    135     if(inElastic || (!inElastic && atomicWeight < 1.5))
    136       {
    137         FirstIntInCasAntiLambda(inElastic, availableEnergy, pv, vecLength,
    138                                 incidentParticle, targetParticle, atomicWeight);
    139 
    140         if(verboseLevel > 1)
    141            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    142 
    143 
    144         if ((vecLength > 0) && (availableEnergy > 1.))
    145                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    146                                                   pv, vecLength,
    147                                                   incidentParticle, targetParticle);
    148             HighEnergyCascading( successful, pv, vecLength,
    149                                  excitationEnergyGNP, excitationEnergyDTA,
    150                                  incidentParticle, targetParticle,
    151                                  atomicWeight, atomicNumber);
    152         if (!successful)
    153             HighEnergyClusterProduction( successful, pv, vecLength,
    154                                          excitationEnergyGNP, excitationEnergyDTA,
    155                                          incidentParticle, targetParticle,
    156                                          atomicWeight, atomicNumber);
    157         if (!successful)
    158             MediumEnergyCascading( successful, pv, vecLength,
    159                                    excitationEnergyGNP, excitationEnergyDTA,
    160                                    incidentParticle, targetParticle,
    161                                    atomicWeight, atomicNumber);
    162 
    163         if (!successful)
    164             MediumEnergyClusterProduction( successful, pv, vecLength,
    165                                            excitationEnergyGNP, excitationEnergyDTA,       
    166                                            incidentParticle, targetParticle,
    167                                            atomicWeight, atomicNumber);
    168         if (!successful)
    169             QuasiElasticScattering( successful, pv, vecLength,
    170                                     excitationEnergyGNP, excitationEnergyDTA,
    171                                     incidentParticle, targetParticle,
    172                                     atomicWeight, atomicNumber);
    173       }
    174     if (!successful)
    175       {
    176             ElasticScattering( successful, pv, vecLength,
    177                                incidentParticle,   
    178                                atomicWeight, atomicNumber);
    179       }
    180 
    181     if (!successful)
    182       {
    183         G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles" << G4endl;
    184       }
    185       FillParticleChange(pv,  vecLength);
    186       delete [] pv;
    187       theParticleChange.SetStatusChange(stopAndKill);
    188       return & theParticleChange;
    189   }
     120  FirstIntInCasAntiLambda(inElastic, availableEnergy, pv, vecLength,
     121                          incidentParticle, targetParticle, atomicWeight);
     122
     123  if (verboseLevel > 1)
     124    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
     125
     126  if ((vecLength > 0) && (availableEnergy > 1.))
     127    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     128                                  pv, vecLength,
     129                                  incidentParticle, targetParticle);
     130  HighEnergyCascading(successful, pv, vecLength,
     131                      excitationEnergyGNP, excitationEnergyDTA,
     132                      incidentParticle, targetParticle,
     133                      atomicWeight, atomicNumber);
     134  if (!successful)
     135    HighEnergyClusterProduction(successful, pv, vecLength,
     136                                excitationEnergyGNP, excitationEnergyDTA,
     137                                incidentParticle, targetParticle,
     138                                atomicWeight, atomicNumber);
     139  if (!successful)
     140    MediumEnergyCascading(successful, pv, vecLength,
     141                          excitationEnergyGNP, excitationEnergyDTA,
     142                          incidentParticle, targetParticle,
     143                          atomicWeight, atomicNumber);
     144
     145  if (!successful)
     146    MediumEnergyClusterProduction(successful, pv, vecLength,
     147                                  excitationEnergyGNP, excitationEnergyDTA,       
     148                                  incidentParticle, targetParticle,
     149                                  atomicWeight, atomicNumber);
     150  if (!successful)
     151    QuasiElasticScattering(successful, pv, vecLength,
     152                           excitationEnergyGNP, excitationEnergyDTA,
     153                           incidentParticle, targetParticle,
     154                           atomicWeight, atomicNumber);
     155  if (!successful)
     156    ElasticScattering(successful, pv, vecLength,
     157                      incidentParticle,   
     158                      atomicWeight, atomicNumber);
     159
     160  if (!successful)
     161    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     162           << G4endl;
     163
     164  FillParticleChange(pv, vecLength);
     165  delete [] pv;
     166  theParticleChange.SetStatusChange(stopAndKill);
     167  return & theParticleChange;
     168}
     169
    190170
    191171void
    192 G4HEAntiLambdaInelastic::FirstIntInCasAntiLambda( G4bool &inElastic,
    193                                                   const G4double availableEnergy,
    194                                                   G4HEVector pv[],
    195                                                   G4int &vecLen,
    196                                                   G4HEVector incidentParticle,
    197                                                   G4HEVector targetParticle,
    198                                                   const G4double atomicWeight)
    199 
    200 // AntiLambda undergoes interaction with nucleon within a nucleus.  Check if it is
    201 // energetically possible to produce pions/kaons.  In not, assume nuclear excitation
    202 // occurs and input particle is degraded in energy. No other particles are produced.
     172G4HEAntiLambdaInelastic::FirstIntInCasAntiLambda(G4bool& inElastic,
     173                                                 const G4double availableEnergy,
     174                                                 G4HEVector pv[],
     175                                                 G4int &vecLen,
     176                                                 const G4HEVector& incidentParticle,
     177                                                 const G4HEVector& targetParticle,
     178                                                 const G4double atomicWeight)
     179
     180// AntiLambda undergoes interaction with nucleon within a nucleus.
     181// Check if it is energetically possible to produce pions/kaons.  If not,
     182// assume nuclear excitation occurs and input particle is degraded in
     183// energy. No other particles are produced.
    203184// If reaction is possible, find the correct number of pions/protons/neutrons
    204185// produced using an interpolation to multiplicity data.  Replace some pions or
    205186// protons/neutrons by kaons or strange baryons according to the average
    206187// multiplicity per inelastic reaction.
    207 
    208  {
    209    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    210    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    211 
    212    static const G4double protb = 0.7;
    213    static const G4double neutb = 0.7;
    214    static const G4double     c = 1.25;
    215 
    216    static const G4int   numMul   = 1200;
    217    static const G4int   numMulAn = 400;
    218    static const G4int   numSec   = 60;
    219 
    220 //   G4int              neutronCode = Neutron.getCode();
    221    G4int              protonCode  = Proton.getCode();
    222 
    223    G4int               targetCode = targetParticle.getCode();
    224 //   G4double          incidentMass = incidentParticle.getMass();
    225 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    226    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    227 
    228    static G4bool first = true;
    229    static G4double protmul[numMul],  protnorm[numSec];   // proton constants
    230    static G4double protmulAn[numMulAn],protnormAn[numSec];
    231    static G4double neutmul[numMul],  neutnorm[numSec];   // neutron constants
    232    static G4double neutmulAn[numMulAn],neutnormAn[numSec];
    233 
    234                               //  misc. local variables
    235                               //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
    236 
    237    G4int i, counter, nt, np, nm, nz;
     188{
     189  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     190  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     191
     192  static const G4double protb = 0.7;
     193  static const G4double neutb = 0.7;
     194  static const G4double     c = 1.25;
     195
     196  static const G4int   numMul   = 1200;
     197  static const G4int   numMulAn = 400;
     198  static const G4int   numSec   = 60;
     199
     200  G4int protonCode = Proton.getCode();
     201
     202  G4int targetCode = targetParticle.getCode();
     203  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     204
     205  static G4bool first = true;
     206  static G4double protmul[numMul],  protnorm[numSec];   // proton constants
     207  static G4double protmulAn[numMulAn],protnormAn[numSec];
     208  static G4double neutmul[numMul],  neutnorm[numSec];   // neutron constants
     209  static G4double neutmulAn[numMulAn],neutnormAn[numSec];
     210
     211  //  misc. local variables
     212  //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
     213
     214  G4int i, counter, nt, np, nm, nz;
    238215
    239216   if( first )
    240      {                         // compute normalization constants, this will only be done once
     217     {                 // compute normalization constants, this will only be done once
    241218       first = false;
    242219       for( i=0; i<numMul  ; i++ ) protmul[i]  = 0.0;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEAntiNeutronInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HEAntiNeutronInelastic.cc,v 1.15 2008/03/17 20:49:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HEAntiNeutronInelastic.cc,v 1.17 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     35// and the low energy two-body model.  Not included is the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest. 
    4138// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4239// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4542#include "G4HEAntiNeutronInelastic.hh"
    4643
    47 G4HadFinalState *  G4HEAntiNeutronInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double atomicWeight = targetNucleus.GetN();
    54     const G4double atomicNumber = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
    56 
    57     G4int    incidentCode          = incidentParticle.getCode();
    58     G4double incidentMass          = incidentParticle.getMass();
    59     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    60     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    61     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    62 
    63     if(incidentKineticEnergy < 1.)
    64       {
    65         G4cout << "GHEAntiNeutronInelastic: incident energy < 1 GeV" << G4endl;;
    66       }
    67     if(verboseLevel > 1)
    68       {
    69         G4cout << "G4HEAntiNeutronInelastic::ApplyYourself" << G4endl;
    70         G4cout << "incident particle " << incidentParticle.getName()
    71              << "mass "              << incidentMass
    72              << "kinetic energy "    << incidentKineticEnergy
    73              << G4endl;
    74         G4cout << "target material with (A,Z) = ("
    75              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    76       }
    77 
    78     G4double inelasticity  = NuclearInelasticity(incidentKineticEnergy,
    79                                                  atomicWeight, atomicNumber);
    80     if(verboseLevel > 1)
    81         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     44G4HadFinalState*
     45G4HEAntiNeutronInelastic::ApplyYourself(const G4HadProjectile &aTrack,
     46                                        G4Nucleus &targetNucleus)
     47{
     48  G4HEVector* pv = new G4HEVector[MAXPART];
     49  const G4HadProjectile* aParticle = &aTrack;
     50  const G4double atomicWeight = targetNucleus.GetN();
     51  const G4double atomicNumber = targetNucleus.GetZ();
     52  G4HEVector incidentParticle(aParticle);
     53
     54  G4int incidentCode = incidentParticle.getCode();
     55  G4double incidentMass = incidentParticle.getMass();
     56  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     57  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     58  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     59
     60  if (incidentKineticEnergy < 1.)
     61    G4cout << "GHEAntiNeutronInelastic: incident energy < 1 GeV" << G4endl;;
     62
     63  if (verboseLevel > 1) {
     64    G4cout << "G4HEAntiNeutronInelastic::ApplyYourself" << G4endl;
     65    G4cout << "incident particle " << incidentParticle.getName()
     66           << "mass "              << incidentMass
     67           << "kinetic energy "    << incidentKineticEnergy
     68           << G4endl;
     69    G4cout << "target material with (A,Z) = ("
     70           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     71  }
     72
     73  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     74                                              atomicWeight, atomicNumber);
     75  if (verboseLevel > 1)
     76    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    8277   
    83     incidentKineticEnergy -= inelasticity;
     78  incidentKineticEnergy -= inelasticity;
    8479   
    85     G4double excitationEnergyGNP = 0.;
    86     G4double excitationEnergyDTA = 0.;
    87 
    88     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    89                                                atomicWeight, atomicNumber,
    90                                                excitationEnergyGNP,
    91                                                excitationEnergyDTA);
    92     if(verboseLevel > 1)
    93       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     80  G4double excitationEnergyGNP = 0.;
     81  G4double excitationEnergyDTA = 0.;
     82
     83  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     84                                          atomicWeight, atomicNumber,
     85                                          excitationEnergyGNP,
     86                                          excitationEnergyDTA);
     87  if (verboseLevel > 1)
     88    G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    9489           << excitationEnergyDTA << G4endl;             
    9590
    96 
    97     incidentKineticEnergy -= excitation;
    98     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    99     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    100                                   *(incidentTotalEnergy+incidentMass));
    101 
    102 
    103     G4HEVector targetParticle;
    104     if(G4UniformRand() < atomicNumber/atomicWeight)
    105       {
    106         targetParticle.setDefinition("Proton");
    107       }
    108     else
    109       {
    110         targetParticle.setDefinition("Neutron");
    111       }
    112 
    113     G4double targetMass         = targetParticle.getMass();
    114     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    115                                        + 2.0*targetMass*incidentTotalEnergy);
    116     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    117 
    118                                                                 // this was the meaning of inElastic in the
    119                                                                 // original Gheisha stand-alone version.
    120 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    121 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    122                                                                 // by unknown reasons, it has been replaced
    123                                                                 // to the following code in Geant???
    124     G4bool inElastic = true;
    125 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    126 
    127     vecLength = 0;           
     91  incidentKineticEnergy -= excitation;
     92  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     93  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)
     94                                    *(incidentTotalEnergy+incidentMass));
     95
     96  G4HEVector targetParticle;
     97  if (G4UniformRand() < atomicNumber/atomicWeight) {
     98    targetParticle.setDefinition("Proton");
     99  } else {
     100    targetParticle.setDefinition("Neutron");
     101  }
     102
     103  G4double targetMass = targetParticle.getMass();
     104  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     105                                        + targetMass*targetMass
     106                                        + 2.0*targetMass*incidentTotalEnergy);
     107  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     108
     109  G4bool inElastic = true;
     110  vecLength = 0;           
    128111       
    129     if(verboseLevel > 1)
    130       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     112  if (verboseLevel > 1)
     113    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    131114           << incidentCode << G4endl;
    132115
    133     G4bool successful = false;
     116  G4bool successful = false;
    134117   
    135     if(inElastic || (!inElastic && atomicWeight < 1.5))
    136       {
    137         FirstIntInCasAntiNeutron(inElastic, availableEnergy, pv, vecLength,
    138                                  incidentParticle, targetParticle, atomicWeight);
    139 
    140         if(verboseLevel > 1)
    141            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    142 
    143 
    144         if ((vecLength > 0) && (availableEnergy > 1.))
    145                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    146                                                   pv, vecLength,
    147                                                   incidentParticle, targetParticle);
    148             HighEnergyCascading( successful, pv, vecLength,
    149                                  excitationEnergyGNP, excitationEnergyDTA,
    150                                  incidentParticle, targetParticle,
    151                                  atomicWeight, atomicNumber);
    152         if (!successful)
    153             HighEnergyClusterProduction( successful, pv, vecLength,
    154                                          excitationEnergyGNP, excitationEnergyDTA,
    155                                          incidentParticle, targetParticle,
    156                                          atomicWeight, atomicNumber);
    157         if (!successful)
    158             MediumEnergyCascading( successful, pv, vecLength,
    159                                    excitationEnergyGNP, excitationEnergyDTA,
    160                                    incidentParticle, targetParticle,
    161                                    atomicWeight, atomicNumber);
    162 
    163         if (!successful)
    164             MediumEnergyClusterProduction( successful, pv, vecLength,
    165                                            excitationEnergyGNP, excitationEnergyDTA,       
    166                                            incidentParticle, targetParticle,
    167                                            atomicWeight, atomicNumber);
    168         if (!successful)
    169             QuasiElasticScattering( successful, pv, vecLength,
    170                                     excitationEnergyGNP, excitationEnergyDTA,
    171                                     incidentParticle, targetParticle,
    172                                     atomicWeight, atomicNumber);
    173       }
    174     if (!successful)
    175       {
    176             ElasticScattering( successful, pv, vecLength,
    177                                incidentParticle,   
    178                                atomicWeight, atomicNumber);
    179       }
    180 
    181     if (!successful)
    182       {
    183         G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles" << G4endl;
    184       }
    185       FillParticleChange(pv,  vecLength);
    186       delete [] pv;
    187       theParticleChange.SetStatusChange(stopAndKill);
    188       return & theParticleChange;
    189   }
     118  FirstIntInCasAntiNeutron(inElastic, availableEnergy, pv, vecLength,
     119                           incidentParticle, targetParticle, atomicWeight);
     120
     121  if (verboseLevel > 1)
     122    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl;
     123
     124  if ((vecLength > 0) && (availableEnergy > 1.))
     125    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     126                                  pv, vecLength,
     127                                  incidentParticle, targetParticle);
     128  HighEnergyCascading(successful, pv, vecLength,
     129                      excitationEnergyGNP, excitationEnergyDTA,
     130                      incidentParticle, targetParticle,
     131                      atomicWeight, atomicNumber);
     132  if (!successful)
     133    HighEnergyClusterProduction(successful, pv, vecLength,
     134                                excitationEnergyGNP, excitationEnergyDTA,
     135                                incidentParticle, targetParticle,
     136                                atomicWeight, atomicNumber);
     137  if (!successful)
     138    MediumEnergyCascading(successful, pv, vecLength,
     139                          excitationEnergyGNP, excitationEnergyDTA,
     140                          incidentParticle, targetParticle,
     141                          atomicWeight, atomicNumber);
     142
     143  if (!successful)
     144    MediumEnergyClusterProduction(successful, pv, vecLength,
     145                                  excitationEnergyGNP, excitationEnergyDTA,       
     146                                  incidentParticle, targetParticle,
     147                                  atomicWeight, atomicNumber);
     148  if (!successful)
     149    QuasiElasticScattering(successful, pv, vecLength,
     150                           excitationEnergyGNP, excitationEnergyDTA,
     151                           incidentParticle, targetParticle,
     152                           atomicWeight, atomicNumber);
     153  if (!successful)
     154    ElasticScattering(successful, pv, vecLength,
     155                      incidentParticle,   
     156                      atomicWeight, atomicNumber);
     157
     158  if (!successful)
     159    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     160           << G4endl;
     161
     162  FillParticleChange(pv,  vecLength);
     163  delete [] pv;
     164  theParticleChange.SetStatusChange(stopAndKill);
     165  return &theParticleChange;
     166}
     167
    190168
    191169void
    192   G4HEAntiNeutronInelastic::FirstIntInCasAntiNeutron( G4bool &inElastic,
    193                                                       const G4double availableEnergy,
    194                                                       G4HEVector pv[],
    195                                                       G4int &vecLen,
    196                                                       G4HEVector incidentParticle,
    197                                                       G4HEVector targetParticle,
    198                                                       const G4double atomicWeight)
    199 
    200 // AntiNeutron undergoes interaction with nucleon within a nucleus.  Check if it is
    201 // energetically possible to produce pions/kaons.  In not, assume nuclear excitation
    202 // occurs and input particle is degraded in energy. No other particles are produced.
     170G4HEAntiNeutronInelastic::FirstIntInCasAntiNeutron(G4bool& inElastic,
     171                                                   const G4double availableEnergy,
     172                                                   G4HEVector pv[],
     173                                                   G4int& vecLen,
     174                                                   const G4HEVector& incidentParticle,
     175                                                   const G4HEVector& targetParticle,
     176                                                   const G4double atomicWeight)
     177
     178// AntiNeutron undergoes interaction with nucleon within a nucleus.  Check if
     179// it is energetically possible to produce pions/kaons.  If not, assume
     180// nuclear excitation occurs and input particle is degraded in energy.  No
     181// other particles are produced.
    203182// If reaction is possible, find the correct number of pions/protons/neutrons
    204183// produced using an interpolation to multiplicity data.  Replace some pions or
    205184// protons/neutrons by kaons or strange baryons according to the average
    206185// multiplicity per inelastic reaction.
    207 
    208  {
    209    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    210    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    211 
    212    static const G4double protb = 0.7;
    213    static const G4double neutb = 0.7;
    214    static const G4double     c = 1.25;
    215 
    216    static const G4int   numMul   = 1200;
    217    static const G4int   numMulAn = 400;
    218    static const G4int   numSec   = 60;
    219 
    220    G4int              neutronCode = Neutron.getCode();
    221    G4int              protonCode  = Proton.getCode();
    222 
    223    G4int               targetCode = targetParticle.getCode();
    224 //   G4double          incidentMass = incidentParticle.getMass();
    225 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    226    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    227 
    228    static G4bool first = true;
    229    static G4double protmul[numMul],  protnorm[numSec];   // proton constants
    230    static G4double protmulAn[numMulAn],protnormAn[numSec];
    231    static G4double neutmul[numMul],  neutnorm[numSec];   // neutron constants
    232    static G4double neutmulAn[numMulAn],neutnormAn[numSec];
    233 
    234                               //  misc. local variables
    235                               //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
    236 
    237    G4int i, counter, nt, np, nm, nz;
     186{
     187  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     188  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     189
     190  static const G4double protb = 0.7;
     191  static const G4double neutb = 0.7;
     192  static const G4double     c = 1.25;
     193
     194  static const G4int numMul   = 1200;
     195  static const G4int numMulAn = 400;
     196  static const G4int numSec   = 60;
     197
     198  G4int neutronCode = Neutron.getCode();
     199  G4int protonCode = Proton.getCode();
     200
     201  G4int targetCode = targetParticle.getCode();
     202  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     203
     204  static G4bool first = true;
     205  static G4double protmul[numMul],  protnorm[numSec];   // proton constants
     206  static G4double protmulAn[numMulAn],protnormAn[numSec];
     207  static G4double neutmul[numMul],  neutnorm[numSec];   // neutron constants
     208  static G4double neutmulAn[numMulAn],neutnormAn[numSec];
     209
     210  //  misc. local variables
     211  //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
     212
     213  G4int i, counter, nt, np, nm, nz;
    238214
    239215   if( first )
    240      {                         // compute normalization constants, this will only be done once
     216     {                 // compute normalization constants, this will only be done once
    241217       first = false;
    242218       for( i=0; i<numMul  ; i++ ) protmul[i]  = 0.0;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEAntiOmegaMinusInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HEAntiOmegaMinusInelastic.cc,v 1.15 2008/03/17 20:49:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HEAntiOmegaMinusInelastic.cc,v 1.17 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     35// and the low energy two-body model.  Not included is the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest. 
    4138// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4239// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4542#include "G4HEAntiOmegaMinusInelastic.hh"
    4643
    47 G4HadFinalState *  G4HEAntiOmegaMinusInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double atomicWeight = targetNucleus.GetN();
    54     const G4double atomicNumber = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
    56 
    57     G4int    incidentCode          = incidentParticle.getCode();
    58     G4double incidentMass          = incidentParticle.getMass();
    59     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    60     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    61     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    62 
    63     if(incidentKineticEnergy < 1.)
    64       {
    65         G4cout << "GHEAntiOmegaMinusInelastic: incident energy < 1 GeV" << G4endl;
    66       }
    67     if(verboseLevel > 1)
    68       {
     44G4HadFinalState*
     45G4HEAntiOmegaMinusInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     46                                           G4Nucleus& targetNucleus)
     47{
     48  G4HEVector* pv = new G4HEVector[MAXPART];
     49  const G4HadProjectile* aParticle = &aTrack;
     50  const G4double atomicWeight = targetNucleus.GetN();
     51  const G4double atomicNumber = targetNucleus.GetZ();
     52  G4HEVector incidentParticle(aParticle);
     53
     54  G4int incidentCode = incidentParticle.getCode();
     55  G4double incidentMass = incidentParticle.getMass();
     56  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     57  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     58  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     59
     60  if (incidentKineticEnergy < 1.)
     61    G4cout << "GHEAntiOmegaMinusInelastic: incident energy < 1 GeV" << G4endl;
     62
     63  if (verboseLevel > 1) {
    6964        G4cout << "G4HEAntiOmegaMinusInelastic::ApplyYourself" << G4endl;
    7065        G4cout << "incident particle " << incidentParticle.getName()
     
    7469        G4cout << "target material with (A,Z) = ("
    7570             << atomicWeight << "," << atomicNumber << ")" << G4endl;
    76       }
     71  }
    7772   
    78     G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
    79                                                  atomicWeight, atomicNumber);
    80     if(verboseLevel > 1)
    81         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     73  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     74                                              atomicWeight, atomicNumber);
     75  if (verboseLevel > 1)
     76    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    8277   
    83     incidentKineticEnergy -= inelasticity;
     78  incidentKineticEnergy -= inelasticity;
    8479   
    85     G4double excitationEnergyGNP = 0.;
    86     G4double excitationEnergyDTA = 0.;
    87 
    88     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    89                                                atomicWeight, atomicNumber,
    90                                                excitationEnergyGNP,
    91                                                excitationEnergyDTA);
    92     if(verboseLevel > 1)
    93       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     80  G4double excitationEnergyGNP = 0.;
     81  G4double excitationEnergyDTA = 0.;
     82
     83  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     84                                          atomicWeight, atomicNumber,
     85                                          excitationEnergyGNP,
     86                                          excitationEnergyDTA);
     87  if (verboseLevel > 1)
     88    G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    9489           << excitationEnergyDTA << G4endl;             
    9590
    9691
    97     incidentKineticEnergy -= excitation;
    98     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    99     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    100                                   *(incidentTotalEnergy+incidentMass));
    101 
    102 
    103     G4HEVector targetParticle;
    104     if(G4UniformRand() < atomicNumber/atomicWeight)
    105       {
    106         targetParticle.setDefinition("Proton");
    107       }
    108     else
    109       {
    110         targetParticle.setDefinition("Neutron");
    111       }
    112 
    113     G4double targetMass         = targetParticle.getMass();
    114     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    115                                        + 2.0*targetMass*incidentTotalEnergy);
    116     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    117 
    118                                                                 // this was the meaning of inElastic in the
    119                                                                 // original Gheisha stand-alone version.
    120 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    121 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    122                                                                 // by unknown reasons, it has been replaced
    123                                                                 // to the following code in Geant???
    124     G4bool inElastic = true;
    125 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    126 
    127     vecLength = 0;           
     92  incidentKineticEnergy -= excitation;
     93  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     94  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)
     95                                    *(incidentTotalEnergy+incidentMass));
     96
     97  G4HEVector targetParticle;
     98  if (G4UniformRand() < atomicNumber/atomicWeight) {
     99    targetParticle.setDefinition("Proton");
     100  } else {
     101    targetParticle.setDefinition("Neutron");
     102  }
     103
     104  G4double targetMass = targetParticle.getMass();
     105  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     106                                        + targetMass*targetMass
     107                                        + 2.0*targetMass*incidentTotalEnergy);
     108  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     109
     110  G4bool inElastic = true;
     111  vecLength = 0;           
    128112       
    129     if(verboseLevel > 1)
    130       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     113  if (verboseLevel > 1)
     114    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    131115           << incidentCode << G4endl;
    132116
    133     G4bool successful = false;
     117  G4bool successful = false;
    134118   
    135     if(inElastic || (!inElastic && atomicWeight < 1.5))
    136       {
    137         FirstIntInCasAntiOmegaMinus(inElastic, availableEnergy, pv, vecLength,
    138                                     incidentParticle, targetParticle, atomicWeight);
    139 
    140         if(verboseLevel > 1)
    141            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    142 
    143 
    144         if ((vecLength > 0) && (availableEnergy > 1.))
    145                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    146                                                   pv, vecLength,
    147                                                   incidentParticle, targetParticle);
    148             HighEnergyCascading( successful, pv, vecLength,
    149                                  excitationEnergyGNP, excitationEnergyDTA,
    150                                  incidentParticle, targetParticle,
    151                                  atomicWeight, atomicNumber);
    152         if (!successful)
    153             HighEnergyClusterProduction( successful, pv, vecLength,
    154                                          excitationEnergyGNP, excitationEnergyDTA,
    155                                          incidentParticle, targetParticle,
    156                                          atomicWeight, atomicNumber);
    157         if (!successful)
    158             MediumEnergyCascading( successful, pv, vecLength,
    159                                    excitationEnergyGNP, excitationEnergyDTA,
    160                                    incidentParticle, targetParticle,
    161                                    atomicWeight, atomicNumber);
    162 
    163         if (!successful)
    164             MediumEnergyClusterProduction( successful, pv, vecLength,
    165                                            excitationEnergyGNP, excitationEnergyDTA,       
    166                                            incidentParticle, targetParticle,
    167                                            atomicWeight, atomicNumber);
    168         if (!successful)
    169             QuasiElasticScattering( successful, pv, vecLength,
    170                                     excitationEnergyGNP, excitationEnergyDTA,
    171                                     incidentParticle, targetParticle,
    172                                     atomicWeight, atomicNumber);
    173       }
    174     if (!successful)
    175       {
    176             ElasticScattering( successful, pv, vecLength,
    177                                incidentParticle,   
    178                                atomicWeight, atomicNumber);
    179       }
    180 
    181     if (!successful)
    182       {
    183         G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles" << G4endl;
    184       }
    185       FillParticleChange(pv,  vecLength);
    186       delete [] pv;
    187       theParticleChange.SetStatusChange(stopAndKill);
    188       return & theParticleChange;
    189   }
     119  FirstIntInCasAntiOmegaMinus(inElastic, availableEnergy, pv, vecLength,
     120                              incidentParticle, targetParticle, atomicWeight);
     121
     122  if (verboseLevel > 1)
     123    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
     124
     125  if ((vecLength > 0) && (availableEnergy > 1.))
     126    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     127                                  pv, vecLength,
     128                                  incidentParticle, targetParticle);
     129  HighEnergyCascading(successful, pv, vecLength,
     130                      excitationEnergyGNP, excitationEnergyDTA,
     131                      incidentParticle, targetParticle,
     132                      atomicWeight, atomicNumber);
     133  if (!successful)
     134    HighEnergyClusterProduction(successful, pv, vecLength,
     135                                excitationEnergyGNP, excitationEnergyDTA,
     136                                incidentParticle, targetParticle,
     137                                atomicWeight, atomicNumber);
     138  if (!successful)
     139    MediumEnergyCascading(successful, pv, vecLength,
     140                          excitationEnergyGNP, excitationEnergyDTA,
     141                          incidentParticle, targetParticle,
     142                          atomicWeight, atomicNumber);
     143
     144  if (!successful)
     145    MediumEnergyClusterProduction(successful, pv, vecLength,
     146                                  excitationEnergyGNP, excitationEnergyDTA,       
     147                                  incidentParticle, targetParticle,
     148                                  atomicWeight, atomicNumber);
     149  if (!successful)
     150    QuasiElasticScattering(successful, pv, vecLength,
     151                           excitationEnergyGNP, excitationEnergyDTA,
     152                           incidentParticle, targetParticle,
     153                           atomicWeight, atomicNumber);
     154  if (!successful)
     155    ElasticScattering(successful, pv, vecLength,
     156                      incidentParticle,   
     157                      atomicWeight, atomicNumber);
     158
     159  if (!successful)
     160    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     161           << G4endl;
     162
     163  FillParticleChange(pv,  vecLength);
     164  delete [] pv;
     165  theParticleChange.SetStatusChange(stopAndKill);
     166  return &theParticleChange;
     167}
     168
    190169
    191170void
    192 G4HEAntiOmegaMinusInelastic::FirstIntInCasAntiOmegaMinus( G4bool &inElastic,
    193                                                           const G4double availableEnergy,
    194                                                           G4HEVector pv[],
    195                                                           G4int &vecLen,
    196                                                           G4HEVector incidentParticle,
    197                                                           G4HEVector targetParticle,
    198                                                           const G4double atomicWeight )
     171G4HEAntiOmegaMinusInelastic::FirstIntInCasAntiOmegaMinus(G4bool& inElastic,
     172                                                         const G4double availableEnergy,
     173                                                         G4HEVector pv[],
     174                                                         G4int& vecLen,
     175                                                         const G4HEVector& incidentParticle,
     176                                                         const G4HEVector& targetParticle,
     177                                                         const G4double atomicWeight)
    199178
    200179// AntiOmega undergoes interaction with nucleon within a nucleus. 
    201180// As in Geant3, we think that this routine has absolutely no influence
    202181// on the whole performance of the program. Take AntiLambda instaed.
    203 
    204  {
    205    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    206    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    207 
    208    static const G4double protb = 0.7;
    209    static const G4double neutb = 0.7;
    210    static const G4double     c = 1.25;
    211 
    212    static const G4int   numMul   = 1200;
    213    static const G4int   numMulAn = 400;
    214    static const G4int   numSec   = 60;
    215 
    216 //   G4int              neutronCode = Neutron.getCode();
    217    G4int              protonCode  = Proton.getCode();
    218 
    219    G4int               targetCode = targetParticle.getCode();
    220 //   G4double          incidentMass = incidentParticle.getMass();
    221 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    222    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    223 
    224    static G4bool first = true;
    225    static G4double protmul[numMul],  protnorm[numSec];   // proton constants
    226    static G4double protmulAn[numMulAn],protnormAn[numSec];
    227    static G4double neutmul[numMul],  neutnorm[numSec];   // neutron constants
    228    static G4double neutmulAn[numMulAn],neutnormAn[numSec];
    229 
    230                               //  misc. local variables
    231                               //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
     182{
     183  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     184  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     185
     186  static const G4double protb = 0.7;
     187  static const G4double neutb = 0.7;
     188  static const G4double     c = 1.25;
     189
     190  static const G4int numMul   = 1200;
     191  static const G4int numMulAn = 400;
     192  static const G4int numSec   = 60;
     193
     194  G4int protonCode = Proton.getCode();
     195
     196  G4int targetCode = targetParticle.getCode();
     197  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     198
     199  static G4bool first = true;
     200  static G4double protmul[numMul],  protnorm[numSec];   // proton constants
     201  static G4double protmulAn[numMulAn],protnormAn[numSec];
     202  static G4double neutmul[numMul],  neutnorm[numSec];   // neutron constants
     203  static G4double neutmulAn[numMulAn],neutnormAn[numSec];
     204
     205  //  misc. local variables
     206  //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
    232207
    233208   G4int i, counter, nt, np, nm, nz;
    234209
    235210   if( first )
    236      {                         // compute normalization constants, this will only be done once
     211     {             // compute normalization constants, this will only be done once
    237212       first = false;
    238213       for( i=0; i<numMul  ; i++ ) protmul[i]  = 0.0;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEAntiProtonInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HEAntiProtonInelastic.cc,v 1.14 2008/03/17 20:49:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HEAntiProtonInelastic.cc,v 1.16 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     35// and the low energy two-body model. Not included are the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest. 
    4138// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4239// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4542#include "G4HEAntiProtonInelastic.hh"
    4643
    47 G4HadFinalState *  G4HEAntiProtonInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double atomicWeight = targetNucleus.GetN();
    54     const G4double atomicNumber = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
    56 
    57     G4int    incidentCode          = incidentParticle.getCode();
    58     G4double incidentMass          = incidentParticle.getMass();
    59     G4double incidentTotalEnergy  = incidentParticle.getEnergy();
    60     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    61     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    62 
    63     if(incidentKineticEnergy < 1.)
    64       {
    65         G4cout << "GHEAntiProtonInelastic: incident energy < 1 GeV" << G4endl;
    66       }
    67     if(verboseLevel > 1)
    68       {
    69         G4cout << "G4HEAntiProtonInelastic::ApplyYourself" << G4endl;
    70         G4cout << "incident particle " << incidentParticle.getName()
    71              << "mass "              << incidentMass
    72              << "kinetic energy "    << incidentKineticEnergy
    73              << G4endl;
    74         G4cout << "target material with (A,Z) = ("
    75              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    76       }
    77 
    78     G4double inelasticity  = NuclearInelasticity(incidentKineticEnergy,
    79                                                  atomicWeight, atomicNumber);
    80     if(verboseLevel > 1)
    81         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     44G4HadFinalState*
     45G4HEAntiProtonInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     46                                       G4Nucleus& targetNucleus)
     47{
     48  G4HEVector* pv = new G4HEVector[MAXPART];
     49  const G4HadProjectile* aParticle = &aTrack;
     50  const G4double atomicWeight = targetNucleus.GetN();
     51  const G4double atomicNumber = targetNucleus.GetZ();
     52  G4HEVector incidentParticle(aParticle);
     53
     54  G4int incidentCode = incidentParticle.getCode();
     55  G4double incidentMass = incidentParticle.getMass();
     56  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     57  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     58  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     59
     60  if (incidentKineticEnergy < 1.)
     61    G4cout << "GHEAntiProtonInelastic: incident energy < 1 GeV" << G4endl;
     62
     63  if (verboseLevel > 1) {
     64    G4cout << "G4HEAntiProtonInelastic::ApplyYourself" << G4endl;
     65    G4cout << "incident particle " << incidentParticle.getName()
     66           << "mass "              << incidentMass
     67           << "kinetic energy "    << incidentKineticEnergy
     68           << G4endl;
     69    G4cout << "target material with (A,Z) = ("
     70           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     71  }
     72
     73  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     74                                              atomicWeight, atomicNumber);
     75  if (verboseLevel > 1)
     76    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     77
     78  incidentKineticEnergy -= inelasticity;
    8279   
    83 
    84     incidentKineticEnergy -= inelasticity;
     80  G4double excitationEnergyGNP = 0.;
     81  G4double excitationEnergyDTA = 0.;
     82
     83  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     84                                          atomicWeight, atomicNumber,
     85                                          excitationEnergyGNP,
     86                                          excitationEnergyDTA);
     87  if (verboseLevel > 1)
     88    G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     89           << excitationEnergyDTA << G4endl;             
     90
     91
     92  incidentKineticEnergy -= excitation;
     93  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     94  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)
     95                                    *(incidentTotalEnergy+incidentMass));
     96
     97  G4HEVector targetParticle;
     98  if (G4UniformRand() < atomicNumber/atomicWeight) {
     99    targetParticle.setDefinition("Proton");
     100  } else {
     101    targetParticle.setDefinition("Neutron");
     102  }
     103
     104  G4double targetMass = targetParticle.getMass();
     105  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     106                                        + targetMass*targetMass
     107                                        + 2.0*targetMass*incidentTotalEnergy);
     108  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     109
     110  G4bool inElastic = true;
     111  vecLength = 0;   
     112       
     113  if (verboseLevel > 1)
     114    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     115           << incidentCode << G4endl;
     116
     117  G4bool successful = false;
    85118   
    86     G4double excitationEnergyGNP = 0.;
    87     G4double excitationEnergyDTA = 0.;
    88 
    89     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    90                                                atomicWeight, atomicNumber,
    91                                                excitationEnergyGNP,
    92                                                excitationEnergyDTA);
    93     if(verboseLevel > 1)
    94       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    95            << excitationEnergyDTA << G4endl;             
    96 
    97 
    98     incidentKineticEnergy -= excitation;
    99     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    100     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    101                                   *(incidentTotalEnergy+incidentMass));
    102 
    103     G4HEVector targetParticle;
    104     if(G4UniformRand() < atomicNumber/atomicWeight)
    105       {
    106         targetParticle.setDefinition("Proton");
    107       }
    108     else
    109       {
    110         targetParticle.setDefinition("Neutron");
    111       }
    112 
    113     G4double targetMass         = targetParticle.getMass();
    114     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    115                                        + 2.0*targetMass*incidentTotalEnergy);
    116     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    117 
    118                                                                 // this was the meaning of inElastic in the
    119                                                                 // original Gheisha stand-alone version.
    120 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    121 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    122                                                                 // by unknown reasons, it has been replaced
    123                                                                 // to the following code in Geant???
    124     G4bool inElastic = true;
    125 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    126 
    127     vecLength  = 0;           
    128        
    129     if(verboseLevel > 1)
    130       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    131            << incidentCode << G4endl;
    132 
    133     G4bool successful = false;
    134    
    135     if(inElastic || (!inElastic && atomicWeight < 1.5))
    136       {
    137         FirstIntInCasAntiProton(inElastic, availableEnergy, pv, vecLength,
    138                                 incidentParticle, targetParticle, atomicWeight);
    139 
    140         if(verboseLevel > 1)
    141            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    142 
    143 
    144         if ((vecLength > 0) && (availableEnergy > 1.))
    145                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    146                                                   pv, vecLength,
    147                                                   incidentParticle, targetParticle);
    148             HighEnergyCascading( successful, pv, vecLength,
    149                                  excitationEnergyGNP, excitationEnergyDTA,
    150                                  incidentParticle, targetParticle,
    151                                  atomicWeight, atomicNumber);
    152         if (!successful)
    153             HighEnergyClusterProduction( successful, pv, vecLength,
    154                                          excitationEnergyGNP, excitationEnergyDTA,
    155                                          incidentParticle, targetParticle,
    156                                          atomicWeight, atomicNumber);
    157         if (!successful)
    158             MediumEnergyCascading( successful, pv, vecLength,
    159                                    excitationEnergyGNP, excitationEnergyDTA,
    160                                    incidentParticle, targetParticle,
    161                                    atomicWeight, atomicNumber);
    162 
    163         if (!successful)
    164             MediumEnergyClusterProduction( successful, pv, vecLength,
    165                                            excitationEnergyGNP, excitationEnergyDTA,       
    166                                            incidentParticle, targetParticle,
    167                                            atomicWeight, atomicNumber);
    168         if (!successful)
    169             QuasiElasticScattering( successful, pv, vecLength,
    170                                     excitationEnergyGNP, excitationEnergyDTA,
    171                                     incidentParticle, targetParticle,
    172                                     atomicWeight, atomicNumber);
    173       }
    174     if (!successful)
    175       {
    176             ElasticScattering( successful, pv, vecLength,
    177                                incidentParticle,   
    178                                atomicWeight, atomicNumber);
    179       }
    180 
    181     if (!successful)
    182       {
    183         G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles" << G4endl;
    184       }
    185       FillParticleChange(pv,  vecLength);
    186       delete [] pv;
    187       theParticleChange.SetStatusChange(stopAndKill);
    188       return & theParticleChange;
    189   }
     119  FirstIntInCasAntiProton(inElastic, availableEnergy, pv, vecLength,
     120                          incidentParticle, targetParticle, atomicWeight);
     121
     122  if (verboseLevel > 1)
     123    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
     124
     125  if ((vecLength > 0) && (availableEnergy > 1.))
     126    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     127                                  pv, vecLength,
     128                                  incidentParticle, targetParticle);
     129  HighEnergyCascading(successful, pv, vecLength,
     130                      excitationEnergyGNP, excitationEnergyDTA,
     131                      incidentParticle, targetParticle,
     132                      atomicWeight, atomicNumber);
     133  if (!successful)
     134    HighEnergyClusterProduction(successful, pv, vecLength,
     135                                excitationEnergyGNP, excitationEnergyDTA,
     136                                incidentParticle, targetParticle,
     137                                atomicWeight, atomicNumber);
     138  if (!successful)
     139    MediumEnergyCascading(successful, pv, vecLength,
     140                          excitationEnergyGNP, excitationEnergyDTA,
     141                          incidentParticle, targetParticle,
     142                          atomicWeight, atomicNumber);
     143
     144  if (!successful)
     145    MediumEnergyClusterProduction(successful, pv, vecLength,
     146                                  excitationEnergyGNP, excitationEnergyDTA,       
     147                                  incidentParticle, targetParticle,
     148                                  atomicWeight, atomicNumber);
     149  if (!successful)
     150    QuasiElasticScattering(successful, pv, vecLength,
     151                           excitationEnergyGNP, excitationEnergyDTA,
     152                           incidentParticle, targetParticle,
     153                           atomicWeight, atomicNumber);
     154  if (!successful)
     155    ElasticScattering(successful, pv, vecLength,
     156                      incidentParticle,   
     157                      atomicWeight, atomicNumber);
     158
     159  if (!successful)
     160    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     161           << G4endl;
     162
     163  FillParticleChange(pv,  vecLength);
     164  delete [] pv;
     165  theParticleChange.SetStatusChange(stopAndKill);
     166  return & theParticleChange;
     167}
     168
    190169
    191170void
    192 G4HEAntiProtonInelastic::FirstIntInCasAntiProton( G4bool &inElastic,
    193                                                   const G4double availableEnergy,
    194                                                   G4HEVector pv[],
    195                                                   G4int &vecLen,
    196                                                   G4HEVector incidentParticle,
    197                                                   G4HEVector targetParticle,
    198                                                   const G4double atomicWeight)
     171G4HEAntiProtonInelastic::FirstIntInCasAntiProton(G4bool& inElastic,
     172                                                 const G4double availableEnergy,
     173                                                 G4HEVector pv[],
     174                                                 G4int& vecLen,
     175                                                 const G4HEVector& incidentParticle,
     176                                                 const G4HEVector& targetParticle,
     177                                                 const G4double atomicWeight)
    199178
    200179// AntiProton undergoes interaction with nucleon within a nucleus.  Check if it is
     
    205184// protons/neutrons by kaons or strange baryons according to the average
    206185// multiplicity per inelastic reaction.
    207 
    208  {
    209    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    210    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    211 
    212    static const G4double protb = 0.7;
    213    static const G4double neutb = 0.7;
    214    static const G4double     c = 1.25;
    215 
    216    static const G4int   numMul   = 1200;
    217    static const G4int   numMulAn = 400;
    218    static const G4int   numSec   = 60;
    219 
    220    G4int              neutronCode = Neutron.getCode();
    221    G4int              protonCode  = Proton.getCode();
    222 
    223    G4int               targetCode = targetParticle.getCode();
    224 //   G4double          incidentMass = incidentParticle.getMass();
    225 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    226    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    227 
    228    static G4bool first = true;
    229    static G4double protmul[numMul],  protnorm[numSec];   // proton constants
    230    static G4double protmulAn[numMulAn],protnormAn[numSec];
    231    static G4double neutmul[numMul],  neutnorm[numSec];   // neutron constants
    232    static G4double neutmulAn[numMulAn],neutnormAn[numSec];
    233 
    234                               //  misc. local variables
    235                               //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
    236 
    237    G4int i, counter, nt, np, nm, nz;
     186{
     187  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     188  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     189
     190  static const G4double protb = 0.7;
     191  static const G4double neutb = 0.7;
     192  static const G4double     c = 1.25;
     193
     194  static const G4int numMul   = 1200;
     195  static const G4int numMulAn = 400;
     196  static const G4int numSec   = 60;
     197
     198  G4int neutronCode = Neutron.getCode();
     199  G4int protonCode  = Proton.getCode();
     200
     201  G4int targetCode = targetParticle.getCode();
     202  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     203
     204  static G4bool first = true;
     205  static G4double protmul[numMul],  protnorm[numSec];   // proton constants
     206  static G4double protmulAn[numMulAn],protnormAn[numSec];
     207  static G4double neutmul[numMul],  neutnorm[numSec];   // neutron constants
     208  static G4double neutmulAn[numMulAn],neutnormAn[numSec];
     209
     210  //  misc. local variables
     211  //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
     212
     213  G4int i, counter, nt, np, nm, nz;
    238214
    239215   if( first )
    240      {                         // compute normalization constants, this will only be done once
     216     {             // compute normalization constants, this will only be done once
    241217       first = false;
    242218       for( i=0; i<numMul  ; i++ ) protmul[i]  = 0.0;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEAntiSigmaMinusInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HEAntiSigmaMinusInelastic.cc,v 1.15 2008/03/17 20:49:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HEAntiSigmaMinusInelastic.cc,v 1.17 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     35// and the low energy two-body model. Not included are the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest. 
    4138// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4239// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4542#include "G4HEAntiSigmaMinusInelastic.hh"
    4643
    47 G4HadFinalState *  G4HEAntiSigmaMinusInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double atomicWeight = targetNucleus.GetN();
    54     const G4double atomicNumber = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
    56 
    57     G4int    incidentCode          = incidentParticle.getCode();
    58     G4double incidentMass          = incidentParticle.getMass();
    59     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    60     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    61     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    62 
    63     if(incidentKineticEnergy < 1.)
    64       {
    65         G4cout << "GHEAntiSigmaMinusInelastic: incident energy < 1 GeV" << G4endl;
    66       }
    67     if(verboseLevel > 1)
    68       {
    69         G4cout << "G4HEAntiSigmaMinusInelastic::ApplyYourself" << G4endl;
    70         G4cout << "incident particle " << incidentParticle.getName()
    71              << "mass "              << incidentMass
    72              << "kinetic energy "    << incidentKineticEnergy
    73              << G4endl;
    74         G4cout << "target material with (A,Z) = ("
    75              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    76       }
     44G4HadFinalState*
     45G4HEAntiSigmaMinusInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     46                                           G4Nucleus& targetNucleus)
     47{
     48  G4HEVector* pv = new G4HEVector[MAXPART];
     49  const G4HadProjectile* aParticle = &aTrack;
     50  const G4double atomicWeight = targetNucleus.GetN();
     51  const G4double atomicNumber = targetNucleus.GetZ();
     52  G4HEVector incidentParticle(aParticle);
     53
     54  G4int incidentCode = incidentParticle.getCode();
     55  G4double incidentMass = incidentParticle.getMass();
     56  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     57  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     58  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     59
     60  if (incidentKineticEnergy < 1.)
     61    G4cout << "GHEAntiSigmaMinusInelastic: incident energy < 1 GeV" << G4endl;
     62
     63  if (verboseLevel > 1) {
     64    G4cout << "G4HEAntiSigmaMinusInelastic::ApplyYourself" << G4endl;
     65    G4cout << "incident particle " << incidentParticle.getName()
     66           << "mass "              << incidentMass
     67           << "kinetic energy "    << incidentKineticEnergy
     68           << G4endl;
     69    G4cout << "target material with (A,Z) = ("
     70           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     71  }
    7772   
    78     G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
    79                                                  atomicWeight, atomicNumber);
    80     if(verboseLevel > 1)
    81         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     73  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     74                                              atomicWeight, atomicNumber);
     75  if (verboseLevel > 1)
     76    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    8277   
    83     incidentKineticEnergy -= inelasticity;
     78  incidentKineticEnergy -= inelasticity;
    8479   
    85     G4double excitationEnergyGNP = 0.;
    86     G4double excitationEnergyDTA = 0.;
    87 
    88     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    89                                                atomicWeight, atomicNumber,
    90                                                excitationEnergyGNP,
    91                                                excitationEnergyDTA);
    92     if(verboseLevel > 1)
    93       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    94            << excitationEnergyDTA << G4endl;             
    95 
    96 
    97     incidentKineticEnergy -= excitation;
    98     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    99     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    100                                   *(incidentTotalEnergy+incidentMass));
    101 
    102     G4HEVector targetParticle;
    103     if(G4UniformRand() < atomicNumber/atomicWeight)
    104       {
    105         targetParticle.setDefinition("Proton");
    106       }
    107     else
    108       {
    109         targetParticle.setDefinition("Neutron");
    110       }
    111 
    112     G4double targetMass         = targetParticle.getMass();
    113     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    114                                        + 2.0*targetMass*incidentTotalEnergy);
    115     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    116 
    117                                                                 // this was the meaning of inElastic in the
    118                                                                 // original Gheisha stand-alone version.
    119 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    120 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    121                                                                 // by unknown reasons, it has been replaced
    122                                                                 // to the following code in Geant???
    123     G4bool inElastic = true;
    124 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    125 
    126     vecLength  = 0;           
     80  G4double excitationEnergyGNP = 0.;
     81  G4double excitationEnergyDTA = 0.;
     82
     83  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     84                                          atomicWeight, atomicNumber,
     85                                          excitationEnergyGNP,
     86                                          excitationEnergyDTA);
     87 if (verboseLevel > 1)
     88   G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     89          << excitationEnergyDTA << G4endl;             
     90
     91  incidentKineticEnergy -= excitation;
     92  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     93  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)
     94                                    *(incidentTotalEnergy+incidentMass));
     95
     96  G4HEVector targetParticle;
     97  if (G4UniformRand() < atomicNumber/atomicWeight) {
     98    targetParticle.setDefinition("Proton");
     99  } else {
     100    targetParticle.setDefinition("Neutron");
     101  }
     102
     103  G4double targetMass = targetParticle.getMass();
     104  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     105                                        + targetMass*targetMass
     106                                        + 2.0*targetMass*incidentTotalEnergy);
     107  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     108
     109  G4bool inElastic = true;
     110  vecLength  = 0;           
    127111       
    128     if(verboseLevel > 1)
    129       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     112  if (verboseLevel > 1)
     113    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    130114           << incidentCode << G4endl;
    131115
    132     G4bool successful = false;
     116  G4bool successful = false;
    133117   
    134     if(inElastic || (!inElastic && atomicWeight < 1.5))
    135       {
    136         FirstIntInCasAntiSigmaMinus(inElastic, availableEnergy, pv, vecLength,
    137                                     incidentParticle, targetParticle, atomicWeight);
    138 
    139         if(verboseLevel > 1)
    140            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    141 
    142 
    143         if ((vecLength > 0) && (availableEnergy > 1.))
    144                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    145                                                   pv, vecLength,
    146                                                   incidentParticle, targetParticle);
    147             HighEnergyCascading( successful, pv, vecLength,
    148                                  excitationEnergyGNP, excitationEnergyDTA,
    149                                  incidentParticle, targetParticle,
    150                                  atomicWeight, atomicNumber);
    151         if (!successful)
    152             HighEnergyClusterProduction( successful, pv, vecLength,
    153                                          excitationEnergyGNP, excitationEnergyDTA,
    154                                          incidentParticle, targetParticle,
    155                                          atomicWeight, atomicNumber);
    156         if (!successful)
    157             MediumEnergyCascading( successful, pv, vecLength,
    158                                    excitationEnergyGNP, excitationEnergyDTA,
    159                                    incidentParticle, targetParticle,
    160                                    atomicWeight, atomicNumber);
    161 
    162         if (!successful)
    163             MediumEnergyClusterProduction( successful, pv, vecLength,
    164                                            excitationEnergyGNP, excitationEnergyDTA,       
    165                                            incidentParticle, targetParticle,
    166                                            atomicWeight, atomicNumber);
    167         if (!successful)
    168             QuasiElasticScattering( successful, pv, vecLength,
    169                                     excitationEnergyGNP, excitationEnergyDTA,
    170                                     incidentParticle, targetParticle,
    171                                     atomicWeight, atomicNumber);
    172       }
    173     if (!successful)
    174       {
    175             ElasticScattering( successful, pv, vecLength,
    176                                incidentParticle,   
    177                                atomicWeight, atomicNumber);
    178       }
    179 
    180     if (!successful)
    181       {
    182          G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles" << G4endl;
    183       }
    184       FillParticleChange(pv,  vecLength);
    185       delete [] pv;
    186       theParticleChange.SetStatusChange(stopAndKill);
    187       return & theParticleChange;
    188   }
     118  FirstIntInCasAntiSigmaMinus(inElastic, availableEnergy, pv, vecLength,
     119                              incidentParticle, targetParticle, atomicWeight);
     120
     121  if (verboseLevel > 1)
     122    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl;
     123
     124  if ((vecLength > 0) && (availableEnergy > 1.))
     125    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     126                                  pv, vecLength,
     127                                  incidentParticle, targetParticle);
     128  HighEnergyCascading(successful, pv, vecLength,
     129                      excitationEnergyGNP, excitationEnergyDTA,
     130                      incidentParticle, targetParticle,
     131                      atomicWeight, atomicNumber);
     132  if (!successful)
     133    HighEnergyClusterProduction(successful, pv, vecLength,
     134                                excitationEnergyGNP, excitationEnergyDTA,
     135                                incidentParticle, targetParticle,
     136                                atomicWeight, atomicNumber);
     137  if (!successful)
     138    MediumEnergyCascading(successful, pv, vecLength,
     139                          excitationEnergyGNP, excitationEnergyDTA,
     140                          incidentParticle, targetParticle,
     141                          atomicWeight, atomicNumber);
     142
     143  if (!successful)
     144    MediumEnergyClusterProduction(successful, pv, vecLength,
     145                                  excitationEnergyGNP, excitationEnergyDTA,       
     146                                  incidentParticle, targetParticle,
     147                                  atomicWeight, atomicNumber);
     148  if (!successful)
     149    QuasiElasticScattering(successful, pv, vecLength,
     150                           excitationEnergyGNP, excitationEnergyDTA,
     151                           incidentParticle, targetParticle,
     152                           atomicWeight, atomicNumber);
     153  if (!successful)
     154    ElasticScattering(successful, pv, vecLength,
     155                      incidentParticle,   
     156                      atomicWeight, atomicNumber);
     157
     158  if (!successful)
     159    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     160           << G4endl;
     161  FillParticleChange(pv,  vecLength);
     162  delete [] pv;
     163  theParticleChange.SetStatusChange(stopAndKill);
     164  return &theParticleChange;
     165}
     166
    189167
    190168void
    191 G4HEAntiSigmaMinusInelastic::FirstIntInCasAntiSigmaMinus( G4bool &inElastic,
    192                                                           const G4double availableEnergy,
    193                                                           G4HEVector pv[],
    194                                                           G4int &vecLen,
    195                                                           G4HEVector incidentParticle,
    196                                                           G4HEVector targetParticle,
    197                                                           const G4double atomicWeight)
     169G4HEAntiSigmaMinusInelastic::FirstIntInCasAntiSigmaMinus(G4bool& inElastic,
     170                                                         const G4double availableEnergy,
     171                                                         G4HEVector pv[],
     172                                                         G4int& vecLen,
     173                                                         const G4HEVector& incidentParticle,
     174                                                         const G4HEVector& targetParticle,
     175                                                         const G4double atomicWeight)
    198176
    199177// AntiSigma- undergoes interaction with nucleon within a nucleus.  Check if it is
     
    204182// protons/neutrons by kaons or strange baryons according to the average
    205183// multiplicity per inelastic reaction.
    206 
    207  {
    208    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    209    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    210 
    211    static const G4double protb = 0.7;
    212    static const G4double neutb = 0.7;
    213    static const G4double     c = 1.25;
    214 
    215    static const G4int   numMul   = 1200;
    216    static const G4int   numMulAn = 400;
    217    static const G4int   numSec   = 60;
    218 
    219    G4int              neutronCode = Neutron.getCode();
    220    G4int              protonCode  = Proton.getCode();
    221 
    222    G4int               targetCode = targetParticle.getCode();
    223 //   G4double          incidentMass = incidentParticle.getMass();
    224 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    225    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    226 
    227    static G4bool first = true;
    228    static G4double protmul[numMul],  protnorm[numSec];   // proton constants
    229    static G4double protmulAn[numMulAn],protnormAn[numSec];
    230    static G4double neutmul[numMul],  neutnorm[numSec];   // neutron constants
    231    static G4double neutmulAn[numMulAn],neutnormAn[numSec];
    232 
    233                               //  misc. local variables
    234                               //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
    235 
    236    G4int i, counter, nt, np, nm, nz;
     184{
     185  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     186  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     187
     188  static const G4double protb = 0.7;
     189  static const G4double neutb = 0.7;
     190  static const G4double     c = 1.25;
     191
     192  static const G4int numMul   = 1200;
     193  static const G4int numMulAn = 400;
     194  static const G4int numSec   = 60;
     195
     196  G4int neutronCode = Neutron.getCode();
     197  G4int protonCode  = Proton.getCode();
     198
     199  G4int targetCode = targetParticle.getCode();
     200  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     201
     202  static G4bool first = true;
     203  static G4double protmul[numMul],  protnorm[numSec];   // proton constants
     204  static G4double protmulAn[numMulAn],protnormAn[numSec];
     205  static G4double neutmul[numMul],  neutnorm[numSec];   // neutron constants
     206  static G4double neutmulAn[numMulAn],neutnormAn[numSec];
     207
     208  //  misc. local variables
     209  //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
     210
     211  G4int i, counter, nt, np, nm, nz;
    237212
    238213   if( first )
    239      {                         // compute normalization constants, this will only be done once
     214     {               // compute normalization constants, this will only be done once
    240215       first = false;
    241216       for( i=0; i<numMul  ; i++ ) protmul[i]  = 0.0;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEAntiSigmaPlusInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HEAntiSigmaPlusInelastic.cc,v 1.15 2008/03/17 20:49:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HEAntiSigmaPlusInelastic.cc,v 1.17 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     35// and the low energy two-body model. Not included are the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest. 
    4138// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4239// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4542#include "G4HEAntiSigmaPlusInelastic.hh"
    4643
    47 G4HadFinalState *  G4HEAntiSigmaPlusInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double atomicWeight = targetNucleus.GetN();
    54     const G4double atomicNumber = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
    56 
    57     G4int    incidentCode          = incidentParticle.getCode();
    58     G4double incidentMass          = incidentParticle.getMass();
    59     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    60     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    61     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    62 
    63     if(incidentKineticEnergy < 1.)
    64       {
    65         G4cout << "GHEAntiSigmaPlusInelastic: incident energy < 1 GeV" << G4endl;
    66       }
    67     if(verboseLevel > 1)
    68       {
    69         G4cout << "G4HEAntiSigmaPlusInelastic::ApplyYourself" << G4endl;
    70         G4cout << "incident particle " << incidentParticle.getName()
    71              << "mass "              << incidentMass
    72              << "kinetic energy "    << incidentKineticEnergy
    73              << G4endl;
    74         G4cout << "target material with (A,Z) = ("
    75              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    76       }
    77 
    78     G4double inelasticity  = NuclearInelasticity(incidentKineticEnergy,
    79                                                  atomicWeight, atomicNumber);
    80     if(verboseLevel > 1)
    81         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    82 
    83     incidentKineticEnergy -= inelasticity;
     44G4HadFinalState*
     45G4HEAntiSigmaPlusInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     46                                          G4Nucleus& targetNucleus)
     47{
     48  G4HEVector* pv = new G4HEVector[MAXPART];
     49  const G4HadProjectile* aParticle = &aTrack;
     50  const G4double atomicWeight = targetNucleus.GetN();
     51  const G4double atomicNumber = targetNucleus.GetZ();
     52  G4HEVector incidentParticle(aParticle);
     53
     54  G4int incidentCode = incidentParticle.getCode();
     55  G4double incidentMass = incidentParticle.getMass();
     56  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     57  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     58  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     59
     60  if (incidentKineticEnergy < 1.)
     61    G4cout << "GHEAntiSigmaPlusInelastic: incident energy < 1 GeV" << G4endl;
     62
     63  if (verboseLevel > 1) {
     64    G4cout << "G4HEAntiSigmaPlusInelastic::ApplyYourself" << G4endl;
     65    G4cout << "incident particle " << incidentParticle.getName()
     66           << "mass "              << incidentMass
     67           << "kinetic energy "    << incidentKineticEnergy
     68           << G4endl;
     69    G4cout << "target material with (A,Z) = ("
     70           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     71  }
     72
     73  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     74                                              atomicWeight, atomicNumber);
     75  if (verboseLevel > 1)
     76    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     77
     78  incidentKineticEnergy -= inelasticity;
    8479   
    85     G4double excitationEnergyGNP = 0.;
    86     G4double excitationEnergyDTA = 0.;
    87 
    88     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    89                                                atomicWeight, atomicNumber,
    90                                                excitationEnergyGNP,
    91                                                excitationEnergyDTA);
    92     if(verboseLevel > 1)
    93       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     80  G4double excitationEnergyGNP = 0.;
     81  G4double excitationEnergyDTA = 0.;
     82
     83  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     84                                          atomicWeight, atomicNumber,
     85                                          excitationEnergyGNP,
     86                                          excitationEnergyDTA);
     87  if (verboseLevel > 1)
     88    G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    9489           << excitationEnergyDTA << G4endl;             
    9590
    96 
    97     incidentKineticEnergy -= excitation;
    98     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    99     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    100                                   *(incidentTotalEnergy+incidentMass));
    101 
    102 
    103     G4HEVector targetParticle;
    104     if(G4UniformRand() < atomicNumber/atomicWeight)
    105       {
    106         targetParticle.setDefinition("Proton");
    107       }
    108     else
    109       {
    110         targetParticle.setDefinition("Neutron");
    111       }
    112 
    113     G4double targetMass         = targetParticle.getMass();
    114     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    115                                        + 2.0*targetMass*incidentTotalEnergy);
    116     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    117 
    118                                                                 // this was the meaning of inElastic in the
    119                                                                 // original Gheisha stand-alone version.
    120 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    121 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    122                                                                 // by unknown reasons, it has been replaced
    123                                                                 // to the following code in Geant???
    124     G4bool inElastic = true;
    125 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    126 
    127     vecLength = 0;           
     91  incidentKineticEnergy -= excitation;
     92  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     93  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)                   
     94                                    *(incidentTotalEnergy+incidentMass));
     95
     96  G4HEVector targetParticle;
     97  if (G4UniformRand() < atomicNumber/atomicWeight) {
     98    targetParticle.setDefinition("Proton");
     99  } else {
     100    targetParticle.setDefinition("Neutron");
     101  }
     102
     103  G4double targetMass = targetParticle.getMass();
     104  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     105                                        + targetMass*targetMass
     106                                        + 2.0*targetMass*incidentTotalEnergy);
     107  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     108
     109  G4bool inElastic = true;
     110  vecLength = 0;
    128111       
    129     if(verboseLevel > 1)
    130       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     112  if (verboseLevel > 1)
     113    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    131114           << incidentCode << G4endl;
    132115
    133     G4bool successful = false;
     116  G4bool successful = false;
    134117   
    135     if(inElastic || (!inElastic && atomicWeight < 1.5))
    136       {
    137         FirstIntInCasAntiSigmaPlus(inElastic, availableEnergy, pv, vecLength,
    138                                    incidentParticle, targetParticle, atomicWeight);
    139 
    140         if(verboseLevel > 1)
    141            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    142 
    143 
    144         if ((vecLength > 0) && (availableEnergy > 1.))
    145                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    146                                                   pv, vecLength,
    147                                                   incidentParticle, targetParticle);
    148             HighEnergyCascading( successful, pv, vecLength,
    149                                  excitationEnergyGNP, excitationEnergyDTA,
    150                                  incidentParticle, targetParticle,
    151                                  atomicWeight, atomicNumber);
    152         if (!successful)
    153             HighEnergyClusterProduction( successful, pv, vecLength,
    154                                          excitationEnergyGNP, excitationEnergyDTA,
    155                                          incidentParticle, targetParticle,
    156                                          atomicWeight, atomicNumber);
    157         if (!successful)
    158             MediumEnergyCascading( successful, pv, vecLength,
    159                                    excitationEnergyGNP, excitationEnergyDTA,
    160                                    incidentParticle, targetParticle,
    161                                    atomicWeight, atomicNumber);
    162 
    163         if (!successful)
    164             MediumEnergyClusterProduction( successful, pv, vecLength,
    165                                            excitationEnergyGNP, excitationEnergyDTA,       
    166                                            incidentParticle, targetParticle,
    167                                            atomicWeight, atomicNumber);
    168         if (!successful)
    169             QuasiElasticScattering( successful, pv, vecLength,
    170                                     excitationEnergyGNP, excitationEnergyDTA,
    171                                     incidentParticle, targetParticle,
    172                                     atomicWeight, atomicNumber);
    173       }
    174     if (!successful)
    175       {
    176             ElasticScattering( successful, pv, vecLength,
    177                                incidentParticle,   
    178                                atomicWeight, atomicNumber);
    179       }
    180 
    181     if (!successful)
    182       {
    183         G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles" << G4endl;
    184       }
    185       FillParticleChange(pv,  vecLength);
    186       delete [] pv;
    187       theParticleChange.SetStatusChange(stopAndKill);
    188       return & theParticleChange;
    189   }
     118  FirstIntInCasAntiSigmaPlus(inElastic, availableEnergy, pv, vecLength,
     119                             incidentParticle, targetParticle, atomicWeight);
     120
     121  if (verboseLevel > 1)
     122    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl;
     123
     124  if ((vecLength > 0) && (availableEnergy > 1.))
     125    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     126                                  pv, vecLength,
     127                                  incidentParticle, targetParticle);
     128
     129  HighEnergyCascading(successful, pv, vecLength,
     130                      excitationEnergyGNP, excitationEnergyDTA,
     131                      incidentParticle, targetParticle,
     132                      atomicWeight, atomicNumber);
     133  if (!successful)
     134    HighEnergyClusterProduction(successful, pv, vecLength,
     135                                excitationEnergyGNP, excitationEnergyDTA,
     136                                incidentParticle, targetParticle,
     137                                atomicWeight, atomicNumber);
     138  if (!successful)
     139    MediumEnergyCascading(successful, pv, vecLength,
     140                          excitationEnergyGNP, excitationEnergyDTA,
     141                          incidentParticle, targetParticle,
     142                          atomicWeight, atomicNumber);
     143
     144  if (!successful)
     145    MediumEnergyClusterProduction(successful, pv, vecLength,
     146                                  excitationEnergyGNP, excitationEnergyDTA,       
     147                                  incidentParticle, targetParticle,
     148                                  atomicWeight, atomicNumber);
     149  if (!successful)
     150    QuasiElasticScattering(successful, pv, vecLength,
     151                           excitationEnergyGNP, excitationEnergyDTA,
     152                           incidentParticle, targetParticle,
     153                           atomicWeight, atomicNumber);
     154  if (!successful)
     155    ElasticScattering(successful, pv, vecLength,
     156                      incidentParticle,   
     157                      atomicWeight, atomicNumber);
     158
     159  if (!successful)
     160    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     161           << G4endl;
     162
     163  FillParticleChange(pv,  vecLength);
     164  delete [] pv;
     165  theParticleChange.SetStatusChange(stopAndKill);
     166  return &theParticleChange;
     167}
     168
    190169
    191170void
    192 G4HEAntiSigmaPlusInelastic::FirstIntInCasAntiSigmaPlus( G4bool &inElastic,
    193                                                         const G4double availableEnergy,
    194                                                         G4HEVector pv[],
    195                                                         G4int &vecLen,
    196                                                         G4HEVector incidentParticle,
    197                                                         G4HEVector targetParticle,
    198                                                         const G4double atomicWeight)
     171G4HEAntiSigmaPlusInelastic::FirstIntInCasAntiSigmaPlus(G4bool& inElastic,
     172                                                       const G4double availableEnergy,
     173                                                       G4HEVector pv[],
     174                                                       G4int& vecLen,
     175                                                       const G4HEVector& incidentParticle,
     176                                                       const G4HEVector& targetParticle,
     177                                                       const G4double atomicWeight)
    199178
    200179// AntiSigma+ undergoes interaction with nucleon within a nucleus.  Check if it is
     
    205184// protons/neutrons by kaons or strange baryons according to the average
    206185// multiplicity per inelastic reaction.
    207 
    208  {
    209    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    210    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    211 
    212    static const G4double protb = 0.7;
    213    static const G4double neutb = 0.7;
    214    static const G4double     c = 1.25;
    215 
    216    static const G4int   numMul   = 1200;
    217    static const G4int   numMulAn = 400;
    218    static const G4int   numSec   = 60;
    219 
    220 //   G4int              neutronCode = Neutron.getCode();
    221    G4int              protonCode  = Proton.getCode();
    222 
    223    G4int               targetCode = targetParticle.getCode();
    224 //   G4double          incidentMass = incidentParticle.getMass();
    225 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    226    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    227 
    228    static G4bool first = true;
    229    static G4double protmul[numMul],  protnorm[numSec];   // proton constants
    230    static G4double protmulAn[numMulAn],protnormAn[numSec];
    231    static G4double neutmul[numMul],  neutnorm[numSec];   // neutron constants
    232    static G4double neutmulAn[numMulAn],neutnormAn[numSec];
    233 
    234                               //  misc. local variables
    235                               //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
    236 
    237    G4int i, counter, nt, np, nm, nz;
     186{
     187  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     188  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     189
     190  static const G4double protb = 0.7;
     191  static const G4double neutb = 0.7;
     192  static const G4double     c = 1.25;
     193
     194  static const G4int numMul   = 1200;
     195  static const G4int numMulAn = 400;
     196  static const G4int numSec   = 60;
     197
     198  G4int protonCode  = Proton.getCode();
     199
     200  G4int targetCode = targetParticle.getCode();
     201  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     202
     203  static G4bool first = true;
     204  static G4double protmul[numMul],  protnorm[numSec];   // proton constants
     205  static G4double protmulAn[numMulAn],protnormAn[numSec];
     206  static G4double neutmul[numMul],  neutnorm[numSec];   // neutron constants
     207  static G4double neutmulAn[numMulAn],neutnormAn[numSec];
     208
     209  //  misc. local variables
     210  //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
     211
     212  G4int i, counter, nt, np, nm, nz;
    238213
    239214   if( first )
    240      {                         // compute normalization constants, this will only be done once
     215     {         // compute normalization constants, this will only be done once
    241216       first = false;
    242217       for( i=0; i<numMul  ; i++ ) protmul[i]  = 0.0;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEAntiSigmaZeroInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HEAntiSigmaZeroInelastic.cc,v 1.10 2006/06/29 20:30:08 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HEAntiSigmaZeroInelastic.cc,v 1.11 2010/11/20 04:01:33 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     35// and the low energy two-body model.  Not included is the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest. 
    4138// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4239// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4643#include "G4Gamma.hh"
    4744
    48 G4HadFinalState *  G4HEAntiSigmaZeroInelastic::
    49 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    50   {
    51     G4HEVector * pv = new G4HEVector[MAXPART];
    52     const G4HadProjectile *aParticle = &aTrack;
    53     G4HEVector incidentParticle(aParticle);
    54     G4HEAntiLambdaInelastic theAntiLambdaInelastic;
    55     theAntiLambdaInelastic.SetMaxNumberOfSecondaries(MAXPART);
    56     theAntiLambdaInelastic.SetVerboseLevel(verboseLevel);
     45G4HadFinalState*
     46G4HEAntiSigmaZeroInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     47                                          G4Nucleus& targetNucleus)
     48{
     49  G4HEVector* pv = new G4HEVector[MAXPART];
     50  const G4HadProjectile *aParticle = &aTrack;
     51  G4HEVector incidentParticle(aParticle);
     52  G4HEAntiLambdaInelastic theAntiLambdaInelastic;
     53  theAntiLambdaInelastic.SetMaxNumberOfSecondaries(MAXPART);
     54  theAntiLambdaInelastic.SetVerboseLevel(verboseLevel);
    5755   
    58     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    59     G4double pgam = G4UniformRand()*incidentTotalMomentum*0.75;
    60     G4HEVector incidentAntiLambda;
    61     incidentAntiLambda.SmulAndUpdate( incidentParticle,
    62                                      (incidentTotalMomentum - pgam)/incidentTotalMomentum);                   
    63     G4DynamicParticle * aLambda = new G4DynamicParticle();
    64     aLambda->SetDefinition(G4AntiLambda::AntiLambda());
    65     aLambda->SetMomentum(incidentAntiLambda.getMomentum());
    66     G4HadProjectile aLambdaTrack(*aLambda);
    67     G4HadFinalState * result = theAntiLambdaInelastic.ApplyYourself(aLambdaTrack, targetNucleus);               
    68     vecLength = theAntiLambdaInelastic.GetNumberOfSecondaries();
    69     pv[vecLength] = Gamma;
    70     pv[vecLength].setMomentum(incidentParticle.getMomentum());
    71     pv[vecLength].SmulAndUpdate( pv[vecLength],pgam/incidentTotalMomentum);
    72     G4DynamicParticle * aPhoton = new G4DynamicParticle();
    73     aPhoton->SetDefinition(G4Gamma::Gamma());
    74     aPhoton->SetMomentum(pv[vecLength].getMomentum());
    75     result->AddSecondary(aPhoton);
    76       delete [] pv;
    77     return result;
    78   }
    79        
     56  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     57  G4double pgam = G4UniformRand()*incidentTotalMomentum*0.75;
     58  G4HEVector incidentAntiLambda;
     59  incidentAntiLambda.SmulAndUpdate(incidentParticle,
     60                                   (incidentTotalMomentum - pgam)/incidentTotalMomentum);                   
     61  G4DynamicParticle* aLambda = new G4DynamicParticle();
     62  aLambda->SetDefinition(G4AntiLambda::AntiLambda());
     63  aLambda->SetMomentum(incidentAntiLambda.getMomentum());
     64  G4HadProjectile aLambdaTrack(*aLambda);
     65  G4HadFinalState* result = theAntiLambdaInelastic.ApplyYourself(aLambdaTrack, targetNucleus);         
     66  vecLength = theAntiLambdaInelastic.GetNumberOfSecondaries();
     67  pv[vecLength] = Gamma;
     68  pv[vecLength].setMomentum(incidentParticle.getMomentum());
     69  pv[vecLength].SmulAndUpdate( pv[vecLength],pgam/incidentTotalMomentum);
     70  G4DynamicParticle * aPhoton = new G4DynamicParticle();
     71  aPhoton->SetDefinition(G4Gamma::Gamma());
     72  aPhoton->SetMomentum(pv[vecLength].getMomentum());
     73  result->AddSecondary(aPhoton);
     74  delete [] pv;
     75  return result;
     76}
    8077
    81 
    82 
    83 
    84 
    85 
    86 
    87 
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEAntiXiMinusInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HEAntiXiMinusInelastic.cc,v 1.15 2008/03/17 20:49:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HEAntiXiMinusInelastic.cc,v 1.17 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     35// and the low energy two-body model. Not included are the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest. 
    4138// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4239// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4542#include "G4HEAntiXiMinusInelastic.hh"
    4643
    47 G4HadFinalState *  G4HEAntiXiMinusInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double A = targetNucleus.GetN();
    54     const G4double Z = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
     44G4HadFinalState*
     45G4HEAntiXiMinusInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     46                                        G4Nucleus& targetNucleus)
     47{
     48  G4HEVector* pv = new G4HEVector[MAXPART];
     49  const G4HadProjectile* aParticle = &aTrack;
     50  const G4double A = targetNucleus.GetN();
     51  const G4double Z = targetNucleus.GetZ();
     52  G4HEVector incidentParticle(aParticle);
    5653     
    57     G4double atomicNumber = Z;
    58     G4double atomicWeight = A;
    59 
    60     G4int    incidentCode          = incidentParticle.getCode();
    61     G4double incidentMass          = incidentParticle.getMass();
    62     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    63     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    64     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    65 
    66     if(incidentKineticEnergy < 1.)
    67       {
    68         G4cout << "GHEAntiXiMinusInelastic: incident energy < 1 GeV" << G4endl;
    69       }
    70     if(verboseLevel > 1)
    71       {
    72         G4cout << "G4HEAntiXiMinusInelastic::ApplyYourself" << G4endl;
    73         G4cout << "incident particle " << incidentParticle.getName()
    74              << "mass "              << incidentMass
    75              << "kinetic energy "    << incidentKineticEnergy
    76              << G4endl;
    77         G4cout << "target material with (A,Z) = ("
    78              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    79       }
    80 
    81     G4double inelasticity  = NuclearInelasticity(incidentKineticEnergy,
    82                                                  atomicWeight, atomicNumber);
    83     if(verboseLevel > 1)
    84         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     54  G4double atomicNumber = Z;
     55  G4double atomicWeight = A;
     56
     57  G4int incidentCode = incidentParticle.getCode();
     58  G4double incidentMass = incidentParticle.getMass();
     59  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     60  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     61  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     62
     63  if (incidentKineticEnergy < 1.)
     64    G4cout << "GHEAntiXiMinusInelastic: incident energy < 1 GeV" << G4endl;
     65
     66  if (verboseLevel > 1) {
     67    G4cout << "G4HEAntiXiMinusInelastic::ApplyYourself" << G4endl;
     68    G4cout << "incident particle " << incidentParticle.getName()
     69           << "mass "              << incidentMass
     70           << "kinetic energy "    << incidentKineticEnergy
     71           << G4endl;
     72    G4cout << "target material with (A,Z) = ("
     73           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     74  }
     75
     76  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     77                                              atomicWeight, atomicNumber);
     78  if (verboseLevel > 1)
     79    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    8580   
    86     incidentKineticEnergy -= inelasticity;
     81  incidentKineticEnergy -= inelasticity;
    8782   
    88     G4double excitationEnergyGNP = 0.;
    89     G4double excitationEnergyDTA = 0.;
    90 
    91     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    92                                                atomicWeight, atomicNumber,
    93                                                excitationEnergyGNP,
    94                                                excitationEnergyDTA);
    95     if(verboseLevel > 1)
    96       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    97            << excitationEnergyDTA << G4endl;             
    98 
    99 
    100     incidentKineticEnergy -= excitation;
    101     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    102     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    103                                   *(incidentTotalEnergy+incidentMass));
    104 
    105 
    106     G4HEVector targetParticle;
    107     if(G4UniformRand() < atomicNumber/atomicWeight)
    108       {
    109         targetParticle.setDefinition("Proton");
    110       }
    111     else
    112       {
    113         targetParticle.setDefinition("Neutron");
    114       }
    115 
    116     G4double targetMass         = targetParticle.getMass();
    117     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    118                                        + 2.0*targetMass*incidentTotalEnergy);
    119     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    120 
    121                                                                 // this was the meaning of inElastic in the
    122                                                                 // original Gheisha stand-alone version.
    123 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    124 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    125                                                                 // by unknown reasons, it has been replaced
    126                                                                 // to the following code in Geant???
    127     G4bool inElastic = true;
    128 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    129 
    130     vecLength = 0;           
     83  G4double excitationEnergyGNP = 0.;
     84  G4double excitationEnergyDTA = 0.;
     85
     86  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     87                                          atomicWeight, atomicNumber,
     88                                          excitationEnergyGNP,
     89                                          excitationEnergyDTA);
     90  if (verboseLevel > 1)
     91    G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     92           << excitationEnergyDTA << G4endl;
     93
     94  incidentKineticEnergy -= excitation;
     95  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     96  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)                   
     97                                    *(incidentTotalEnergy+incidentMass));
     98
     99  G4HEVector targetParticle;
     100  if (G4UniformRand() < atomicNumber/atomicWeight) {
     101    targetParticle.setDefinition("Proton");
     102  } else {
     103    targetParticle.setDefinition("Neutron");
     104  }
     105
     106  G4double targetMass = targetParticle.getMass();
     107  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     108                                        + targetMass*targetMass
     109                                        + 2.0*targetMass*incidentTotalEnergy);
     110  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     111
     112  G4bool inElastic = true;
     113  vecLength = 0;
    131114       
    132     if(verboseLevel > 1)
    133       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     115  if (verboseLevel > 1)
     116    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    134117           << incidentCode << G4endl;
    135118
    136     G4bool successful = false;
     119  G4bool successful = false;
    137120   
    138     if(inElastic || (!inElastic && atomicWeight < 1.5))
    139       {
    140         FirstIntInCasAntiXiMinus(inElastic, availableEnergy, pv, vecLength,
    141                                  incidentParticle, targetParticle, atomicWeight);
    142 
    143         if(verboseLevel > 1)
    144            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    145 
    146 
    147         if ((vecLength > 0) && (availableEnergy > 1.))
    148                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    149                                                   pv, vecLength,
    150                                                   incidentParticle, targetParticle);
    151             HighEnergyCascading( successful, pv, vecLength,
    152                                  excitationEnergyGNP, excitationEnergyDTA,
    153                                  incidentParticle, targetParticle,
    154                                  atomicWeight, atomicNumber);
    155         if (!successful)
    156             HighEnergyClusterProduction( successful, pv, vecLength,
    157                                          excitationEnergyGNP, excitationEnergyDTA,
    158                                          incidentParticle, targetParticle,
    159                                          atomicWeight, atomicNumber);
    160         if (!successful)
    161             MediumEnergyCascading( successful, pv, vecLength,
    162                                    excitationEnergyGNP, excitationEnergyDTA,
    163                                    incidentParticle, targetParticle,
    164                                    atomicWeight, atomicNumber);
    165 
    166         if (!successful)
    167             MediumEnergyClusterProduction( successful, pv, vecLength,
    168                                            excitationEnergyGNP, excitationEnergyDTA,       
    169                                            incidentParticle, targetParticle,
    170                                            atomicWeight, atomicNumber);
    171         if (!successful)
    172             QuasiElasticScattering( successful, pv, vecLength,
    173                                     excitationEnergyGNP, excitationEnergyDTA,
    174                                     incidentParticle, targetParticle,
    175                                     atomicWeight, atomicNumber);
    176       }
    177     if (!successful)
    178       {
    179             ElasticScattering( successful, pv, vecLength,
    180                                incidentParticle,   
    181                                atomicWeight, atomicNumber);
    182       }
    183 
    184     if (!successful)
    185       {
    186         G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles";
    187       }
    188       FillParticleChange(pv,  vecLength);
    189       delete [] pv;
    190       theParticleChange.SetStatusChange(stopAndKill);
    191       return & theParticleChange;
    192   }
     121  FirstIntInCasAntiXiMinus(inElastic, availableEnergy, pv, vecLength,
     122                           incidentParticle, targetParticle, atomicWeight);
     123
     124  if (verboseLevel > 1)
     125    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl;
     126
     127  if ((vecLength > 0) && (availableEnergy > 1.))
     128    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     129                                  pv, vecLength,
     130                                  incidentParticle, targetParticle);
     131  HighEnergyCascading(successful, pv, vecLength,
     132                      excitationEnergyGNP, excitationEnergyDTA,
     133                      incidentParticle, targetParticle,
     134                      atomicWeight, atomicNumber);
     135  if (!successful)
     136    HighEnergyClusterProduction(successful, pv, vecLength,
     137                                excitationEnergyGNP, excitationEnergyDTA,
     138                                incidentParticle, targetParticle,
     139                                atomicWeight, atomicNumber);
     140  if (!successful)
     141    MediumEnergyCascading(successful, pv, vecLength,
     142                          excitationEnergyGNP, excitationEnergyDTA,
     143                          incidentParticle, targetParticle,
     144                          atomicWeight, atomicNumber);
     145
     146  if (!successful)
     147    MediumEnergyClusterProduction(successful, pv, vecLength,
     148                                  excitationEnergyGNP, excitationEnergyDTA,       
     149                                  incidentParticle, targetParticle,
     150                                  atomicWeight, atomicNumber);
     151  if (!successful)
     152    QuasiElasticScattering(successful, pv, vecLength,
     153                           excitationEnergyGNP, excitationEnergyDTA,
     154                           incidentParticle, targetParticle,
     155                           atomicWeight, atomicNumber);
     156  if (!successful)
     157    ElasticScattering(successful, pv, vecLength,
     158                      incidentParticle,   
     159                      atomicWeight, atomicNumber);
     160
     161  if (!successful)
     162    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     163           << G4endl;
     164
     165  FillParticleChange(pv, vecLength);
     166  delete [] pv;
     167  theParticleChange.SetStatusChange(stopAndKill);
     168  return &theParticleChange;
     169}
     170
    193171
    194172void
    195 G4HEAntiXiMinusInelastic::FirstIntInCasAntiXiMinus( G4bool &inElastic,
    196                                                     const G4double availableEnergy,
    197                                                     G4HEVector pv[],
    198                                                     G4int &vecLen,
    199                                                     G4HEVector incidentParticle,
    200                                                     G4HEVector targetParticle,
    201                                                     const G4double atomicWeight)
     173G4HEAntiXiMinusInelastic::FirstIntInCasAntiXiMinus(G4bool& inElastic,
     174                                                   const G4double availableEnergy,
     175                                                   G4HEVector pv[],
     176                                                   G4int& vecLen,
     177                                                   const G4HEVector& incidentParticle,
     178                                                   const G4HEVector& targetParticle,
     179                                                   const G4double atomicWeight)
    202180
    203181// AntiXi- undergoes interaction with nucleon within a nucleus. 
    204182// As in Geant3, we think that this routine has absolutely no influence
    205183// on the whole performance of the program. Take AntiLambda instaed.
    206 
    207  {
    208    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    209    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    210 
    211    static const G4double protb = 0.7;
    212    static const G4double neutb = 0.7;
    213    static const G4double     c = 1.25;
    214 
    215    static const G4int   numMul   = 1200;
    216    static const G4int   numMulAn = 400;
    217    static const G4int   numSec   = 60;
    218 
    219 //   G4int              neutronCode = Neutron.getCode();
    220    G4int              protonCode  = Proton.getCode();
    221 
    222    G4int               targetCode = targetParticle.getCode();
    223 //   G4double          incidentMass = incidentParticle.getMass();
    224 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    225    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    226 
    227    static G4bool first = true;
    228    static G4double protmul[numMul],  protnorm[numSec];   // proton constants
    229    static G4double protmulAn[numMulAn],protnormAn[numSec];
    230    static G4double neutmul[numMul],  neutnorm[numSec];   // neutron constants
    231    static G4double neutmulAn[numMulAn],neutnormAn[numSec];
    232 
    233                               //  misc. local variables
    234                               //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
    235 
    236    G4int i, counter, nt, np, nm, nz;
     184{
     185  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     186  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     187
     188  static const G4double protb = 0.7;
     189  static const G4double neutb = 0.7;
     190  static const G4double     c = 1.25;
     191
     192  static const G4int numMul   = 1200;
     193  static const G4int numMulAn = 400;
     194  static const G4int numSec   = 60;
     195
     196  G4int protonCode = Proton.getCode();
     197
     198  G4int targetCode = targetParticle.getCode();
     199  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     200
     201  static G4bool first = true;
     202  static G4double protmul[numMul],  protnorm[numSec];   // proton constants
     203  static G4double protmulAn[numMulAn],protnormAn[numSec];
     204  static G4double neutmul[numMul],  neutnorm[numSec];   // neutron constants
     205  static G4double neutmulAn[numMulAn],neutnormAn[numSec];
     206
     207  //  misc. local variables
     208  //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
     209
     210  G4int i, counter, nt, np, nm, nz;
    237211
    238212   if( first )
    239      {                         // compute normalization constants, this will only be done once
     213     {           // compute normalization constants, this will only be done once
    240214       first = false;
    241215       for( i=0; i<numMul  ; i++ ) protmul[i]  = 0.0;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEAntiXiZeroInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HEAntiXiZeroInelastic.cc,v 1.15 2008/03/17 20:49:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HEAntiXiZeroInelastic.cc,v 1.17 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     35// and the low energy two-body model. Not included are the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest. 
    4138// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4239// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4542#include "G4HEAntiXiZeroInelastic.hh"
    4643
    47 G4HadFinalState *  G4HEAntiXiZeroInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double A = targetNucleus.GetN();
    54     const G4double Z = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
     44G4HadFinalState*
     45G4HEAntiXiZeroInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     46                                       G4Nucleus& targetNucleus)
     47{
     48  G4HEVector* pv = new G4HEVector[MAXPART];
     49  const G4HadProjectile* aParticle = &aTrack;
     50  const G4double A = targetNucleus.GetN();
     51  const G4double Z = targetNucleus.GetZ();
     52  G4HEVector incidentParticle(aParticle);
    5653     
    57     G4double atomicNumber = Z;
    58     G4double atomicWeight = A;
    59 
    60     G4int    incidentCode          = incidentParticle.getCode();
    61     G4double incidentMass          = incidentParticle.getMass();
    62     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    63     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    64     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    65 
    66     if(incidentKineticEnergy < 1.)
    67       {
    68         G4cout << "GHEAntiXiZeroInelastic: incident energy < 1 GeV" << G4endl;
    69       }
    70     if(verboseLevel > 1)
    71       {
    72         G4cout << "G4HEAntiXiZeroInelastic::ApplyYourself" << G4endl;
    73         G4cout << "incident particle " << incidentParticle.getName()
    74              << "mass "              << incidentMass
    75              << "kinetic energy "    << incidentKineticEnergy
    76              << G4endl;
    77         G4cout << "target material with (A,Z) = ("
    78              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    79       }
     54  G4double atomicNumber = Z;
     55  G4double atomicWeight = A;
     56
     57  G4int incidentCode = incidentParticle.getCode();
     58  G4double incidentMass = incidentParticle.getMass();
     59  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     60  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     61  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     62
     63  if (incidentKineticEnergy < 1.)
     64    G4cout << "GHEAntiXiZeroInelastic: incident energy < 1 GeV" << G4endl;
     65
     66  if (verboseLevel > 1) {
     67    G4cout << "G4HEAntiXiZeroInelastic::ApplyYourself" << G4endl;
     68    G4cout << "incident particle " << incidentParticle.getName()
     69           << "mass "              << incidentMass
     70           << "kinetic energy "    << incidentKineticEnergy
     71           << G4endl;
     72    G4cout << "target material with (A,Z) = ("
     73           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     74  }
    8075   
    81     G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
    82                                                  atomicWeight, atomicNumber);
    83     if(verboseLevel > 1)
    84         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     76  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     77                                              atomicWeight, atomicNumber);
     78  if (verboseLevel > 1)
     79    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    8580   
    86     incidentKineticEnergy -= inelasticity;
     81  incidentKineticEnergy -= inelasticity;
    8782   
    88     G4double excitationEnergyGNP = 0.;
    89     G4double excitationEnergyDTA = 0.;
    90 
    91     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    92                                                atomicWeight, atomicNumber,
    93                                                excitationEnergyGNP,
    94                                                excitationEnergyDTA);
    95     if(verboseLevel > 1)
    96       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     83  G4double excitationEnergyGNP = 0.;
     84  G4double excitationEnergyDTA = 0.;
     85
     86  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     87                                          atomicWeight, atomicNumber,
     88                                          excitationEnergyGNP,
     89                                          excitationEnergyDTA);
     90  if (verboseLevel > 1)
     91    G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    9792           << excitationEnergyDTA << G4endl;             
    9893
    99 
    100     incidentKineticEnergy -= excitation;
    101     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    102     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    103                                   *(incidentTotalEnergy+incidentMass));
    104 
    105 
    106     G4HEVector targetParticle;
    107     if(G4UniformRand() < atomicNumber/atomicWeight)
    108       {
    109         targetParticle.setDefinition("Proton");
    110       }
    111     else
    112       {
    113         targetParticle.setDefinition("Neutron");
    114       }
    115 
    116     G4double targetMass         = targetParticle.getMass();
    117     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    118                                        + 2.0*targetMass*incidentTotalEnergy);
    119     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    120 
    121                                                                 // this was the meaning of inElastic in the
    122                                                                 // original Gheisha stand-alone version.
    123 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    124 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    125                                                                 // by unknown reasons, it has been replaced
    126                                                                 // to the following code in Geant???
    127     G4bool inElastic = true;
    128 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    129 
    130     vecLength = 0;           
     94  incidentKineticEnergy -= excitation;
     95  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     96  incidentTotalMomentum = std::sqrt((incidentTotalEnergy-incidentMass)                   
     97                                   *(incidentTotalEnergy+incidentMass));
     98
     99  G4HEVector targetParticle;
     100  if (G4UniformRand() < atomicNumber/atomicWeight) {
     101    targetParticle.setDefinition("Proton");
     102  } else {
     103    targetParticle.setDefinition("Neutron");
     104  }
     105
     106  G4double targetMass = targetParticle.getMass();
     107  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     108                                        + targetMass*targetMass
     109                                        + 2.0*targetMass*incidentTotalEnergy);
     110  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     111
     112  G4bool inElastic = true;
     113  vecLength = 0;           
    131114       
    132     if(verboseLevel > 1)
    133       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     115  if (verboseLevel > 1)
     116    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    134117           << incidentCode << G4endl;
    135118
    136     G4bool successful = false;
     119  G4bool successful = false;
    137120   
    138     if(inElastic || (!inElastic && atomicWeight < 1.5))
    139       {
    140         FirstIntInCasAntiXiZero(inElastic, availableEnergy, pv, vecLength,
    141                                 incidentParticle, targetParticle, atomicWeight);
    142 
    143         if(verboseLevel > 1)
    144            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    145 
    146 
    147         if ((vecLength > 0) && (availableEnergy > 1.))
    148                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    149                                                   pv, vecLength,
    150                                                   incidentParticle, targetParticle);
    151 
    152             HighEnergyCascading( successful, pv, vecLength,
    153                                  excitationEnergyGNP, excitationEnergyDTA,
    154                                  incidentParticle, targetParticle,
    155                                  atomicWeight, atomicNumber);
    156         if (!successful)
    157             HighEnergyClusterProduction( successful, pv, vecLength,
    158                                          excitationEnergyGNP, excitationEnergyDTA,
    159                                          incidentParticle, targetParticle,
    160                                          atomicWeight, atomicNumber);
    161         if (!successful)
    162             MediumEnergyCascading( successful, pv, vecLength,
    163                                    excitationEnergyGNP, excitationEnergyDTA,
    164                                    incidentParticle, targetParticle,
    165                                    atomicWeight, atomicNumber);
    166 
    167         if (!successful)
    168             MediumEnergyClusterProduction( successful, pv, vecLength,
    169                                            excitationEnergyGNP, excitationEnergyDTA,       
    170                                            incidentParticle, targetParticle,
    171                                            atomicWeight, atomicNumber);
    172         if (!successful)
    173             QuasiElasticScattering( successful, pv, vecLength,
    174                                     excitationEnergyGNP, excitationEnergyDTA,
    175                                     incidentParticle, targetParticle,
    176                                     atomicWeight, atomicNumber);
    177       }
    178     if (!successful)
    179       {
    180             ElasticScattering( successful, pv, vecLength,
    181                                incidentParticle,   
    182                                atomicWeight, atomicNumber);
    183       }
    184 
    185     if (!successful)
    186       {
    187         G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles" << G4endl;
    188       }
    189       FillParticleChange(pv,  vecLength);
    190       delete [] pv;
    191       theParticleChange.SetStatusChange(stopAndKill);
    192       return & theParticleChange;
    193   }
     121  FirstIntInCasAntiXiZero(inElastic, availableEnergy, pv, vecLength,
     122                          incidentParticle, targetParticle, atomicWeight);
     123
     124  if (verboseLevel > 1)
     125    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl;
     126
     127  if ((vecLength > 0) && (availableEnergy > 1.))
     128    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     129                                  pv, vecLength,
     130                                  incidentParticle, targetParticle);
     131
     132  HighEnergyCascading(successful, pv, vecLength,
     133                      excitationEnergyGNP, excitationEnergyDTA,
     134                      incidentParticle, targetParticle,
     135                      atomicWeight, atomicNumber);
     136  if (!successful)
     137    HighEnergyClusterProduction(successful, pv, vecLength,
     138                                excitationEnergyGNP, excitationEnergyDTA,
     139                                incidentParticle, targetParticle,
     140                                atomicWeight, atomicNumber);
     141  if (!successful)
     142    MediumEnergyCascading(successful, pv, vecLength,
     143                          excitationEnergyGNP, excitationEnergyDTA,
     144                          incidentParticle, targetParticle,
     145                          atomicWeight, atomicNumber);
     146
     147  if (!successful)
     148    MediumEnergyClusterProduction(successful, pv, vecLength,
     149                                  excitationEnergyGNP, excitationEnergyDTA,       
     150                                  incidentParticle, targetParticle,
     151                                  atomicWeight, atomicNumber);
     152  if (!successful)
     153    QuasiElasticScattering(successful, pv, vecLength,
     154                           excitationEnergyGNP, excitationEnergyDTA,
     155                           incidentParticle, targetParticle,
     156                           atomicWeight, atomicNumber);
     157  if (!successful)
     158    ElasticScattering(successful, pv, vecLength,
     159                      incidentParticle,   
     160                      atomicWeight, atomicNumber);
     161  if (!successful)
     162    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     163           << G4endl;
     164
     165  FillParticleChange(pv, vecLength);
     166  delete [] pv;
     167  theParticleChange.SetStatusChange(stopAndKill);
     168  return &theParticleChange;
     169}
     170
    194171
    195172void
    196 G4HEAntiXiZeroInelastic::FirstIntInCasAntiXiZero( G4bool &inElastic,
    197                                                   const G4double availableEnergy,
    198                                                   G4HEVector pv[],
    199                                                   G4int &vecLen,
    200                                                   G4HEVector incidentParticle,
    201                                                   G4HEVector targetParticle,
    202                                                   const G4double atomicWeight)
     173G4HEAntiXiZeroInelastic::FirstIntInCasAntiXiZero(G4bool& inElastic,
     174                                                 const G4double availableEnergy,
     175                                                 G4HEVector pv[],
     176                                                 G4int& vecLen,
     177                                                 const G4HEVector& incidentParticle,
     178                                                 const G4HEVector& targetParticle,
     179                                                 const G4double atomicWeight)
    203180
    204181// AntiXi0 undergoes interaction with nucleon within a nucleus. 
     
    206183// on the whole performance of the program. Take AntiLambda instaed.
    207184// ( decay Xi0 -> L Pi > 99 % )
    208  {
    209    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    210    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    211 
    212    static const G4double protb = 0.7;
    213    static const G4double neutb = 0.7;
    214    static const G4double     c = 1.25;
    215 
    216    static const G4int   numMul   = 1200;
    217    static const G4int   numMulAn = 400;
    218    static const G4int   numSec   = 60;
    219 
    220 //   G4int              neutronCode = Neutron.getCode();
    221    G4int              protonCode  = Proton.getCode();
    222 
    223    G4int               targetCode = targetParticle.getCode();
    224 //   G4double          incidentMass = incidentParticle.getMass();
    225 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    226    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    227 
    228    static G4bool first = true;
    229    static G4double protmul[numMul],  protnorm[numSec];   // proton constants
    230    static G4double protmulAn[numMulAn],protnormAn[numSec];
    231    static G4double neutmul[numMul],  neutnorm[numSec];   // neutron constants
    232    static G4double neutmulAn[numMulAn],neutnormAn[numSec];
    233 
    234                               //  misc. local variables
    235                               //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
    236 
    237    G4int i, counter, nt, np, nm, nz;
     185{
     186  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     187  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     188
     189  static const G4double protb = 0.7;
     190  static const G4double neutb = 0.7;
     191  static const G4double     c = 1.25;
     192
     193  static const G4int numMul   = 1200;
     194  static const G4int numMulAn = 400;
     195  static const G4int numSec   = 60;
     196
     197  G4int protonCode  = Proton.getCode();
     198
     199  G4int targetCode = targetParticle.getCode();
     200  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     201
     202  static G4bool first = true;
     203  static G4double protmul[numMul],  protnorm[numSec];   // proton constants
     204  static G4double protmulAn[numMulAn],protnormAn[numSec];
     205  static G4double neutmul[numMul],  neutnorm[numSec];   // neutron constants
     206  static G4double neutmulAn[numMulAn],neutnormAn[numSec];
     207
     208  //  misc. local variables
     209  //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
     210
     211  G4int i, counter, nt, np, nm, nz;
    238212
    239213   if( first )
    240      {                         // compute normalization constants, this will only be done once
     214     {           // compute normalization constants, this will only be done once
    241215       first = false;
    242216       for( i=0; i<numMul  ; i++ ) protmul[i]  = 0.0;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEInelastic.cc

    r962 r1347  
    2525//
    2626//
    27 //
    2827
    2928#include "globals.hh"
     
    5554#include "G4Alpha.hh"
    5655
    57 void  G4HEInelastic::FillParticleChange(G4HEVector pv[], G4int aVecLength)
     56void G4HEInelastic::FillParticleChange(G4HEVector pv[], G4int aVecLength)
    5857{
    5958  theParticleChange.Clear();
     
    7776    aParticle->SetMomentum(pv[i].getMomentum()*GeV);
    7877    theParticleChange.AddSecondary(aParticle);
    79     G4ParticleDefinition * dummy = G4KaonZero::KaonZero();
    80     dummy = G4AntiKaonZero::AntiKaonZero();
    8178  }
    8279}
    8380
    84 void
    85 G4HEInelastic::SetParticles()
    86   {
    87     PionPlus.setDefinition("PionPlus");
    88     PionZero.setDefinition("PionZero");
    89     PionMinus.setDefinition("PionMinus");
    90     KaonPlus.setDefinition("KaonPlus");
    91     KaonZero.setDefinition("KaonZero");
    92     AntiKaonZero.setDefinition("AntiKaonZero");
    93     KaonMinus.setDefinition("KaonMinus");
    94     KaonZeroShort.setDefinition("KaonZeroShort");
    95     KaonZeroLong.setDefinition("KaonZeroLong");
    96     Proton.setDefinition("Proton");
    97     AntiProton.setDefinition("AntiProton");
    98     Neutron.setDefinition("Neutron");
    99     AntiNeutron.setDefinition("AntiNeutron");
    100     Lambda.setDefinition("Lambda");
    101     AntiLambda.setDefinition("AntiLambda");
    102     SigmaPlus.setDefinition("SigmaPlus");
    103     SigmaZero.setDefinition("SigmaZero");
    104     SigmaMinus.setDefinition("SigmaMinus");
    105     AntiSigmaPlus.setDefinition("AntiSigmaPlus");
    106     AntiSigmaZero.setDefinition("AntiSigmaZero");
    107     AntiSigmaMinus.setDefinition("AntiSigmaMinus");
    108     XiZero.setDefinition("XiZero");
    109     XiMinus.setDefinition("XiMinus");
    110     AntiXiZero.setDefinition("AntiXiZero");
    111     AntiXiMinus.setDefinition("AntiXiMinus");
    112     OmegaMinus.setDefinition("OmegaMinus");
    113     AntiOmegaMinus.setDefinition("AntiOmegaMinus");
    114     Deuteron.setDefinition("Deuteron");
    115     Triton.setDefinition("Triton");
    116     Alpha.setDefinition("Alpha");
    117     Gamma.setDefinition("Gamma");
    118     return;
    119   }
     81void G4HEInelastic::SetParticles()
     82{
     83  PionPlus.setDefinition("PionPlus");
     84  PionZero.setDefinition("PionZero");
     85  PionMinus.setDefinition("PionMinus");
     86  KaonPlus.setDefinition("KaonPlus");
     87  KaonZero.setDefinition("KaonZero");
     88  AntiKaonZero.setDefinition("AntiKaonZero");
     89  KaonMinus.setDefinition("KaonMinus");
     90  KaonZeroShort.setDefinition("KaonZeroShort");
     91  KaonZeroLong.setDefinition("KaonZeroLong");
     92  Proton.setDefinition("Proton");
     93  AntiProton.setDefinition("AntiProton");
     94  Neutron.setDefinition("Neutron");
     95  AntiNeutron.setDefinition("AntiNeutron");
     96  Lambda.setDefinition("Lambda");
     97  AntiLambda.setDefinition("AntiLambda");
     98  SigmaPlus.setDefinition("SigmaPlus");
     99  SigmaZero.setDefinition("SigmaZero");
     100  SigmaMinus.setDefinition("SigmaMinus");
     101  AntiSigmaPlus.setDefinition("AntiSigmaPlus");
     102  AntiSigmaZero.setDefinition("AntiSigmaZero");
     103  AntiSigmaMinus.setDefinition("AntiSigmaMinus");
     104  XiZero.setDefinition("XiZero");
     105  XiMinus.setDefinition("XiMinus");
     106  AntiXiZero.setDefinition("AntiXiZero");
     107  AntiXiMinus.setDefinition("AntiXiMinus");
     108  OmegaMinus.setDefinition("OmegaMinus");
     109  AntiOmegaMinus.setDefinition("AntiOmegaMinus");
     110  Deuteron.setDefinition("Deuteron");
     111  Triton.setDefinition("Triton");
     112  Alpha.setDefinition("Alpha");
     113  Gamma.setDefinition("Gamma");
     114  return;
     115}
    120116 
    121 G4double
    122 G4HEInelastic::Amin(G4double a, G4double b)
    123   {
    124     G4double c = a;
    125     if(b < a) c = b;
    126     return c;
    127   }
    128 G4double
    129 G4HEInelastic::Amax(G4double a, G4double b)
    130   {
    131     G4double c = a;
    132     if(b > a) c = b;
    133     return c;
    134   }
     117G4double G4HEInelastic::Amin(G4double a, G4double b)
     118{
     119  G4double c = a;
     120  if(b < a) c = b;
     121  return c;
     122}
     123
     124G4double G4HEInelastic::Amax(G4double a, G4double b)
     125{
     126  G4double c = a;
     127  if(b > a) c = b;
     128  return c;
     129}
     130 
    135131G4int
    136132G4HEInelastic::Imin(G4int a, G4int b)
     
    338334                       G4HEVector pv[],
    339335                       G4int &vecLen,
    340                        G4HEVector incidentParticle,
    341                        G4HEVector targetParticle )
     336                       const G4HEVector& incidentParticle,
     337                       const G4HEVector& targetParticle)
    342338
    343339   // Choose charge combinations K+ K-, K+ K0, K0 K0, K0 K-,
     
    602598
    603599void
    604 G4HEInelastic::HighEnergyCascading(G4bool &successful,
     600G4HEInelastic::HighEnergyCascading(G4bool& successful,
    605601                                   G4HEVector pv[],
    606                                    G4int &vecLen,       
    607                                    G4double &excitationEnergyGNP,
    608                                    G4double &excitationEnergyDTA,
    609                                    G4HEVector incidentParticle,
    610                                    G4HEVector targetParticle,
     602                                   G4int& vecLen,       
     603                                   G4double& excitationEnergyGNP,
     604                                   G4double& excitationEnergyDTA,
     605                                   const G4HEVector& incidentParticle,
     606                                   const G4HEVector& targetParticle,
    611607                                   G4double atomicWeight,
    612608                                   G4double atomicNumber)
    613  {   
    614 //
    615 //  The multiplicity of particles produced in the first interaction has been
    616 //  calculated in one of the FirstIntInNuc.... routines. The nuclear
    617 //  cascading particles are parameterized from experimental data.
    618 //  A simple single variable description E D3S/DP3= F(Q) with
    619 //  Q^2 = (M*X)^2 + PT^2 is used. Final state kinematics are produced
    620 //  by an FF-type iterative cascade method.
    621 //  Nuclear evaporation particles are added at the end of the routine.
    622 
    623 //  All quantities in the G4HEVector Array pv are in GeV- units.
    624 //  The method is a copy of MediumEnergyCascading with some special tuning
    625 //  for high energy interactions.
    626 
    627 
    628    G4int protonCode       = Proton.getCode();
    629    G4double protonMass    = Proton.getMass();
    630    G4int neutronCode      = Neutron.getCode();
    631    G4double neutronMass   = Neutron.getMass();
    632    G4double kaonPlusMass  = KaonPlus.getMass();
    633    G4int kaonPlusCode     = KaonPlus.getCode();   
    634    G4int kaonMinusCode    = KaonMinus.getCode();
    635    G4int kaonZeroSCode    = KaonZeroShort.getCode();
    636    G4int kaonZeroLCode    = KaonZeroLong.getCode();
    637    G4int kaonZeroCode     = KaonZero.getCode();
    638    G4int antiKaonZeroCode = AntiKaonZero.getCode();
    639    G4int pionPlusCode     = PionPlus.getCode();   
    640    G4int pionZeroCode     = PionZero.getCode();   
    641    G4int pionMinusCode    = PionMinus.getCode();
    642    G4String mesonType     = PionPlus.getType();
    643    G4String baryonType    = Proton.getType();
    644    G4String antiBaryonType= AntiProton.getType();
    645 
    646    G4double targetMass   = targetParticle.getMass();
    647 
    648    G4int    incidentCode          = incidentParticle.getCode();
    649    G4double incidentMass          = incidentParticle.getMass();
    650    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    651    G4double incidentEnergy        = incidentParticle.getEnergy();
    652    G4double incidentKineticEnergy = incidentParticle.getKineticEnergy();
    653    G4String incidentType          = incidentParticle.getType();
     609{   
     610  //  The multiplicity of particles produced in the first interaction has been
     611  //  calculated in one of the FirstIntInNuc.... routines. The nuclear
     612  //  cascading particles are parameterized from experimental data.
     613  //  A simple single variable description E D3S/DP3= F(Q) with
     614  //  Q^2 = (M*X)^2 + PT^2 is used. Final state kinematics are produced
     615  //  by an FF-type iterative cascade method.
     616  //  Nuclear evaporation particles are added at the end of the routine.
     617
     618  //  All quantities in the G4HEVector Array pv are in GeV- units.
     619  //  The method is a copy of MediumEnergyCascading with some special tuning
     620  //  for high energy interactions.
     621
     622  G4int protonCode = Proton.getCode();
     623  G4double protonMass = Proton.getMass();
     624  G4int neutronCode = Neutron.getCode();
     625  G4double neutronMass = Neutron.getMass();
     626  G4double kaonPlusMass = KaonPlus.getMass();
     627  G4int kaonPlusCode = KaonPlus.getCode();   
     628  G4int kaonMinusCode = KaonMinus.getCode();
     629  G4int kaonZeroSCode = KaonZeroShort.getCode();
     630  G4int kaonZeroLCode = KaonZeroLong.getCode();
     631  G4int kaonZeroCode = KaonZero.getCode();
     632  G4int antiKaonZeroCode = AntiKaonZero.getCode();
     633  G4int pionPlusCode = PionPlus.getCode();   
     634  G4int pionZeroCode = PionZero.getCode();   
     635  G4int pionMinusCode = PionMinus.getCode();
     636  G4String mesonType = PionPlus.getType();
     637  G4String baryonType = Proton.getType();
     638  G4String antiBaryonType = AntiProton.getType();
     639
     640  G4double targetMass = targetParticle.getMass();
     641
     642  G4int incidentCode = incidentParticle.getCode();
     643  G4double incidentMass = incidentParticle.getMass();
     644  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     645  G4double incidentEnergy = incidentParticle.getEnergy();
     646  G4double incidentKineticEnergy = incidentParticle.getKineticEnergy();
     647  G4String incidentType = incidentParticle.getType();
    654648//   G4double incidentTOF           = incidentParticle.getTOF();   
    655    G4double incidentTOF          = 0.;
    656    
    657      // some local variables
    658 
    659    G4int i, j, l;
    660 
    661    if (verboseLevel > 1)
    662             G4cout << " G4HEInelastic::HighEnergyCascading " << G4endl;
    663    successful = false;
    664    if(incidentTotalMomentum < 25. + G4UniformRand()*25.) return;
     649  G4double incidentTOF = 0.;
     650   
     651  // some local variables
     652
     653  G4int i, j, l;
     654
     655  if (verboseLevel > 1) G4cout << " G4HEInelastic::HighEnergyCascading "
     656                              << G4endl;
     657  successful = false;
     658  if (incidentTotalMomentum < 25. + G4UniformRand()*25.) return;
    665659 
    666      // define annihilation channels.
     660  // define annihilation channels.
    667661                                 
    668    G4bool annihilation = false;
    669    if (incidentCode < 0 && incidentType == antiBaryonType &&
    670        pv[0].getType() != antiBaryonType &&
    671        pv[1].getType() != antiBaryonType   )
    672          {
    673            annihilation = true;
    674          }   
    675      
    676 
    677 
    678    G4double twsup[] = { 1., 1., 0.7, 0.5, 0.3, 0.2, 0.1, 0.0 };
    679 
    680    if( annihilation ) goto start;
    681    if( vecLen >= 8)   goto start;
    682    if( incidentKineticEnergy < 1.) return;
    683    if(   (   incidentCode == kaonPlusCode  || incidentCode == kaonMinusCode
    684           || incidentCode == kaonZeroCode  || incidentCode == antiKaonZeroCode
    685           || incidentCode == kaonZeroSCode || incidentCode == kaonZeroLCode )
    686       && (   G4UniformRand() < 0.5) ) goto start;
    687    if( G4UniformRand() > twsup[vecLen-1]) goto start;
    688    if( incidentKineticEnergy > (G4UniformRand()*200 + 50.) ) goto start;
    689    return;
    690    
    691    start:
    692 
    693    if (annihilation)
    694       {                  // do some corrections of incident particle kinematic
    695         G4double ekcor = Amax( 1., 1./incidentKineticEnergy);
    696         incidentKineticEnergy = 2*targetMass + incidentKineticEnergy*(1.+ekcor/atomicWeight);
    697         G4double excitation = NuclearExcitation(incidentKineticEnergy,
    698                                                 atomicWeight,
    699                                                 atomicNumber,
    700                                                 excitationEnergyGNP,
    701                                                 excitationEnergyDTA);
    702         incidentKineticEnergy -= excitation;
    703         if (incidentKineticEnergy < excitationEnergyDTA) incidentKineticEnergy = 0.;
    704         incidentEnergy = incidentKineticEnergy + incidentMass;
    705         incidentTotalMomentum =
    706                  std::sqrt( Amax(0., incidentEnergy*incidentEnergy - incidentMass*incidentMass));
    707       } 
     662  G4bool annihilation = false;
     663  if (incidentCode < 0 && incidentType == antiBaryonType &&
     664      pv[0].getType() != antiBaryonType &&
     665      pv[1].getType() != antiBaryonType) {
     666    annihilation = true;
     667  }   
     668
     669  G4double twsup[] = { 1., 1., 0.7, 0.5, 0.3, 0.2, 0.1, 0.0 };
     670
     671  if (annihilation) goto start;
     672  if (vecLen >= 8)   goto start;
     673  if( incidentKineticEnergy < 1.) return;
     674  if(   (   incidentCode == kaonPlusCode  || incidentCode == kaonMinusCode
     675         || incidentCode == kaonZeroCode  || incidentCode == antiKaonZeroCode
     676         || incidentCode == kaonZeroSCode || incidentCode == kaonZeroLCode )
     677     && (   G4UniformRand() < 0.5) ) goto start;
     678  if( G4UniformRand() > twsup[vecLen-1]) goto start;
     679  if( incidentKineticEnergy > (G4UniformRand()*200 + 50.) ) goto start;
     680  return;
     681   
     682  start:
     683
     684  if (annihilation) {
     685    // do some corrections of incident particle kinematic
     686    G4double ekcor = Amax( 1., 1./incidentKineticEnergy);
     687    incidentKineticEnergy = 2*targetMass + incidentKineticEnergy*(1.+ekcor/atomicWeight);
     688    G4double excitation = NuclearExcitation(incidentKineticEnergy,
     689                                            atomicWeight,
     690                                            atomicNumber,
     691                                            excitationEnergyGNP,
     692                                            excitationEnergyDTA);
     693    incidentKineticEnergy -= excitation;
     694    if (incidentKineticEnergy < excitationEnergyDTA) incidentKineticEnergy = 0.;
     695    incidentEnergy = incidentKineticEnergy + incidentMass;
     696    incidentTotalMomentum =
     697         std::sqrt( Amax(0., incidentEnergy*incidentEnergy - incidentMass*incidentMass));
     698  }
    708699   
    709    G4HEVector pTemp;
    710    for (i = 2; i<vecLen; i++)
    711      {
    712        j = Imin( vecLen-1, (G4int)(2. + G4UniformRand()*(vecLen - 2)));
    713        pTemp = pv[j];
    714        pv[j] = pv[i];
    715        pv[i] = pTemp;
    716      }                         
    717          // randomize the first two leading particles
    718          // for kaon induced reactions only
    719          // (need from experimental data)
     700  G4HEVector pTemp;
     701  for (i = 2; i < vecLen; i++) {
     702    j = Imin( vecLen-1, (G4int)(2. + G4UniformRand()*(vecLen - 2)));
     703    pTemp = pv[j];
     704    pv[j] = pv[i];
     705    pv[i] = pTemp;
     706  }
     707  // randomize the first two leading particles
     708  // for kaon induced reactions only
     709  // (need from experimental data)
    720710
    721711   if(   (incidentCode==kaonPlusCode  || incidentCode==kaonMinusCode    ||
     
    760750         }
    761751
    762      // Distribute particles in forward and backward hemispheres in center
    763      // of mass system.  Incident particle goes in forward hemisphere.
    764    
    765    G4HEVector pvI = incidentParticle;  // for the incident particle
    766    pvI.setSide( 1 );
    767 
    768    G4HEVector pvT = targetParticle;   // for the target particle
    769    pvT.setMomentumAndUpdate( 0.0, 0.0, 0.0 );
    770    pvT.setSide( -1 );
    771    pvT.setTOF( -1.);
    772 
    773 
    774    G4double centerOfMassEnergy = std::sqrt( sqr(incidentMass)+sqr(targetMass)
     752  // Distribute particles in forward and backward hemispheres in center
     753  // of mass system.  Incident particle goes in forward hemisphere.
     754   
     755  G4HEVector pvI = incidentParticle;  // for the incident particle
     756  pvI.setSide( 1 );
     757
     758  G4HEVector pvT = targetParticle;   // for the target particle
     759  pvT.setMomentumAndUpdate( 0.0, 0.0, 0.0 );
     760  pvT.setSide( -1 );
     761  pvT.setTOF( -1.);
     762
     763  G4double centerOfMassEnergy = std::sqrt( sqr(incidentMass)+sqr(targetMass)
    775764                                      +2.0*targetMass*incidentEnergy );
    776 //   G4double availableEnergy    = centerOfMassEnergy - ( targetMass + incidentMass );
    777 
    778    G4double tavai1      = centerOfMassEnergy/2.0 - incidentMass;
    779    G4double tavai2      = centerOfMassEnergy/2.0 - targetMass;           
    780    
    781     // define G4HEVector- array for kinematic manipulations,
    782     // with a one by one correspondence to the pv-Array.
    783    
    784    G4int ntb = 1;
    785    for( i=0; i < vecLen; i++ )
    786       {
    787         if      (i == 0) pv[i].setSide(  1 );
    788         else if (i == 1) pv[i].setSide( -1 );
    789         else 
    790            { if( G4UniformRand() < 0.5 )
    791                {
    792                  pv[i].setSide( -1 );
    793                  ntb++;
    794                 }
    795              else
    796                  pv[i].setSide( 1 );
    797            }
    798         pv[i].setTOF(    incidentTOF);
    799       }
    800    G4double tb = 2. * ntb;
    801    if (centerOfMassEnergy < (2. + G4UniformRand()))
    802        tb = (2. * ntb + vecLen)/2.;     
    803 
    804    if (verboseLevel > 1)
    805       { G4cout << " pv Vector after Randomization " << vecLen << G4endl;
    806         pvI.Print(-1);
    807         pvT.Print(-1);
    808         for (i=0; i < vecLen ; i++) pv[i].Print(i);
    809       }
    810 
    811     // Add particles from intranuclear cascade
    812     // nuclearCascadeCount = number of new secondaries produced by nuclear
    813     // cascading.
    814     // extraCount = number of nucleons within these new secondaries
     765//  G4double availableEnergy    = centerOfMassEnergy - ( targetMass + incidentMass );
     766
     767  G4double tavai1 = centerOfMassEnergy/2.0 - incidentMass;
     768  G4double tavai2 = centerOfMassEnergy/2.0 - targetMass;           
     769   
     770  // define G4HEVector- array for kinematic manipulations,
     771  // with a one by one correspondence to the pv-Array.
     772   
     773  G4int ntb = 1;
     774  for (i = 0; i < vecLen; i++) {
     775    if (i == 0) pv[i].setSide(1);
     776    else if (i == 1) pv[i].setSide(-1);
     777    else {
     778      if (G4UniformRand() < 0.5) {
     779        pv[i].setSide(-1);
     780        ntb++;
     781      } else {
     782        pv[i].setSide(1);
     783      }
     784    }
     785    pv[i].setTOF(incidentTOF);
     786  }
     787
     788  G4double tb = 2. * ntb;
     789  if (centerOfMassEnergy < (2. + G4UniformRand()))
     790    tb = (2. * ntb + vecLen)/2.;     
     791
     792  if (verboseLevel > 1) {
     793    G4cout << " pv Vector after Randomization " << vecLen << G4endl;
     794    pvI.Print(-1);
     795    pvT.Print(-1);
     796    for (i = 0; i < vecLen; i++) pv[i].Print(i);
     797  }
     798
     799  // Add particles from intranuclear cascade
     800  // nuclearCascadeCount = number of new secondaries produced by nuclear
     801  // cascading.
     802  // extraCount = number of nucleons within these new secondaries
    815803
    816804   G4double s, xtarg, ran;
     
    928916     }
    929917                                         
    930      //  assume conservation of kinetic energy
    931      //  in forward & backward hemispheres
    932 
    933    G4int is, iskip, iavai1;
    934    if(vecLen <= 1) return;
    935 
    936    tavai1 = centerOfMassEnergy/2.;
    937    iavai1 = 0;
     918  //  assume conservation of kinetic energy
     919  //  in forward & backward hemispheres
     920
     921  G4int is, iskip, iavai1;
     922  if (vecLen <= 1) return;
     923
     924  tavai1 = centerOfMassEnergy/2.;
     925  iavai1 = 0;
    938926 
    939    for (i = 0; i < vecLen; i++)
     927  for (i = 0; i < vecLen; i++)
    940928       {
    941929         if (pv[i].getSide() > 0)
     
    945933            }   
    946934       }
    947    if ( iavai1 == 0) return;
    948 
    949    while( tavai1 <= 0.0 )
    950         {                   // must eliminate a particle from the forward side
    951            iskip = G4int(G4UniformRand()*iavai1) + 1;
    952            is = 0; 
    953            for( i=vecLen-1; i>=0; i-- )
    954               {
    955                 if( pv[i].getSide() > 0 )
    956                   {
    957                     if (++is == iskip)
    958                         {
    959                            tavai1 += pv[i].getMass();
    960                            iavai1--;           
    961                            if ( i != vecLen-1)
    962                               {
    963                                  for( j=i; j<vecLen; j++ )
    964                                     {         
    965                                        pv[j] = pv[j+1];
    966                                     }
    967                               }
    968                            if( --vecLen == 0 ) return;     // all the secondaries except of the
    969                            break;            // --+
    970                         }                    //   |
    971                   }                          //   v
    972               }                              // break goes down to here
    973         }                                    // to the end of the for- loop.
    974                                        
    975 
    976      tavai2 = (targ+1)*centerOfMassEnergy/2.;
    977      G4int iavai2 = 0;
     935  if ( iavai1 == 0) return;
     936
     937  while (tavai1 <= 0.0) {
     938    // must eliminate a particle from the forward side
     939    iskip = G4int(G4UniformRand()*iavai1) + 1;
     940    is = 0; 
     941    for (i = vecLen-1; i >= 0; i--) {
     942      if (pv[i].getSide() > 0) {
     943        if (++is == iskip) {
     944          tavai1 += pv[i].getMass();
     945          iavai1--;           
     946          if (i != vecLen-1) {
     947            for (j = i; j < vecLen; j++) pv[j] = pv[j+1];
     948          }
     949          if (--vecLen == 0) return;  // all the secondaries except the
     950          break;                 // --+
     951        }                        //   |
     952      }                          //   v
     953    }                            // break goes down to here
     954  }                              // to the end of the for- loop.                         
     955
     956  tavai2 = (targ+1)*centerOfMassEnergy/2.;
     957  G4int iavai2 = 0;
    978958
    979959     for (i = 0; i < vecLen; i++)
     
    1014994        }
    1015995
    1016    if (verboseLevel > 1)
    1017       { G4cout << " pv Vector after Energy checks "
    1018              << vecLen << " " << tavai1 << " " << iavai1 << " " << tavai2
    1019              << " " <<  iavai2 << " " << ntarg << G4endl;
    1020         pvI.Print(-1);
    1021         pvT.Print(-1);
    1022         for (i=0; i < vecLen ; i++) pv[i].Print(i);
    1023       }
    1024    
    1025     //  define some vectors for Lorentz transformations
    1026    
    1027    G4HEVector* pvmx = new G4HEVector [10];
    1028    
    1029    pvmx[0].setMass( incidentMass );
    1030    pvmx[0].setMomentumAndUpdate( 0.0, 0.0, incidentTotalMomentum );
    1031    pvmx[1].setMass( protonMass);
    1032    pvmx[1].setMomentumAndUpdate( 0.0, 0.0, 0.0 );
    1033    pvmx[3].setMass( protonMass*(1+targ));
    1034    pvmx[3].setMomentumAndUpdate( 0.0, 0.0, 0.0 );
    1035    pvmx[4].setZero();
    1036    pvmx[5].setZero();
    1037    pvmx[7].setZero();
    1038    pvmx[8].setZero();
    1039    pvmx[8].setMomentum( 1.0, 0.0 );
    1040    pvmx[2].Add( pvmx[0], pvmx[1] );
    1041    pvmx[3].Add( pvmx[3], pvmx[0] );
    1042    pvmx[0].Lor( pvmx[0], pvmx[2] );
    1043    pvmx[1].Lor( pvmx[1], pvmx[2] );
    1044 
    1045    if (verboseLevel > 1)
    1046      { G4cout << " General Vectors after Definition " << G4endl;
    1047        for (i=0; i<10; i++) pvmx[i].Print(i);
    1048      }
    1049 
    1050    // Main loop for 4-momentum generation - see Pitha-report (Aachen)
    1051    // for a detailed description of the method.
    1052    // Process the secondary particles in reverse order.
    1053 
    1054    G4double dndl[20];
    1055    G4double binl[20];
    1056    G4double pvMass(0), pvEnergy(0);
    1057    G4int    pvCode;
    1058    G4double aspar, pt, phi, et, xval;
    1059    G4double ekin  = 0.;
    1060    G4double ekin1 = 0.;
    1061    G4double ekin2 = 0.;
    1062    G4int npg   = 0;
    1063    G4double rmg0 = 0.;
    1064    G4int targ1 = 0;                // No fragmentation model for nucleons from
    1065    phi = G4UniformRand()*twopi;
    1066    for( i=vecLen-1; i>=0; i-- )    // the intranuclear cascade. Mark them with
    1067       {                            // -3 and leave the loop
     996  if (verboseLevel > 1) {
     997    G4cout << " pv Vector after Energy checks "
     998           << vecLen << " " << tavai1 << " " << iavai1 << " " << tavai2
     999           << " " <<  iavai2 << " " << ntarg << G4endl;
     1000    pvI.Print(-1);
     1001    pvT.Print(-1);
     1002    for (i=0; i < vecLen ; i++) pv[i].Print(i);
     1003  }
     1004   
     1005  //  define some vectors for Lorentz transformations
     1006   
     1007  G4HEVector* pvmx = new G4HEVector [10];
     1008   
     1009  pvmx[0].setMass( incidentMass );
     1010  pvmx[0].setMomentumAndUpdate( 0.0, 0.0, incidentTotalMomentum );
     1011  pvmx[1].setMass( protonMass);
     1012  pvmx[1].setMomentumAndUpdate( 0.0, 0.0, 0.0 );
     1013  pvmx[3].setMass( protonMass*(1+targ));
     1014  pvmx[3].setMomentumAndUpdate( 0.0, 0.0, 0.0 );
     1015  pvmx[4].setZero();
     1016  pvmx[5].setZero();
     1017  pvmx[7].setZero();
     1018  pvmx[8].setZero();
     1019  pvmx[8].setMomentum( 1.0, 0.0 );
     1020  pvmx[2].Add( pvmx[0], pvmx[1] );
     1021  pvmx[3].Add( pvmx[3], pvmx[0] );
     1022  pvmx[0].Lor( pvmx[0], pvmx[2] );
     1023  pvmx[1].Lor( pvmx[1], pvmx[2] );
     1024
     1025  if (verboseLevel > 1) {
     1026    G4cout << " General Vectors after Definition " << G4endl;
     1027    for (i=0; i<10; i++) pvmx[i].Print(i);
     1028  }
     1029
     1030  // Main loop for 4-momentum generation - see Pitha-report (Aachen)
     1031  // for a detailed description of the method.
     1032  // Process the secondary particles in reverse order.
     1033
     1034  G4double dndl[20];
     1035  G4double binl[20];
     1036  G4double pvMass(0), pvEnergy(0);
     1037  G4int pvCode;
     1038  G4double aspar, pt, phi, et, xval;
     1039  G4double ekin  = 0.;
     1040  G4double ekin1 = 0.;
     1041  G4double ekin2 = 0.;
     1042  G4int npg   = 0;
     1043  G4double rmg0 = 0.;
     1044  G4int targ1 = 0;                // No fragmentation model for nucleons from
     1045  phi = G4UniformRand()*twopi;
     1046
     1047  for (i = vecLen-1; i >= 0; i--) {
     1048        // Intranuclear cascade: mark them with -3 and leave the loop
    10681049        if( i == 1)
    10691050          {
     
    12771258             }                                  // closes outer iteration
    12781259
    1279         if( eliminateThisParticle )             // not enough energy,
    1280           {                                     // eliminate this particle
    1281             if (verboseLevel > 1) {
    1282                   G4cout << " Eliminate particle index " << i << G4endl;
    1283                   pv[i].Print(i);
    1284             }
    1285             if(i != vecLen-1)
    1286                {
    1287                  for( j=i; j < vecLen-1; j++ )
    1288                    {                            // shift down
    1289                      pv[j] = pv[j+1];
    1290                    }
    1291                }
    1292             vecLen--;
    1293             if(vecLen < 2) return;
    1294             i++;
    1295             pvmx[6].Add( pvmx[4], pvmx[5] );
    1296             pvmx[6].setMomentum( 0.0 );          // set z-momentum
    1297           }
    1298       }                                          // closes main for loop
    1299    if (verboseLevel > 1)
    1300       { G4cout << " pv Vector after lambda fragmentation " << vecLen << G4endl;
    1301         pvI.Print(-1);
    1302         pvT.Print(-1);
    1303         for (i=0; i < vecLen ; i++) pv[i].Print(i);
    1304         for (i=0; i < 10; i++) pvmx[i].Print(i);
    1305       }
    1306    
    1307    
    1308    // Backward nucleons produced with a cluster model
    1309 
    1310    G4double gpar[] = {2.6, 2.6, 1.80, 1.30, 1.20};
    1311    G4double cpar[] = {0.6, 0.6, 0.35, 0.15, 0.10};
     1260    if (eliminateThisParticle) {
     1261      // Not enough energy - eliminate this particle
     1262      if (verboseLevel > 1) {
     1263        G4cout << " Eliminate particle index " << i << G4endl;
     1264        pv[i].Print(i);
     1265      }
     1266      if (i != vecLen-1) {
     1267        // shift down
     1268        for (j = i; j < vecLen-1; j++) pv[j] = pv[j+1];
     1269      }
     1270      vecLen--;
     1271
     1272      if (vecLen < 2) {
     1273        delete [] pvmx;
     1274        return;
     1275      }
     1276      i++;
     1277      pvmx[6].Add( pvmx[4], pvmx[5] );
     1278      pvmx[6].setMomentum( 0.0 );          // set z-momentum
     1279    }
     1280  }                                   // closes main for loop
     1281
     1282  if (verboseLevel > 1) {
     1283    G4cout << " pv Vector after lambda fragmentation " << vecLen << G4endl;
     1284    pvI.Print(-1);
     1285    pvT.Print(-1);
     1286    for (i=0; i < vecLen ; i++) pv[i].Print(i);
     1287    for (i=0; i < 10; i++) pvmx[i].Print(i);
     1288  }
     1289
     1290  // Backward nucleons produced with a cluster model
     1291
     1292  G4double gpar[] = {2.6, 2.6, 1.80, 1.30, 1.20};
     1293  G4double cpar[] = {0.6, 0.6, 0.35, 0.15, 0.10};
    13121294 
    1313    if (npg > 0)
    1314      {
    1315        G4double rmg = rmg0;
    1316        if (npg > 1)
    1317           {
    1318             G4int npg1 = npg-1;
    1319             if (npg1 >4) npg1 = 4;
    1320             rmg += std::pow( -std::log(1.-G4UniformRand()), cpar[npg1])/gpar[npg1];
    1321           }
    1322        G4double ga = 1.2;
    1323        G4double ekit1 = 0.04, ekit2 = 0.6;
    1324        if(incidentKineticEnergy < 5.)
    1325          {
    1326            ekit1 *= sqr(incidentKineticEnergy)/25.;
    1327            ekit2 *= sqr(incidentKineticEnergy)/25.;
    1328          }
    1329        G4double avalue = (1.-ga)/(std::pow(ekit2,1.-ga)-std::pow(ekit1,1.-ga));
    1330        for (i = 0; i < vecLen; i++)
    1331           {
    1332             if (pv[i].getSide() == -3)
    1333               {
    1334                 G4double ekit = std::pow(G4UniformRand()*(1.-ga)/avalue + std::pow(ekit1,1.-ga), 1./(1.-ga) );
    1335                 G4double cost = Amax(-1., Amin(1., std::log(2.23*G4UniformRand()+0.383)/0.96));
    1336                 G4double sint = std::sqrt(1. - cost*cost);
    1337                 G4double phi  = twopi*G4UniformRand();
    1338                 G4double pp   = std::sqrt(ekit*(ekit+2*pv[i].getMass()));
    1339                 pv[i].setMomentum( pp*sint*std::sin(phi),
    1340                                    pp*sint*std::cos(phi),
    1341                                    pp*cost          );
    1342                 pv[i].Lor( pv[i], pvmx[2] );
    1343                 pvmx[5].Add( pvmx[5], pv[i] );
    1344               }
    1345           }
    1346      }
     1295  if (npg > 0) {
     1296    G4double rmg = rmg0;
     1297    if (npg > 1) {
     1298      G4int npg1 = npg-1;
     1299      if (npg1 >4) npg1 = 4;
     1300      rmg += std::pow( -std::log(1.-G4UniformRand()), cpar[npg1])/gpar[npg1];
     1301    }
     1302    G4double ga = 1.2;
     1303    G4double ekit1 = 0.04, ekit2 = 0.6;
     1304    if (incidentKineticEnergy < 5.) {
     1305      ekit1 *= sqr(incidentKineticEnergy)/25.;
     1306      ekit2 *= sqr(incidentKineticEnergy)/25.;
     1307    }
     1308    G4double avalue = (1.-ga)/(std::pow(ekit2,1.-ga)-std::pow(ekit1,1.-ga));
     1309    for (i = 0; i < vecLen; i++) {
     1310      if (pv[i].getSide() == -3) {
     1311        G4double ekit = std::pow(G4UniformRand()*(1.-ga)/avalue + std::pow(ekit1,1.-ga), 1./(1.-ga) );
     1312        G4double cost = Amax(-1., Amin(1., std::log(2.23*G4UniformRand()+0.383)/0.96));
     1313        G4double sint = std::sqrt(1. - cost*cost);
     1314        G4double phi  = twopi*G4UniformRand();
     1315        G4double pp   = std::sqrt(ekit*(ekit+2*pv[i].getMass()));
     1316        pv[i].setMomentum(pp*sint*std::sin(phi),
     1317                          pp*sint*std::cos(phi),
     1318                          pp*cost);
     1319        pv[i].Lor( pv[i], pvmx[2] );
     1320        pvmx[5].Add( pvmx[5], pv[i] );
     1321      }
     1322    }
     1323  }
    13471324       
    1348    if (vecLen <= 2) {
    1349      successful = false;
    1350      return;
    1351    } 
    1352 
    1353    // Lorentz transformation in lab system
     1325  if (vecLen <= 2) {
     1326    successful = false;
     1327    delete [] pvmx;
     1328    return;
     1329  } 
     1330
     1331  // Lorentz transformation in lab system
    13541332
    13551333   targ = 0;
     
    13981376     }
    13991377
    1400    pvmx[3].setMass( incidentMass);
    1401    pvmx[3].setMomentumAndUpdate( 0.0, 0.0, incidentTotalMomentum );
    1402    
    1403    G4double ekin0 = pvmx[3].getKineticEnergy();
    1404    
    1405    pvmx[4].setMass( protonMass * targ);
    1406    pvmx[4].setEnergy( protonMass * targ);
    1407    pvmx[4].setKineticEnergy(0.);
    1408    pvmx[4].setMomentum(0., 0., 0.);
    1409    ekin = pvmx[3].getEnergy() + pvmx[4].getEnergy();
     1378  pvmx[3].setMass( incidentMass);
     1379  pvmx[3].setMomentumAndUpdate( 0.0, 0.0, incidentTotalMomentum );
     1380   
     1381  G4double ekin0 = pvmx[3].getKineticEnergy();
     1382   
     1383  pvmx[4].setMass( protonMass * targ);
     1384  pvmx[4].setEnergy( protonMass * targ);
     1385  pvmx[4].setKineticEnergy(0.);
     1386  pvmx[4].setMomentum(0., 0., 0.);
     1387  ekin = pvmx[3].getEnergy() + pvmx[4].getEnergy();
    14101388
    14111389   pvmx[5].Add( pvmx[3], pvmx[4] );
     
    14711449     }
    14721450
    1473    // Do some smearing in the transverse direction due to Fermi motion
     1451  // Do some smearing in the transverse direction due to Fermi motion
    14741452   
    14751453   G4double ry   = G4UniformRand();
     
    14911469   }
    14921470
    1493    // Rotate in the direction of the primary particle momentum (z-axis).
    1494    // This does disturb our inclusive distributions somewhat, but it is
    1495    // necessary for momentum conservation
    1496 
    1497    // Also subtract binding energies and make some further corrections
    1498    // if required
    1499 
    1500    G4double dekin = 0.0;
    1501    G4int npions = 0;   
    1502    G4double ek1 = 0.0;
    1503    G4double alekw, xxh;
    1504    G4double cfa = 0.025*((atomicWeight-1.)/120.)*std::exp(-(atomicWeight-1.)/120.);
    1505    G4double alem[] = {1.40, 2.30, 2.70, 3.00, 3.40, 4.60, 7.00, 10.00};
    1506    G4double val0[] = {0.00, 0.40, 0.48, 0.51, 0.54, 0.60, 0.65,  0.70};
    1507    
    1508    if (verboseLevel > 1)
    1509      G4cout << " Rotation in Direction  of primary particle (Defs1)" << G4endl;
    1510 
    1511    for (i = 0; i < vecLen; i++)
    1512       {
    1513         if(verboseLevel > 1) pv[i].Print(i);
    1514         pv[i].Defs1( pv[i], pvI );
    1515         if(verboseLevel > 1) pv[i].Print(i);
    1516         if (atomicWeight > 1.5)
    1517            {
    1518              ekin  = Amax( 1.e-6,pv[i].getKineticEnergy() - cfa*( 1. + 0.5*normal()));
    1519              alekw = std::log( incidentKineticEnergy );
    1520              xxh   = 1.;
    1521              if(incidentCode == pionPlusCode || incidentCode == pionMinusCode)
    1522                {
    1523                  if(pv[i].getCode() == pionZeroCode)
    1524                    {
    1525                      if(G4UniformRand() < std::log(atomicWeight))
    1526                        {
    1527                          if (alekw > alem[0])
    1528                            {
    1529                               for (j = 1; j < 8; j++)
    1530                                  {
    1531                                     if(alekw < alem[j]) break;
    1532                                  }
    1533                               xxh =   (val0[j]-val0[j-1])/(alem[j]-alem[j-1])*alekw
    1534                                      + val0[j-1] - (val0[j]-val0[j-1])/(alem[j]-alem[j-1])*alem[j-1];
    1535                               xxh = 1. - xxh;
    1536                            }
    1537                        }     
    1538                     }
    1539                } 
    1540              dekin += ekin*(1.-xxh);
    1541              ekin *= xxh;
    1542              pv[i].setKineticEnergyAndUpdate( ekin );
    1543              pvCode = pv[i].getCode();
    1544              if ((pvCode == pionPlusCode) || (pvCode == pionMinusCode) || (pvCode == pionZeroCode))
    1545                 {
    1546                   npions += 1;
    1547                   ek1 += ekin;
     1471  // Rotate in the direction of the primary particle momentum (z-axis).
     1472  // This does disturb our inclusive distributions somewhat, but it is
     1473  // necessary for momentum conservation
     1474
     1475  // Also subtract binding energies and make some further corrections
     1476  // if required
     1477
     1478  G4double dekin = 0.0;
     1479  G4int npions = 0;   
     1480  G4double ek1 = 0.0;
     1481  G4double alekw, xxh;
     1482  G4double cfa = 0.025*((atomicWeight-1.)/120.)*std::exp(-(atomicWeight-1.)/120.);
     1483  G4double alem[] = {1.40, 2.30, 2.70, 3.00, 3.40, 4.60, 7.00, 10.00};
     1484  G4double val0[] = {0.00, 0.40, 0.48, 0.51, 0.54, 0.60, 0.65,  0.70};
     1485   
     1486  if (verboseLevel > 1)
     1487    G4cout << " Rotation in Direction  of primary particle (Defs1)" << G4endl;
     1488
     1489  for (i = 0; i < vecLen; i++) {
     1490    if(verboseLevel > 1) pv[i].Print(i);
     1491    pv[i].Defs1( pv[i], pvI );
     1492    if(verboseLevel > 1) pv[i].Print(i);
     1493    if (atomicWeight > 1.5) {
     1494      ekin = Amax( 1.e-6,pv[i].getKineticEnergy() - cfa*( 1. + 0.5*normal()));
     1495      alekw = std::log( incidentKineticEnergy );
     1496      xxh = 1.;
     1497      if (incidentCode == pionPlusCode || incidentCode == pionMinusCode) {
     1498        if (pv[i].getCode() == pionZeroCode) {
     1499          if (G4UniformRand() < std::log(atomicWeight)) {
     1500            if (alekw > alem[0]) {
     1501              G4int jmax = 1;
     1502              for (j = 1; j < 8; j++) {
     1503                if (alekw < alem[j]) {
     1504                  jmax = j;
     1505                  break;
    15481506                }
    1549            }
    1550       }
    1551    if( (ek1 > 0.0) && (npions > 0) )
    1552       {
    1553         dekin = 1.+dekin/ek1;
    1554         for (i = 0; i < vecLen; i++)
    1555           {
    1556             pvCode = pv[i].getCode();
    1557             if((pvCode == pionPlusCode) || (pvCode == pionMinusCode) || (pvCode == pionZeroCode))
    1558               {
    1559                 ekin = Amax( 1.0e-6, pv[i].getKineticEnergy() * dekin );
    1560                 pv[i].setKineticEnergyAndUpdate( ekin );
    15611507              }
    1562           }
    1563       }
    1564    if (verboseLevel > 1)
    1565       { G4cout << " Lab-System " <<  ek1 << " " << npions << G4endl;
    1566         incidentParticle.Print(0);
    1567         targetParticle.Print(1);
    1568         for (i=0; i<vecLen; i++) pv[i].Print(i);
    1569       }
    1570 
    1571    // Add black track particles
    1572    // the total number of particles produced is restricted to 198
    1573    // this may have influence on very high energies
     1508              xxh = (val0[jmax]-val0[jmax-1])/(alem[jmax]-alem[jmax-1])*alekw
     1509                   + val0[jmax-1] - (val0[jmax]-val0[jmax-1])/(alem[jmax]-alem[jmax-1])*alem[jmax-1];
     1510              xxh = 1. - xxh;
     1511            }
     1512          }     
     1513        }
     1514      }
     1515      dekin += ekin*(1.-xxh);
     1516      ekin *= xxh;
     1517      pv[i].setKineticEnergyAndUpdate( ekin );
     1518      pvCode = pv[i].getCode();
     1519      if ((pvCode == pionPlusCode) ||
     1520          (pvCode == pionMinusCode) ||
     1521          (pvCode == pionZeroCode)) {
     1522        npions += 1;
     1523        ek1 += ekin;
     1524      }
     1525    }
     1526  }
     1527
     1528  if ( (ek1 > 0.0) && (npions > 0) ) {
     1529    dekin = 1.+dekin/ek1;
     1530    for (i = 0; i < vecLen; i++) {
     1531      pvCode = pv[i].getCode();
     1532      if ((pvCode == pionPlusCode) ||
     1533          (pvCode == pionMinusCode) ||
     1534          (pvCode == pionZeroCode)) {
     1535        ekin = Amax(1.0e-6, pv[i].getKineticEnergy() * dekin);
     1536        pv[i].setKineticEnergyAndUpdate( ekin );
     1537      }
     1538    }
     1539  }
     1540
     1541  if (verboseLevel > 1) {
     1542    G4cout << " Lab-System " <<  ek1 << " " << npions << G4endl;
     1543    incidentParticle.Print(0);
     1544    targetParticle.Print(1);
     1545    for (i = 0; i < vecLen; i++) pv[i].Print(i);
     1546  }
     1547
     1548  // Add black track particles
     1549  // the total number of particles produced is restricted to 198
     1550  // this may have influence on very high energies
    15741551
    15751552   if (verboseLevel > 1)
     
    17811758   }
    17821759   
    1783    return;
    1784  }
     1760  return;
     1761}
    17851762
    17861763void
    17871764G4HEInelastic::TuningOfHighEnergyCascading(G4HEVector pv[],
    1788                                            G4int &vecLen,
    1789                                            G4HEVector incidentParticle,
    1790                                            G4HEVector targetParticle,
     1765                                           G4int& vecLen,
     1766                                           const G4HEVector& incidentParticle,
     1767                                           const G4HEVector& targetParticle,
    17911768                                           G4double atomicWeight,
    17921769                                           G4double atomicNumber)
     
    21272104
    21282105void
    2129 G4HEInelastic::HighEnergyClusterProduction(G4bool &successful,
     2106G4HEInelastic::HighEnergyClusterProduction(G4bool& successful,
    21302107                                           G4HEVector pv[],
    2131                                            G4int &vecLen,       
    2132                                            G4double &excitationEnergyGNP,
    2133                                            G4double &excitationEnergyDTA,
    2134                                            G4HEVector incidentParticle,
    2135                                            G4HEVector targetParticle,
     2108                                           G4int& vecLen,       
     2109                                           G4double& excitationEnergyGNP,
     2110                                           G4double& excitationEnergyDTA,
     2111                                           const G4HEVector& incidentParticle,
     2112                                           const G4HEVector& targetParticle,
    21362113                                           G4double atomicWeight,
    21372114                                           G4double atomicNumber)
    2138  {   
     2115{   
    21392116// For low multiplicity in the first intranuclear interaction the cascading process
    21402117// as described in G4HEInelastic::MediumEnergyCascading does not work
     
    21442121//  All quantities on the G4HEVector Array pv are in GeV- units.
    21452122
    2146    G4int protonCode       = Proton.getCode();
    2147    G4double protonMass    = Proton.getMass();
    2148    G4int neutronCode      = Neutron.getCode();
    2149    G4double kaonPlusMass  = KaonPlus.getMass();
    2150    G4int pionPlusCode     = PionPlus.getCode();   
    2151    G4int pionZeroCode     = PionZero.getCode();   
    2152    G4int pionMinusCode    = PionMinus.getCode();
    2153    G4String mesonType    = PionPlus.getType();
    2154    G4String baryonType    = Proton.getType();
    2155    G4String antiBaryonType= AntiProton.getType();
     2123  G4int protonCode       = Proton.getCode();
     2124  G4double protonMass    = Proton.getMass();
     2125  G4int neutronCode      = Neutron.getCode();
     2126  G4double kaonPlusMass  = KaonPlus.getMass();
     2127  G4int pionPlusCode     = PionPlus.getCode();   
     2128  G4int pionZeroCode     = PionZero.getCode();   
     2129  G4int pionMinusCode    = PionMinus.getCode();
     2130  G4String mesonType = PionPlus.getType();
     2131  G4String baryonType = Proton.getType();
     2132  G4String antiBaryonType = AntiProton.getType();
    21562133 
    2157    G4double targetMass  = targetParticle.getMass();
     2134  G4double targetMass = targetParticle.getMass();
    21582135
    21592136   G4int    incidentCode          = incidentParticle.getCode();
     
    21662143   G4double incidentTOF           = 0.;
    21672144   
    2168                                                               // some local variables
    2169 
    2170    G4int i, j;
    2171    
    2172    if(verboseLevel > 1) G4cout << " G4HEInelastic::HighEnergyClusterProduction " << G4endl;
    2173 
    2174    successful = false;
    2175    if(incidentTotalMomentum < 25. + G4UniformRand()*25.) return;
    2176 
    2177    G4double centerOfMassEnergy = std::sqrt( sqr(incidentMass) + sqr(targetMass)
    2178                                        +2.*targetMass*incidentEnergy);
    2179 
    2180    G4HEVector pvI = incidentParticle;  // for the incident particle
    2181    pvI.setSide( 1 );
    2182 
    2183    G4HEVector pvT = targetParticle;   // for the target particle
    2184    pvT.setMomentumAndUpdate( 0.0, 0.0, 0.0 );
    2185    pvT.setSide( -1 );
    2186    pvT.setTOF( -1.);
    2187                               // distribute particles in forward and backward
    2188                               // hemispheres. Note that only low multiplicity
    2189                               // events from FirstIntInNuc.... should go into
    2190                               // this routine.
    2191    G4int targ  = 0; 
    2192    G4int ifor  = 0;
    2193    G4int iback = 0;
    2194    G4int pvCode;
    2195    G4double pvMass, pvEnergy;
    2196 
    2197    pv[0].setSide(  1 );
    2198    pv[1].setSide( -1 );
    2199    for(i = 0; i < vecLen; i++)
    2200       {
    2201         if (i > 1)
    2202            {
    2203               if( G4UniformRand() < 0.5)
    2204                 {
    2205                   pv[i].setSide( 1 );
    2206                   if (++ifor > 18)
    2207                      {
    2208                        pv[i].setSide( -1 );
    2209                        ifor--;
    2210                        iback++;
    2211                      }
    2212                 }
    2213               else
    2214                 {
    2215                   pv[i].setSide( -1 );
    2216                   if (++iback > 18)
    2217                      {
    2218                        pv[i].setSide( 1 );
    2219                        ifor++;
    2220                        iback--;
    2221                      }
    2222                 }
    2223            }
    2224 
    2225         pvCode = pv[i].getCode();
    2226 
    2227         if (   (    (incidentCode == protonCode) || (incidentCode == neutronCode)
    2228                  || (incidentType == mesonType) )
    2229             && (    (pvCode == pionPlusCode) || (pvCode == pionMinusCode) )
    2230             && (    (G4UniformRand() < (10.-incidentTotalMomentum)/6.) )
    2231             && (    (G4UniformRand() < atomicWeight/300.) ) )
    2232            {
    2233                if (G4UniformRand() > atomicNumber/atomicWeight)
    2234                   pv[i].setDefinition( "Neutron" );
    2235                else
    2236                   pv[i].setDefinition( "Proton" );
    2237                targ++;
    2238            }   
    2239         pv[i].setTOF( incidentTOF );                 
    2240       }   
    2241    G4double tb = 2. * iback;
    2242    if (centerOfMassEnergy < (2+G4UniformRand())) tb = (2.*iback + vecLen)/2.;
    2243    
    2244    G4double nucsup[] = { 1.0, 0.7, 0.5, 0.4, 0.35, 0.3};
    2245    G4double  psup[]   = { 3. , 6. , 20., 50., 100.,1000.};   
    2246    G4double s = centerOfMassEnergy*centerOfMassEnergy;
    2247 
    2248    G4double xtarg = Amax(0.01, Amin(0.50, 0.312+0.2*std::log(std::log(s))+std::pow(s,1.5)/6000.)
     2145  // some local variables
     2146  G4int i, j;
     2147   
     2148  if (verboseLevel > 1)
     2149    G4cout << " G4HEInelastic::HighEnergyClusterProduction " << G4endl;
     2150
     2151  successful = false;
     2152  if (incidentTotalMomentum < 25. + G4UniformRand()*25.) return;
     2153
     2154  G4double centerOfMassEnergy = std::sqrt( sqr(incidentMass) + sqr(targetMass)
     2155                                         +2.*targetMass*incidentEnergy);
     2156
     2157  G4HEVector pvI = incidentParticle;  // for the incident particle
     2158  pvI.setSide(1);
     2159
     2160  G4HEVector pvT = targetParticle;   // for the target particle
     2161  pvT.setMomentumAndUpdate( 0.0, 0.0, 0.0 );
     2162  pvT.setSide( -1 );
     2163  pvT.setTOF( -1.);
     2164                    // distribute particles in forward and backward
     2165                    // hemispheres. Note that only low multiplicity
     2166                    // events from FirstIntInNuc.... should go into
     2167                    // this routine.
     2168  G4int targ  = 0; 
     2169  G4int ifor  = 0;
     2170  G4int iback = 0;
     2171  G4int pvCode;
     2172  G4double pvMass, pvEnergy;
     2173
     2174  pv[0].setSide(1);
     2175  pv[1].setSide(-1);
     2176  for (i = 0; i < vecLen; i++) {
     2177    if (i > 1) {
     2178      if (G4UniformRand() < 0.5) {
     2179        pv[i].setSide( 1 );
     2180        if (++ifor > 18) {
     2181          pv[i].setSide(-1);
     2182          ifor--;
     2183          iback++;
     2184        }
     2185      } else {
     2186        pv[i].setSide( -1 );
     2187        if (++iback > 18) {
     2188          pv[i].setSide(1);
     2189          ifor++;
     2190          iback--;
     2191        }
     2192      }
     2193    }
     2194
     2195    pvCode = pv[i].getCode();
     2196
     2197    if (   (    (incidentCode == protonCode) || (incidentCode == neutronCode)
     2198             || (incidentType == mesonType) )
     2199        && (    (pvCode == pionPlusCode) || (pvCode == pionMinusCode) )
     2200        && (    (G4UniformRand() < (10.-incidentTotalMomentum)/6.) )
     2201        && (    (G4UniformRand() < atomicWeight/300.) ) ) {
     2202      if (G4UniformRand() > atomicNumber/atomicWeight)
     2203        pv[i].setDefinition("Neutron");
     2204      else
     2205        pv[i].setDefinition("Proton");
     2206      targ++;
     2207    }
     2208    pv[i].setTOF( incidentTOF );                 
     2209  }
     2210   
     2211  G4double tb = 2. * iback;
     2212  if (centerOfMassEnergy < (2+G4UniformRand())) tb = (2.*iback + vecLen)/2.;
     2213   
     2214  G4double nucsup[] = {1.0, 0.7, 0.5, 0.4, 0.35, 0.3};
     2215  G4double psup[] = {3. , 6. , 20., 50., 100.,1000.};   
     2216  G4double s = centerOfMassEnergy*centerOfMassEnergy;
     2217
     2218  G4double xtarg = Amax(0.01, Amin(0.50, 0.312+0.2*std::log(std::log(s))+std::pow(s,1.5)/6000.)
    22492219                             * (std::pow(atomicWeight,0.33)-1.) * tb);
    2250    G4int momentumBin = 0;
     2220  G4int momentumBin = 0;
    22512221   while( (momentumBin < 6) && (incidentTotalMomentum > psup[momentumBin])) momentumBin++;
    22522222   momentumBin = Imin(5, momentumBin);
     
    27292699     }     
    27302700
    2731    // Do some smearing in the transverse direction due to Fermi motion
    2732    
    2733    G4double ry   = G4UniformRand();
    2734    G4double rz   = G4UniformRand();
    2735    G4double rx   = twopi*rz;
    2736    G4double a1   = std::sqrt(-2.0*std::log(ry));
    2737    G4double rantarg1 = a1*std::cos(rx)*0.02*targ/G4double(vecLen);
    2738    G4double rantarg2 = a1*std::sin(rx)*0.02*targ/G4double(vecLen);
    2739 
    2740    for (i = 0; i < vecLen; i++)
    2741      pv[i].setMomentum( pv[i].getMomentum().x()+rantarg1,
    2742                         pv[i].getMomentum().y()+rantarg2 );
    2743 
    2744    if (verboseLevel > 1) {                         
    2745      pvmx[7].setZero();
    2746      for (i = 0; i < vecLen; i++) pvmx[7].Add( pvmx[7], pv[i] ); 
    2747      teta = pvmx[7].Ang( pvmx[4] );   
    2748      G4cout << " After smearing " << teta << G4endl;
    2749    }
    2750 
    2751    // Rotate in the direction of the primary particle momentum (z-axis).
    2752    // This does disturb our inclusive distributions somewhat, but it is
    2753    // necessary for momentum conservation
    2754 
    2755    // Also subtract binding energies and make some further corrections
    2756    // if required
    2757 
    2758    G4double dekin = 0.0;
    2759    G4int npions = 0;   
    2760    G4double ek1 = 0.0;
    2761    G4double alekw, xxh;
    2762    G4double cfa = 0.025*((atomicWeight-1.)/120.)*std::exp(-(atomicWeight-1.)/120.);
    2763    G4double alem[] = {1.40, 2.30, 2.70, 3.00, 3.40, 4.60, 7.00, 10.0};
    2764    G4double val0[] = {0.00, 0.40, 0.48, 0.51, 0.54, 0.60, 0.65, 0.70};
    2765    
    2766 
    2767    for (i = 0; i < vecLen; i++)
    2768       {
    2769         pv[i].Defs1( pv[i], pvI );
    2770         if (atomicWeight > 1.5)
    2771            {
    2772              ekin  = Amax( 1.e-6,pv[i].getKineticEnergy() - cfa*( 1. + 0.5*normal()));
    2773              alekw = std::log( incidentKineticEnergy );
    2774              xxh   = 1.;
    2775              xxh   = 1.;
    2776              if(incidentCode == pionPlusCode || incidentCode == pionMinusCode)
    2777                {
    2778                  if(pv[i].getCode() == pionZeroCode)
    2779                    {
    2780                      if(G4UniformRand() < std::log(atomicWeight))
    2781                        {
    2782                          if (alekw > alem[0])
    2783                            {
    2784                               for (j = 1; j < 8; j++)
    2785                                  {
    2786                                     if(alekw < alem[j]) break;
    2787                                  }
    2788                               xxh =   (val0[j]-val0[j-1])/(alem[j]-alem[j-1])*alekw
    2789                                      + val0[j-1] - (val0[j]-val0[j-1])/(alem[j]-alem[j-1])*alem[j-1];
    2790                               xxh = 1. - xxh;
    2791                            }
    2792                        }     
    2793                     }
    2794                } 
    2795              dekin += ekin*(1.-xxh);
    2796              ekin *= xxh;
    2797              pv[i].setKineticEnergyAndUpdate( ekin );
    2798              pvCode = pv[i].getCode();
    2799              if ((pvCode == pionPlusCode) || (pvCode == pionMinusCode) || (pvCode == pionZeroCode))
    2800                 {
    2801                   npions += 1;
    2802                   ek1 += ekin;
     2701  // Do some smearing in the transverse direction due to Fermi motion
     2702   
     2703  G4double ry   = G4UniformRand();
     2704  G4double rz   = G4UniformRand();
     2705  G4double rx   = twopi*rz;
     2706  G4double a1   = std::sqrt(-2.0*std::log(ry));
     2707  G4double rantarg1 = a1*std::cos(rx)*0.02*targ/G4double(vecLen);
     2708  G4double rantarg2 = a1*std::sin(rx)*0.02*targ/G4double(vecLen);
     2709
     2710  for (i = 0; i < vecLen; i++)
     2711    pv[i].setMomentum(pv[i].getMomentum().x()+rantarg1,
     2712                      pv[i].getMomentum().y()+rantarg2);
     2713
     2714  if (verboseLevel > 1) {
     2715    pvmx[7].setZero();
     2716    for (i = 0; i < vecLen; i++) pvmx[7].Add( pvmx[7], pv[i] ); 
     2717    teta = pvmx[7].Ang( pvmx[4] );   
     2718    G4cout << " After smearing " << teta << G4endl;
     2719  }
     2720
     2721  // Rotate in the direction of the primary particle momentum (z-axis).
     2722  // This does disturb our inclusive distributions somewhat, but it is
     2723  // necessary for momentum conservation
     2724
     2725  // Also subtract binding energies and make some further corrections
     2726  // if required
     2727
     2728  G4double dekin = 0.0;
     2729  G4int npions = 0;   
     2730  G4double ek1 = 0.0;
     2731  G4double alekw, xxh;
     2732  G4double cfa = 0.025*((atomicWeight-1.)/120.)*std::exp(-(atomicWeight-1.)/120.);
     2733  G4double alem[] = {1.40, 2.30, 2.70, 3.00, 3.40, 4.60, 7.00, 10.0};
     2734  G4double val0[] = {0.00, 0.40, 0.48, 0.51, 0.54, 0.60, 0.65, 0.70};
     2735   
     2736  for (i = 0; i < vecLen; i++) {
     2737    pv[i].Defs1( pv[i], pvI );
     2738    if (atomicWeight > 1.5) {
     2739      ekin  = Amax( 1.e-6,pv[i].getKineticEnergy() - cfa*( 1. + 0.5*normal()));
     2740      alekw = std::log( incidentKineticEnergy );
     2741      xxh   = 1.;
     2742      if (incidentCode == pionPlusCode || incidentCode == pionMinusCode) {
     2743        if (pv[i].getCode() == pionZeroCode) {
     2744          if (G4UniformRand() < std::log(atomicWeight)) {
     2745            if (alekw > alem[0]) {
     2746              G4int jmax = 1;
     2747              for (j = 1; j < 8; j++) {
     2748                if (alekw < alem[j]) {
     2749                  jmax = j;
     2750                  break;
    28032751                }
    2804            }
    2805       }
     2752              }
     2753              xxh = (val0[jmax]-val0[jmax-1])/(alem[jmax]-alem[jmax-1])*alekw
     2754                     + val0[jmax-1] - (val0[jmax]-val0[jmax-1])/(alem[jmax]-alem[jmax-1])*alem[jmax-1];
     2755              xxh = 1. - xxh;
     2756            }
     2757          }
     2758        }
     2759      }
     2760      dekin += ekin*(1.-xxh);
     2761      ekin *= xxh;
     2762      pv[i].setKineticEnergyAndUpdate( ekin );
     2763      pvCode = pv[i].getCode();
     2764      if ((pvCode == pionPlusCode) ||
     2765          (pvCode == pionMinusCode) ||
     2766          (pvCode == pionZeroCode)) {
     2767        npions += 1;
     2768        ek1 += ekin;
     2769      }
     2770    }
     2771  }
     2772
    28062773   if( (ek1 > 0.0) && (npions > 0) )
    28072774      {
     
    30032970   }
    30042971
    3005    successful = true;
    3006    delete [] pvmx;
    3007    delete [] tempV;
    3008    return;
    3009  }
     2972  successful = true;
     2973  delete [] pvmx;
     2974  delete [] tempV;
     2975  return;
     2976}
    30102977
    30112978void
    3012 G4HEInelastic::MediumEnergyCascading(G4bool &successful,
     2979G4HEInelastic::MediumEnergyCascading(G4bool& successful,
    30132980                                     G4HEVector pv[],
    3014                                      G4int &vecLen,     
    3015                                      G4double &excitationEnergyGNP,
    3016                                      G4double &excitationEnergyDTA,
    3017                                      G4HEVector incidentParticle,
    3018                                      G4HEVector targetParticle,
     2981                                     G4int& vecLen,     
     2982                                     G4double& excitationEnergyGNP,
     2983                                     G4double& excitationEnergyDTA,
     2984                                     const G4HEVector& incidentParticle,
     2985                                     const G4HEVector& targetParticle,
    30192986                                     G4double atomicWeight,
    30202987                                     G4double atomicNumber)
    3021  {   
    3022 //
    3023 //  The multiplicity of particles produced in the first interaction has been
    3024 //  calculated in one of the FirstIntInNuc.... routines. The nuclear
    3025 //  cascading particles are parametrized from experimental data.
    3026 //  A simple single variable description E D3S/DP3= F(Q) with
    3027 //  Q^2 = (M*X)^2 + PT^2 is used. Final state kinematic is produced
    3028 //  by an FF-type iterative cascade method.
    3029 //  Nuclear evaporation particles are added at the end of the routine.
    3030 
    3031 //  All quantities on the G4HEVector Array pv are in GeV- units.
    3032 
    3033    G4int protonCode       = Proton.getCode();
    3034    G4double protonMass    = Proton.getMass();
    3035    G4int neutronCode      = Neutron.getCode();
    3036    G4double kaonPlusMass  = KaonPlus.getMass();
    3037    G4int kaonPlusCode     = KaonPlus.getCode();   
    3038    G4int kaonMinusCode    = KaonMinus.getCode();
    3039    G4int kaonZeroSCode    = KaonZeroShort.getCode();
    3040    G4int kaonZeroLCode    = KaonZeroLong.getCode();
    3041    G4int kaonZeroCode     = KaonZero.getCode();
    3042    G4int antiKaonZeroCode = AntiKaonZero.getCode();
    3043    G4int pionPlusCode     = PionPlus.getCode();   
    3044    G4int pionZeroCode     = PionZero.getCode();   
    3045    G4int pionMinusCode    = PionMinus.getCode();
    3046    G4String mesonType     = PionPlus.getType();
    3047    G4String baryonType    = Proton.getType();
    3048    G4String antiBaryonType= AntiProton.getType();
    3049 
    3050    G4double targetMass   = targetParticle.getMass();
    3051 
    3052    G4int    incidentCode          = incidentParticle.getCode();
    3053    G4double incidentMass          = incidentParticle.getMass();
    3054    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    3055    G4double incidentEnergy        = incidentParticle.getEnergy();
    3056    G4double incidentKineticEnergy = incidentParticle.getKineticEnergy();
    3057    G4String incidentType          = incidentParticle.getType();
    3058 //   G4double incidentTOF           = incidentParticle.getTOF();   
    3059    G4double incidentTOF           = 0.;
    3060    
    3061    // some local variables
    3062 
    3063    G4int i, j, l;
    3064 
    3065    if(verboseLevel > 1)
     2988{
     2989  // The multiplicity of particles produced in the first interaction has been
     2990  // calculated in one of the FirstIntInNuc.... routines. The nuclear
     2991  // cascading particles are parametrized from experimental data.
     2992  // A simple single variable description E D3S/DP3= F(Q) with
     2993  // Q^2 = (M*X)^2 + PT^2 is used. Final state kinematic is produced
     2994  // by an FF-type iterative cascade method.
     2995  // Nuclear evaporation particles are added at the end of the routine.
     2996
     2997  // All quantities on the G4HEVector Array pv are in GeV- units.
     2998
     2999  G4int protonCode       = Proton.getCode();
     3000  G4double protonMass    = Proton.getMass();
     3001  G4int neutronCode      = Neutron.getCode();
     3002  G4double kaonPlusMass  = KaonPlus.getMass();
     3003  G4int kaonPlusCode     = KaonPlus.getCode();   
     3004  G4int kaonMinusCode    = KaonMinus.getCode();
     3005  G4int kaonZeroSCode    = KaonZeroShort.getCode();
     3006  G4int kaonZeroLCode    = KaonZeroLong.getCode();
     3007  G4int kaonZeroCode     = KaonZero.getCode();
     3008  G4int antiKaonZeroCode = AntiKaonZero.getCode();
     3009  G4int pionPlusCode     = PionPlus.getCode();   
     3010  G4int pionZeroCode     = PionZero.getCode();   
     3011  G4int pionMinusCode = PionMinus.getCode();
     3012  G4String mesonType = PionPlus.getType();
     3013  G4String baryonType = Proton.getType();
     3014  G4String antiBaryonType = AntiProton.getType();
     3015
     3016  G4double targetMass = targetParticle.getMass();
     3017
     3018  G4int incidentCode = incidentParticle.getCode();
     3019  G4double incidentMass = incidentParticle.getMass();
     3020  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     3021  G4double incidentEnergy = incidentParticle.getEnergy();
     3022  G4double incidentKineticEnergy = incidentParticle.getKineticEnergy();
     3023  G4String incidentType = incidentParticle.getType();
     3024//  G4double incidentTOF           = incidentParticle.getTOF();   
     3025  G4double incidentTOF = 0.;
     3026   
     3027  // some local variables
     3028
     3029  G4int i, j, l;
     3030
     3031  if(verboseLevel > 1)
    30663032     G4cout << " G4HEInelastic::MediumEnergyCascading " << G4endl;
    30673033
    3068    // define annihilation channels.
     3034  // define annihilation channels.
    30693035                                 
    3070    G4bool annihilation = false;
    3071    if (incidentCode < 0 && incidentType == antiBaryonType &&
    3072        pv[0].getType() != antiBaryonType &&
    3073        pv[1].getType() != antiBaryonType   )
    3074          {
    3075            annihilation = true;
    3076          }   
    3077      
    3078    successful = false;
    3079 
    3080    G4double twsup[] = { 1., 1., 0.7, 0.5, 0.3, 0.2, 0.1, 0.0 };
     3036  G4bool annihilation = false;
     3037  if (incidentCode < 0 && incidentType == antiBaryonType &&
     3038      pv[0].getType() != antiBaryonType &&
     3039      pv[1].getType() != antiBaryonType) {
     3040    annihilation = true;
     3041  }
     3042 
     3043  successful = false;
     3044
     3045  G4double twsup[] = { 1., 1., 0.7, 0.5, 0.3, 0.2, 0.1, 0.0 };
    30813046   
    30823047   if(annihilation) goto start;
     
    35933558               }
    35943559            vecLen--;
    3595             if(vecLen < 2) return;
     3560            if (vecLen < 2) {
     3561              delete [] pvmx;
     3562              return;
     3563            }
    35963564            i++;
    35973565            pvmx[6].Add( pvmx[4], pvmx[5] );
     
    38293797   }
    38303798
    3831    // Rotate in the direction of the primary particle momentum (z-axis).
    3832    // This does disturb our inclusive distributions somewhat, but it is
    3833    // necessary for momentum conservation.
    3834 
    3835    // Also subtract binding energies and make some further corrections
    3836    // if required.
    3837 
    3838    G4double dekin = 0.0;
    3839    G4int npions = 0;   
    3840    G4double ek1 = 0.0;
    3841    G4double alekw, xxh;
    3842    G4double cfa = 0.025*((atomicWeight-1.)/120.)*std::exp(-(atomicWeight-1.)/120.);
    3843    G4double alem[] = {1.40, 2.30, 2.70, 3.00, 3.40, 4.60, 7.00, 10.00};
    3844    G4double val0[] = {0.00, 0.40, 0.48, 0.51, 0.54, 0.60, 0.65,  0.70};
    3845    
    3846 
    3847    for (i = 0; i < vecLen; i++)
    3848       {
    3849         pv[i].Defs1( pv[i], pvI );
    3850         if (atomicWeight > 1.5)
    3851            {
    3852              ekin  = Amax( 1.e-6,pv[i].getKineticEnergy() - cfa*( 1. + 0.5*normal()));
    3853              alekw = std::log( incidentKineticEnergy );
    3854              xxh   = 1.;
    3855              if(incidentCode == pionPlusCode || incidentCode == pionMinusCode)
    3856                {
    3857                  if(pv[i].getCode() == pionZeroCode)
    3858                    {
    3859                      if(G4UniformRand() < std::log(atomicWeight))
    3860                        {           
    3861                          if (alekw > alem[0])
    3862                            {
    3863                              for (j = 1; j < 8; j++)
    3864                                 {
    3865                                   if(alekw < alem[j]) break;
    3866                                 }
    3867                              xxh =   (val0[j]-val0[j-1])/(alem[j]-alem[j-1])*alekw
    3868                                     + val0[j-1] - (val0[j]-val0[j-1])/(alem[j]-alem[j-1])*alem[j-1];
    3869                              xxh = 1. - xxh;
    3870                            }
    3871                        }
    3872                     }
    3873                } 
    3874              dekin += ekin*(1.-xxh);
    3875              ekin *= xxh;
    3876              pv[i].setKineticEnergyAndUpdate( ekin );
    3877              pvCode = pv[i].getCode();
    3878              if ((pvCode == pionPlusCode) || (pvCode == pionMinusCode) || (pvCode == pionZeroCode))
    3879                 {
    3880                   npions += 1;
    3881                   ek1 += ekin;
     3799  // Rotate in the direction of the primary particle momentum (z-axis).
     3800  // This does disturb our inclusive distributions somewhat, but it is
     3801  // necessary for momentum conservation.
     3802
     3803  // Also subtract binding energies and make some further corrections
     3804  // if required.
     3805
     3806  G4double dekin = 0.0;
     3807  G4int npions = 0;   
     3808  G4double ek1 = 0.0;
     3809  G4double alekw, xxh;
     3810  G4double cfa = 0.025*((atomicWeight-1.)/120.)*std::exp(-(atomicWeight-1.)/120.);
     3811  G4double alem[] = {1.40, 2.30, 2.70, 3.00, 3.40, 4.60, 7.00, 10.00};
     3812  G4double val0[] = {0.00, 0.40, 0.48, 0.51, 0.54, 0.60, 0.65,  0.70};
     3813
     3814  for (i = 0; i < vecLen; i++) {
     3815    pv[i].Defs1( pv[i], pvI );
     3816    if (atomicWeight > 1.5) {
     3817      ekin = Amax( 1.e-6,pv[i].getKineticEnergy() - cfa*( 1. + 0.5*normal()));
     3818      alekw = std::log( incidentKineticEnergy );
     3819      xxh = 1.;
     3820      if (incidentCode == pionPlusCode || incidentCode == pionMinusCode) {
     3821        if (pv[i].getCode() == pionZeroCode) {
     3822          if (G4UniformRand() < std::log(atomicWeight)) {           
     3823            if (alekw > alem[0]) {
     3824              G4int jmax = 1;
     3825              for (j = 1; j < 8; j++) {
     3826                if (alekw < alem[j]) {
     3827                  jmax = j;
     3828                  break;
    38823829                }
    3883            }
    3884       }
     3830              }
     3831              xxh = (val0[jmax] - val0[jmax-1])/(alem[jmax]-alem[jmax-1])*alekw
     3832                   + val0[jmax-1] - (val0[jmax]-val0[jmax-1])/(alem[jmax]-alem[jmax-1])*alem[jmax-1];
     3833              xxh = 1. - xxh;
     3834            }
     3835          }
     3836        }
     3837      } 
     3838      dekin += ekin*(1.-xxh);
     3839      ekin *= xxh;
     3840      pv[i].setKineticEnergyAndUpdate( ekin );
     3841      pvCode = pv[i].getCode();
     3842      if ((pvCode == pionPlusCode) ||
     3843          (pvCode == pionMinusCode) ||
     3844          (pvCode == pionZeroCode)) {
     3845        npions += 1;
     3846        ek1 += ekin;
     3847      }
     3848    }
     3849  }
     3850
    38853851   if( (ek1 > 0.0) && (npions > 0) )
    38863852      {
     
    40874053
    40884054void
    4089 G4HEInelastic::MediumEnergyClusterProduction(G4bool &successful,
     4055G4HEInelastic::MediumEnergyClusterProduction(G4bool& successful,
    40904056                                             G4HEVector pv[],
    4091                                              G4int &vecLen,     
    4092                                              G4double &excitationEnergyGNP,
    4093                                              G4double &excitationEnergyDTA,
    4094                                              G4HEVector incidentParticle,
    4095                                              G4HEVector targetParticle,
     4057                                             G4int& vecLen,     
     4058                                             G4double& excitationEnergyGNP,
     4059                                             G4double& excitationEnergyDTA,
     4060                                             const G4HEVector& incidentParticle,
     4061                                             const G4HEVector& targetParticle,
    40964062                                             G4double atomicWeight,
    40974063                                             G4double atomicNumber)
    4098  {   
     4064{
    40994065// For low multiplicity in the first intranuclear interaction the cascading
    41004066// process as described in G4HEInelastic::MediumEnergyCascading does not work
     
    41044070//  All quantities on the G4HEVector Array pv are in GeV- units.
    41054071
    4106    G4int protonCode       = Proton.getCode();
    4107    G4double protonMass    = Proton.getMass();
    4108    G4int neutronCode      = Neutron.getCode();
    4109    G4double kaonPlusMass  = KaonPlus.getMass();
    4110    G4int pionPlusCode     = PionPlus.getCode();   
    4111    G4int pionZeroCode     = PionZero.getCode();   
    4112    G4int pionMinusCode    = PionMinus.getCode();
    4113    G4String mesonType    = PionPlus.getType();
    4114    G4String baryonType    = Proton.getType();
    4115    G4String antiBaryonType= AntiProton.getType();
    4116    
    4117    G4double targetMass  = targetParticle.getMass();
    4118 
    4119    G4int    incidentCode          = incidentParticle.getCode();
    4120    G4double incidentMass          = incidentParticle.getMass();
    4121    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    4122    G4double incidentEnergy        = incidentParticle.getEnergy();
    4123    G4double incidentKineticEnergy = incidentParticle.getKineticEnergy();
    4124    G4String incidentType          = incidentParticle.getType();
     4072  G4int protonCode       = Proton.getCode();
     4073  G4double protonMass    = Proton.getMass();
     4074  G4int neutronCode      = Neutron.getCode();
     4075  G4double kaonPlusMass  = KaonPlus.getMass();
     4076  G4int pionPlusCode     = PionPlus.getCode();   
     4077  G4int pionZeroCode     = PionZero.getCode();   
     4078  G4int pionMinusCode = PionMinus.getCode();
     4079  G4String mesonType = PionPlus.getType();
     4080  G4String baryonType = Proton.getType();
     4081  G4String antiBaryonType = AntiProton.getType();
     4082   
     4083  G4double targetMass = targetParticle.getMass();
     4084
     4085  G4int incidentCode = incidentParticle.getCode();
     4086  G4double incidentMass = incidentParticle.getMass();
     4087  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     4088  G4double incidentEnergy = incidentParticle.getEnergy();
     4089  G4double incidentKineticEnergy = incidentParticle.getKineticEnergy();
     4090  G4String incidentType = incidentParticle.getType();
    41254091//   G4double incidentTOF           = incidentParticle.getTOF();   
    4126    G4double incidentTOF          = 0.;
    4127    
    4128    // some local variables
    4129 
    4130    G4int i, j;
    4131    
    4132    if(verboseLevel > 1) G4cout << " G4HEInelastic::MediumEnergyClusterProduction " << G4endl;
    4133 
    4134    if (incidentTotalMomentum < 0.01)
    4135       {
    4136         successful = false;
    4137         return;
    4138       }
    4139    G4double centerOfMassEnergy = std::sqrt( sqr(incidentMass) + sqr(targetMass)
    4140                                        +2.*targetMass*incidentEnergy);
    4141 
    4142    G4HEVector pvI = incidentParticle;  // for the incident particle
    4143    pvI.setSide( 1 );
    4144 
    4145    G4HEVector pvT = targetParticle;   // for the target particle
    4146    pvT.setMomentumAndUpdate( 0.0, 0.0, 0.0 );
    4147    pvT.setSide( -1 );
    4148    pvT.setTOF( -1.);
     4092  G4double incidentTOF = 0.;
     4093   
     4094  // some local variables
     4095
     4096  G4int i, j;
     4097   
     4098  if (verboseLevel > 1)
     4099    G4cout << " G4HEInelastic::MediumEnergyClusterProduction " << G4endl;
     4100
     4101  if (incidentTotalMomentum < 0.01) {
     4102    successful = false;
     4103    return;
     4104  }
     4105  G4double centerOfMassEnergy = std::sqrt( sqr(incidentMass) + sqr(targetMass)
     4106                                        +2.*targetMass*incidentEnergy);
     4107
     4108  G4HEVector pvI = incidentParticle;  // for the incident particle
     4109  pvI.setSide( 1 );
     4110
     4111  G4HEVector pvT = targetParticle;   // for the target particle
     4112  pvT.setMomentumAndUpdate( 0.0, 0.0, 0.0 );
     4113  pvT.setSide( -1 );
     4114  pvT.setTOF( -1.);
    41494115 
    4150    // Distribute particles in forward and backward hemispheres. Note that
    4151    // only low multiplicity events from FirstIntInNuc.... should go into
    4152    // this routine.
     4116  // Distribute particles in forward and backward hemispheres. Note that
     4117  // only low multiplicity events from FirstIntInNuc.... should go into
     4118  // this routine.
    41534119 
    4154    G4int targ = 0; 
    4155    G4int ifor = 0;
    4156    G4int iback = 0;
    4157    G4int pvCode;
    4158    G4double pvMass, pvEnergy;
     4120  G4int targ = 0; 
     4121  G4int ifor = 0;
     4122  G4int iback = 0;
     4123  G4int pvCode;
     4124  G4double pvMass, pvEnergy;
    41594125
    41604126   pv[0].setSide(  1 );
     
    42074173   G4double nucsup[] = { 1.0, 0.8, 0.6, 0.5, 0.4};
    42084174
    4209    G4double xtarg = Amax(0.01,  (0.312+0.2*std::log(std::log(centerOfMassEnergy*centerOfMassEnergy)))
     4175   G4double xtarg = Amax(0.01, (0.312+0.2*std::log(std::log(centerOfMassEnergy*centerOfMassEnergy)))
    42104176                             * (std::pow(atomicWeight,0.33)-1.) * tb);
    42114177   G4int ntarg = Poisson(xtarg);
     
    45584524   }
    45594525
    4560    G4bool dum(0);
    4561    G4double ekin, teta;
    4562 
    4563    if( lead )
    4564      {
    4565        for( i=0; i<vecLen; i++ )
    4566           {
    4567             if( pv[i].getCode() == lead )
    4568               {
    4569                 dum = false;
    4570                 break;
    4571               }
    4572           }
    4573        if( dum )
    4574          {
    4575            i = 0;         
     4526  G4bool dum(0);
     4527  G4double ekin, teta;
     4528
     4529  if (lead) {
     4530    for (i = 0; i < vecLen; i++) {
     4531      if (pv[i].getCode() == lead) {
     4532        dum = false;
     4533        break;
     4534      }
     4535    }
     4536    // At this point dum is always false, so the following code
     4537    // cannot be executed.  For now, comment it out.
     4538    /*
     4539    if (dum) {
     4540      i = 0;         
    45764541 
    4577            if(   (    (leadParticle.getType() == baryonType ||
    4578                        leadParticle.getType() == antiBaryonType)
    4579                    && (pv[1].getType() == baryonType ||
    4580                        pv[1].getType() == antiBaryonType))
    4581               || (    (leadParticle.getType() == mesonType)
    4582                    && (pv[1].getType() == mesonType)))
    4583              {
    4584                i = 1;
    4585              }
    4586 
    4587             ekin = pv[i].getKineticEnergy();
    4588             pv[i] = leadParticle;
    4589             if( pv[i].getFlag() )
    4590                 pv[i].setTOF( -1.0 );
    4591             else
    4592                 pv[i].setTOF( 1.0 );
    4593             pv[i].setKineticEnergyAndUpdate( ekin );
    4594          }
    4595      }
     4542      if ( ( (leadParticle.getType() == baryonType ||
     4543              leadParticle.getType() == antiBaryonType)
     4544            && (pv[1].getType() == baryonType ||
     4545                pv[1].getType() == antiBaryonType))
     4546            || ( (leadParticle.getType() == mesonType)
     4547              && (pv[1].getType() == mesonType))) {
     4548        i = 1;
     4549      }
     4550
     4551      ekin = pv[i].getKineticEnergy();
     4552      pv[i] = leadParticle;
     4553      if (pv[i].getFlag() )
     4554         pv[i].setTOF( -1.0 );
     4555      else
     4556          pv[i].setTOF( 1.0 );
     4557      pv[i].setKineticEnergyAndUpdate( ekin );
     4558    }
     4559    */
     4560  }
    45964561
    45974562   pvmx[4].setMass( incidentMass);
     
    46824647   }
    46834648
    4684    // Rotate in the direction of the primary particle momentum (z-axis).
    4685    // This does disturb our inclusive distributions somewhat, but it is
    4686    // necessary for momentum conservation.
    4687 
    4688    // Also subtract binding energies and make some further corrections
    4689    // if required.
    4690 
    4691    G4double dekin = 0.0;
    4692    G4int npions = 0;   
    4693    G4double ek1 = 0.0;
    4694    G4double alekw, xxh;
    4695    G4double cfa = 0.025*((atomicWeight-1.)/120.)*std::exp(-(atomicWeight-1.)/120.);
    4696    G4double alem[] = {1.40, 2.30, 2.70, 3.00, 3.40, 4.60, 7.00};
    4697    G4double val0[] = {0.00, 0.40, 0.48, 0.51, 0.54, 0.60, 0.65};
    4698    
    4699 
    4700    for (i = 0; i < vecLen; i++)
    4701       {
    4702         pv[i].Defs1( pv[i], pvI );
    4703         if (atomicWeight > 1.5)
    4704            {
    4705              ekin  = Amax( 1.e-6,pv[i].getKineticEnergy() - cfa*( 1. + 0.5*normal()));
    4706              alekw = std::log( incidentKineticEnergy );
    4707              xxh   = 1.;
    4708              xxh   = 1.;
    4709              if(incidentCode == pionPlusCode || incidentCode == pionMinusCode)
    4710                {
    4711                  if(pv[i].getCode() == pionZeroCode)
    4712                    {
    4713                      if(G4UniformRand() < std::log(atomicWeight))
    4714                        {
    4715                          if (alekw > alem[0])
    4716                            {
    4717                               for (j = 1; j < 8; j++)
    4718                                  {
    4719                                     if(alekw < alem[j]) break;
    4720                                  }
    4721                               xxh =   (val0[j]-val0[j-1])/(alem[j]-alem[j-1])*alekw
    4722                                      + val0[j-1] - (val0[j]-val0[j-1])/(alem[j]-alem[j-1])*alem[j-1];
    4723                               xxh = 1. - xxh;
    4724                            }
    4725                        }     
    4726                     }
    4727                } 
    4728              dekin += ekin*(1.-xxh);
    4729              ekin *= xxh;
    4730              pv[i].setKineticEnergyAndUpdate( ekin );
    4731              pvCode = pv[i].getCode();
    4732              if ((pvCode == pionPlusCode) || (pvCode == pionMinusCode) || (pvCode == pionZeroCode))
    4733                 {
    4734                   npions += 1;
    4735                   ek1 += ekin;
     4649  // Rotate in the direction of the primary particle momentum (z-axis).
     4650  // This does disturb our inclusive distributions somewhat, but it is
     4651  // necessary for momentum conservation.
     4652
     4653  // Also subtract binding energies and make some further corrections
     4654  // if required.
     4655
     4656  G4double dekin = 0.0;
     4657  G4int npions = 0;   
     4658  G4double ek1 = 0.0;
     4659  G4double alekw, xxh;
     4660  G4double cfa = 0.025*((atomicWeight-1.)/120.)*std::exp(-(atomicWeight-1.)/120.);
     4661  G4double alem[] = {1.40, 2.30, 2.70, 3.00, 3.40, 4.60, 7.00};
     4662  G4double val0[] = {0.00, 0.40, 0.48, 0.51, 0.54, 0.60, 0.65};
     4663
     4664  for (i = 0; i < vecLen; i++) {
     4665    pv[i].Defs1( pv[i], pvI );
     4666    if (atomicWeight > 1.5) {
     4667      ekin  = Amax( 1.e-6,pv[i].getKineticEnergy() - cfa*( 1. + 0.5*normal()));
     4668      alekw = std::log( incidentKineticEnergy );
     4669      xxh = 1.;
     4670      xxh = 1.;
     4671      if (incidentCode == pionPlusCode || incidentCode == pionMinusCode) {
     4672        if (pv[i].getCode() == pionZeroCode) {
     4673          if (G4UniformRand() < std::log(atomicWeight)) {
     4674            if (alekw > alem[0]) {
     4675              G4int jmax = 1;
     4676              for (j = 1; j < 8; j++) {
     4677                if (alekw < alem[j]) {
     4678                  jmax = j;
     4679                  break;
    47364680                }
    4737            }
    4738       }
     4681              }
     4682              xxh = (val0[jmax]-val0[jmax-1])/(alem[jmax]-alem[jmax-1])*alekw
     4683                   + val0[jmax-1] - (val0[jmax]-val0[jmax-1])/(alem[jmax]-alem[jmax-1])*alem[jmax-1];
     4684              xxh = 1. - xxh;
     4685            }
     4686          }     
     4687        }
     4688      } 
     4689      dekin += ekin*(1.-xxh);
     4690      ekin *= xxh;
     4691      pv[i].setKineticEnergyAndUpdate( ekin );
     4692      pvCode = pv[i].getCode();
     4693      if ((pvCode == pionPlusCode) ||
     4694          (pvCode == pionMinusCode) ||
     4695          (pvCode == pionZeroCode)) {
     4696        npions += 1;
     4697        ek1 += ekin;
     4698      }
     4699    }
     4700  }
     4701
    47394702   if( (ek1 > 0.0) && (npions > 0) )
    47404703      {
     
    49414904
    49424905void
    4943 G4HEInelastic::QuasiElasticScattering(G4bool &successful,
    4944                                             G4HEVector pv[],
    4945                                             G4int &vecLen,     
    4946                                             G4double &excitationEnergyGNP,
    4947                                             G4double &excitationEnergyDTA,
    4948                                             G4HEVector incidentParticle,
    4949                                             G4HEVector targetParticle,
    4950                                             G4double atomicWeight,
    4951                                             G4double atomicNumber )
    4952  {   
    4953 // if the Cascading or Resonance - model fails, we try this,
    4954 // QuasiElasticScattering.
    4955 //   
    4956 //  All quantities on the G4HEVector Array pv are in GeV- units.
    4957 
    4958    G4int protonCode       = Proton.getCode();
    4959    G4String mesonType     = PionPlus.getType();
    4960    G4String baryonType    = Proton.getType();
    4961    G4String antiBaryonType= AntiProton.getType();
    4962    
    4963    G4double targetMass   = targetParticle.getMass();
    4964 
    4965    G4double incidentMass          = incidentParticle.getMass();
    4966    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    4967    G4double incidentEnergy        = incidentParticle.getEnergy();
    4968    G4double incidentKineticEnergy = incidentParticle.getKineticEnergy();
    4969    G4String incidentType          = incidentParticle.getType();
     4906G4HEInelastic::QuasiElasticScattering(G4bool& successful,
     4907                                      G4HEVector pv[],
     4908                                      G4int& vecLen,   
     4909                                      G4double& excitationEnergyGNP,
     4910                                      G4double& excitationEnergyDTA,
     4911                                      const G4HEVector& incidentParticle,
     4912                                      const G4HEVector& targetParticle,
     4913                                      G4double atomicWeight,
     4914                                      G4double atomicNumber)
     4915{
     4916  // if the Cascading or Resonance - model fails, we try this,
     4917  // QuasiElasticScattering.
     4918  //   
     4919  //  All quantities on the G4HEVector Array pv are in GeV- units.
     4920
     4921  G4int protonCode = Proton.getCode();
     4922  G4String mesonType = PionPlus.getType();
     4923  G4String baryonType = Proton.getType();
     4924  G4String antiBaryonType = AntiProton.getType();
     4925   
     4926  G4double targetMass = targetParticle.getMass();
     4927  G4double incidentMass = incidentParticle.getMass();
     4928  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     4929  G4double incidentEnergy = incidentParticle.getEnergy();
     4930  G4double incidentKineticEnergy = incidentParticle.getKineticEnergy();
     4931  G4String incidentType = incidentParticle.getType();
    49704932//   G4double incidentTOF           = incidentParticle.getTOF();   
    4971    G4double incidentTOF           = 0.;
    4972    
    4973    // some local variables
    4974 
    4975    G4int i;
    4976    
    4977    if(verboseLevel > 1)
    4978      G4cout << " G4HEInelastic::QuasiElasticScattering " << G4endl;
    4979 
    4980    if (incidentTotalMomentum < 0.01 || vecLen < 2 )
    4981       {
    4982         successful = false;
    4983         return;
    4984       }
    4985    G4double centerOfMassEnergy = std::sqrt( sqr(incidentMass) + sqr(targetMass)
    4986                                        +2.*targetMass*incidentEnergy);
    4987 
    4988    G4HEVector pvI = incidentParticle;  // for the incident particle
    4989    pvI.setSide( 1 );
    4990 
    4991    G4HEVector pvT = targetParticle;   // for the target particle
    4992    pvT.setMomentumAndUpdate( 0.0, 0.0, 0.0 );
    4993    pvT.setSide( -1 );
    4994    pvT.setTOF( -1.);
    4995 
    4996    G4HEVector* pvmx = new G4HEVector[3];
    4997 
    4998    if (atomicWeight > 1.5)   // for the following case better use ElasticScattering.
    4999       {
    5000         if (    (pvI.getCode() == pv[0].getCode() )
    5001              && (pvT.getCode() == pv[1].getCode() )
    5002              && (excitationEnergyGNP < 0.001)
    5003              && (excitationEnergyDTA < 0.001)                            )
    5004            {
    5005              successful = false;
    5006              return;
    5007            }
    5008       }
    5009 
    5010    pv[0].setSide( 1 );
    5011    pv[0].setFlag( false );
    5012    pv[0].setTOF( incidentTOF);
    5013    pv[0].setMomentumAndUpdate( incidentParticle.getMomentum() );
    5014    pv[1].setSide( -1 );
    5015    pv[1].setFlag( false );
    5016    pv[1].setTOF( incidentTOF);
    5017    pv[1].setMomentumAndUpdate(targetParticle.getMomentum() );
    5018 
    5019    if ( (incidentTotalMomentum > 0.1) && (centerOfMassEnergy > 0.01) )
    5020       {
    5021         if ( pv[1].getType() == mesonType )
    5022            {
    5023              if (G4UniformRand() < 0.5)
    5024                  pv[1].setDefinition( "Proton");
    5025              else
    5026                  pv[1].setDefinition( "Neutron");
    5027            }
    5028         pvmx[0].Add( pvI, pvT );
    5029         pvmx[1].Lor( pvI, pvmx[0] );
    5030         pvmx[2].Lor( pvT, pvmx[0] );
    5031         G4double pin = pvmx[1].Length();
    5032         G4double bvalue = Amax(0.01 , 4.225+1.795*std::log(incidentTotalMomentum));
    5033         G4double pf =   sqr( sqr(centerOfMassEnergy) + sqr(pv[1].getMass()) - sqr(pv[0].getMass()))
    5034                       - 4 * sqr(centerOfMassEnergy) * sqr(pv[1].getMass());
    5035         if ( pf < 0.001)
    5036            {
    5037              successful = false;
    5038              return;
    5039            }
    5040         pf = std::sqrt(pf)/(2.*centerOfMassEnergy);
    5041         G4double btrang = 4. * bvalue * pin * pf;
    5042         G4double exindt = -1.;
    5043         if (btrang < 46.) exindt += std::exp(-btrang);
    5044         G4double tdn = std::log(1. + G4UniformRand()*exindt)/btrang;
    5045         G4double ctet = Amax( -1., Amin(1., 1. + 2.*tdn));
    5046         G4double stet = std::sqrt((1.-ctet)*(1.+ctet));
    5047         G4double phi  = twopi * G4UniformRand();
    5048         pv[0].setMomentumAndUpdate( pf*stet*std::sin(phi),
    5049                                     pf*stet*std::cos(phi),
    5050                                     pf*ctet         );
    5051         pv[1].SmulAndUpdate( pv[0], -1.);
    5052        
    5053         for (i = 0; i < 2; i++)
    5054            {
    5055              pv[i].Lor( pv[i], pvmx[4] );
    5056              pv[i].Defs1( pv[i], pvI );
    5057              if (atomicWeight > 1.5)
    5058                {
    5059                  G4double ekin =    pv[i].getKineticEnergy()
    5060                                  -  0.025*((atomicWeight-1.)/120.)*std::exp(-(atomicWeight-1.)/120.)
    5061                                    *(1. + 0.5*normal());
    5062                  ekin = Amax(0.0001, ekin);
    5063                  pv[i].setKineticEnergyAndUpdate( ekin );
    5064                }
    5065            }
    5066       }
    5067    vecLen = 2;
    5068 
    5069    //  add black track particles
    5070    //  the total number of particles produced is restricted to 198
    5071    //  this may have influence on very high energies
    5072 
    5073    if (verboseLevel > 1)
    5074      G4cout << " Evaporation " << atomicWeight << " " <<
    5075                excitationEnergyGNP << " " <<  excitationEnergyDTA << G4endl;
     4933  G4double incidentTOF = 0.;
     4934   
     4935  // some local variables
     4936  G4int i;
     4937   
     4938  if (verboseLevel > 1)
     4939    G4cout << " G4HEInelastic::QuasiElasticScattering " << G4endl;
     4940
     4941  if (incidentTotalMomentum < 0.01 || vecLen < 2) {
     4942    successful = false;
     4943    return;
     4944  }
     4945
     4946  G4double centerOfMassEnergy = std::sqrt( sqr(incidentMass) + sqr(targetMass)
     4947                                        +2.*targetMass*incidentEnergy);
     4948
     4949  G4HEVector pvI = incidentParticle;  // for the incident particle
     4950  pvI.setSide( 1 );
     4951
     4952  G4HEVector pvT = targetParticle;   // for the target particle
     4953  pvT.setMomentumAndUpdate( 0.0, 0.0, 0.0 );
     4954  pvT.setSide( -1 );
     4955  pvT.setTOF( -1.);
     4956
     4957  G4HEVector* pvmx = new G4HEVector[3];
     4958
     4959  if (atomicWeight > 1.5) {
     4960    // for the following case better use ElasticScattering
     4961    if (   (pvI.getCode() == pv[0].getCode() )
     4962        && (pvT.getCode() == pv[1].getCode() )
     4963        && (excitationEnergyGNP < 0.001)
     4964        && (excitationEnergyDTA < 0.001) ) {
     4965      successful = false;
     4966      delete [] pvmx;
     4967      return;
     4968    }
     4969  }
     4970
     4971  pv[0].setSide( 1 );
     4972  pv[0].setFlag( false );
     4973  pv[0].setTOF( incidentTOF);
     4974  pv[0].setMomentumAndUpdate( incidentParticle.getMomentum() );
     4975  pv[1].setSide( -1 );
     4976  pv[1].setFlag( false );
     4977  pv[1].setTOF( incidentTOF);
     4978  pv[1].setMomentumAndUpdate(targetParticle.getMomentum() );
     4979
     4980  if ((incidentTotalMomentum > 0.1) && (centerOfMassEnergy > 0.01) ) {
     4981    if (pv[1].getType() == mesonType) {
     4982      if (G4UniformRand() < 0.5)
     4983        pv[1].setDefinition( "Proton");
     4984      else
     4985        pv[1].setDefinition( "Neutron");
     4986    }
     4987    pvmx[0].Add( pvI, pvT );
     4988    pvmx[1].Lor( pvI, pvmx[0] );
     4989    pvmx[2].Lor( pvT, pvmx[0] );
     4990    G4double pin = pvmx[1].Length();
     4991    G4double bvalue = Amax(0.01 , 4.225+1.795*std::log(incidentTotalMomentum));
     4992    G4double pf = sqr(sqr(centerOfMassEnergy) + sqr(pv[1].getMass()) - sqr(pv[0].getMass()))
     4993                  - 4 * sqr(centerOfMassEnergy) * sqr(pv[1].getMass());
     4994
     4995    if (pf < 0.001) {
     4996      successful = false;
     4997      delete [] pvmx;
     4998      return;
     4999    }
     5000    pf = std::sqrt(pf)/(2.*centerOfMassEnergy);
     5001    G4double btrang = 4. * bvalue * pin * pf;
     5002    G4double exindt = -1.;
     5003    if (btrang < 46.) exindt += std::exp(-btrang);
     5004    G4double tdn = std::log(1. + G4UniformRand()*exindt)/btrang;
     5005    G4double ctet = Amax( -1., Amin(1., 1. + 2.*tdn));
     5006    G4double stet = std::sqrt((1.-ctet)*(1.+ctet));
     5007    G4double phi  = twopi * G4UniformRand();
     5008    pv[0].setMomentumAndUpdate( pf*stet*std::sin(phi),
     5009                                pf*stet*std::cos(phi),
     5010                                pf*ctet         );
     5011    pv[1].SmulAndUpdate( pv[0], -1.);
     5012    for (i = 0; i < 2; i++) {
     5013      // **  pv[i].Lor( pv[i], pvmx[4] );
     5014      // ** DHW 1 Dec 2010 : index 4 out of range : use 0
     5015      pv[i].Lor(pv[i], pvmx[0]);
     5016      pv[i].Defs1(pv[i], pvI);
     5017      if (atomicWeight > 1.5) {
     5018        G4double ekin = pv[i].getKineticEnergy()
     5019                     -  0.025*((atomicWeight-1.)/120.)*std::exp(-(atomicWeight-1.)/120.)
     5020                       *(1. + 0.5*normal());
     5021        ekin = Amax(0.0001, ekin);
     5022        pv[i].setKineticEnergyAndUpdate( ekin );
     5023      }
     5024    }
     5025  }
     5026  vecLen = 2;
     5027
     5028  //  add black track particles
     5029  //  the total number of particles produced is restricted to 198
     5030  //  this may have influence on very high energies
     5031
     5032  if (verboseLevel > 1)
     5033    G4cout << " Evaporation " << atomicWeight << " "
     5034           << excitationEnergyGNP << " " <<  excitationEnergyDTA << G4endl;
    50765035
    50775036   if( atomicWeight > 1.5 )
     
    52305189   }
    52315190
    5232    successful = true;
    5233    delete [] pvmx;
    5234    return;
    5235  }
     5191  successful = true;
     5192  delete [] pvmx;
     5193  return;
     5194}
    52365195
    52375196void
    5238 G4HEInelastic::ElasticScattering(G4bool &successful,
     5197G4HEInelastic::ElasticScattering(G4bool& successful,
    52395198                                 G4HEVector pv[],
    5240                                  G4int &vecLen, 
    5241                                  G4HEVector incidentParticle,
     5199                                 G4int& vecLen, 
     5200                                 const G4HEVector& incidentParticle,
    52425201                                 G4double atomicWeight,
    52435202                                 G4double /* atomicNumber*/)
    5244  {
    5245    if(verboseLevel > 1)
    5246      G4cout << " G4HEInelastic::ElasticScattering " << G4endl;
    5247 
    5248    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    5249    if (verboseLevel > 1)
    5250      G4cout << "DoIt: Incident particle momentum="
    5251             << incidentTotalMomentum << " GeV" << G4endl;
    5252    if (incidentTotalMomentum < 0.01)
    5253       {
    5254         successful = false;
    5255         return;
    5256       }
     5203{
     5204  if (verboseLevel > 1)
     5205    G4cout << " G4HEInelastic::ElasticScattering " << G4endl;
     5206
     5207  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     5208  if (verboseLevel > 1)
     5209    G4cout << "DoIt: Incident particle momentum="
     5210           << incidentTotalMomentum << " GeV" << G4endl;
     5211  if (incidentTotalMomentum < 0.01) {
     5212      successful = false;
     5213      return;
     5214  }
     5215
    52575216   if (atomicWeight < 0.5)
    52585217      {
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEKaonMinusInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HEKaonMinusInelastic.cc,v 1.14 2008/03/17 20:49:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HEKaonMinusInelastic.cc,v 1.16 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff
     35// and the low energy two-body model.  Not included is the low energy stuff
    3936// like nuclear reactions, nuclear fission without any cascading and all
    4037// processes for particles at rest. 
     
    4542#include "G4HEKaonMinusInelastic.hh"
    4643
    47 G4HadFinalState *  G4HEKaonMinusInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double A = targetNucleus.GetN();
    54     const G4double Z = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
     44G4HadFinalState*
     45G4HEKaonMinusInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     46                                      G4Nucleus& targetNucleus)
     47{
     48  G4HEVector* pv = new G4HEVector[MAXPART];
     49  const G4HadProjectile* aParticle = &aTrack;
     50  const G4double A = targetNucleus.GetN();
     51  const G4double Z = targetNucleus.GetZ();
     52  G4HEVector incidentParticle(aParticle);
    5653     
    57     G4double atomicNumber = Z;
    58     G4double atomicWeight = A;
    59 
    60     G4int    incidentCode          = incidentParticle.getCode();
    61     G4double incidentMass          = incidentParticle.getMass();
    62     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    63     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    64     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    65 
    66     if(incidentKineticEnergy < 1.)
    67       {
    68         G4cout << "GHEKaonMinusInelastic: incident energy < 1 GeV" << G4endl;
    69       }
    70     if(verboseLevel > 1)
    71       {
    72         G4cout << "G4HEKaonMinusInelastic::ApplyYourself" << G4endl;
    73         G4cout << "incident particle " << incidentParticle.getName()
    74              << "mass "              << incidentMass
    75              << "kinetic energy "    << incidentKineticEnergy
    76              << G4endl;
    77         G4cout << "target material with (A,Z) = ("
    78              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    79       }
    80 
    81     G4double inelasticity  = NuclearInelasticity(incidentKineticEnergy,
    82                                                  atomicWeight, atomicNumber);
    83     if(verboseLevel > 1)
    84         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    85 
    86     incidentKineticEnergy -= inelasticity;
     54  G4double atomicNumber = Z;
     55  G4double atomicWeight = A;
     56
     57  G4int incidentCode = incidentParticle.getCode();
     58  G4double incidentMass = incidentParticle.getMass();
     59  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     60  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     61  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     62
     63  if (incidentKineticEnergy < 1.)
     64    G4cout << "GHEKaonMinusInelastic: incident energy < 1 GeV" << G4endl;
     65
     66  if (verboseLevel > 1) {
     67    G4cout << "G4HEKaonMinusInelastic::ApplyYourself" << G4endl;
     68    G4cout << "incident particle " << incidentParticle.getName()
     69           << "mass "              << incidentMass
     70           << "kinetic energy "    << incidentKineticEnergy
     71           << G4endl;
     72    G4cout << "target material with (A,Z) = ("
     73           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     74  }
     75
     76  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     77                                            atomicWeight, atomicNumber);
     78  if (verboseLevel > 1)
     79    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     80
     81  incidentKineticEnergy -= inelasticity;
    8782   
    88     G4double excitationEnergyGNP = 0.;
    89     G4double excitationEnergyDTA = 0.;
    90 
    91     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    92                                                atomicWeight, atomicNumber,
    93                                                excitationEnergyGNP,
    94                                                excitationEnergyDTA);
    95     if(verboseLevel > 1)
    96       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     83  G4double excitationEnergyGNP = 0.;
     84  G4double excitationEnergyDTA = 0.;
     85
     86  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     87                                          atomicWeight, atomicNumber,
     88                                          excitationEnergyGNP,
     89                                          excitationEnergyDTA);
     90  if (verboseLevel > 1)
     91    G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    9792           << excitationEnergyDTA << G4endl;             
    9893
    99 
    100     incidentKineticEnergy -= excitation;
    101     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    102     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    103                                   *(incidentTotalEnergy+incidentMass));
    104 
    105 
    106     G4HEVector targetParticle;
    107     if(G4UniformRand() < atomicNumber/atomicWeight)
    108       {
    109         targetParticle.setDefinition("Proton");
    110       }
    111     else
    112       {
    113         targetParticle.setDefinition("Neutron");
    114       }
    115 
    116     G4double targetMass         = targetParticle.getMass();
    117     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    118                                        + 2.0*targetMass*incidentTotalEnergy);
    119     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    120 
    121                                                                 // this was the meaning of inElastic in the
    122                                                                 // original Gheisha stand-alone version.
    123 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    124 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    125                                                                 // by unknown reasons, it has been replaced
    126                                                                 // to the following code in Geant???
    127     G4bool inElastic = true;
    128 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    129 
    130 
    131     vecLength  = 0;           
    132        
    133     if(verboseLevel > 1)
    134       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     94  incidentKineticEnergy -= excitation;
     95  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     96  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)                   
     97                                    *(incidentTotalEnergy+incidentMass));
     98
     99  G4HEVector targetParticle;
     100  if (G4UniformRand() < atomicNumber/atomicWeight) {
     101    targetParticle.setDefinition("Proton");
     102  } else {
     103    targetParticle.setDefinition("Neutron");
     104  }
     105
     106  G4double targetMass = targetParticle.getMass();
     107  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     108                                        + targetMass*targetMass
     109                                        + 2.0*targetMass*incidentTotalEnergy);
     110  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     111
     112  G4bool inElastic = true;
     113
     114  vecLength = 0;
     115
     116  if (verboseLevel > 1)
     117    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    135118           << incidentCode << G4endl;
    136119
    137     G4bool successful = false;
     120  G4bool successful = false;
    138121   
    139     if(inElastic || (!inElastic && atomicWeight < 1.5))
    140       {
    141         FirstIntInCasKaonMinus(inElastic, availableEnergy, pv, vecLength,
    142                                incidentParticle, targetParticle);
    143 
    144         if(verboseLevel > 1)
    145            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    146 
    147 
    148         if ((vecLength > 0) && (availableEnergy > 1.))
    149                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    150                                                   pv, vecLength,
    151                                                   incidentParticle, targetParticle);
    152             HighEnergyCascading( successful, pv, vecLength,
    153                                  excitationEnergyGNP, excitationEnergyDTA,
    154                                  incidentParticle, targetParticle,
    155                                  atomicWeight, atomicNumber);
    156         if (!successful)
    157             HighEnergyClusterProduction( successful, pv, vecLength,
    158                                          excitationEnergyGNP, excitationEnergyDTA,
    159                                          incidentParticle, targetParticle,
    160                                          atomicWeight, atomicNumber);
    161         if (!successful)
    162             MediumEnergyCascading( successful, pv, vecLength,
    163                                    excitationEnergyGNP, excitationEnergyDTA,
    164                                    incidentParticle, targetParticle,
    165                                    atomicWeight, atomicNumber);
    166 
    167         if (!successful)
    168             MediumEnergyClusterProduction( successful, pv, vecLength,
    169                                            excitationEnergyGNP, excitationEnergyDTA,       
    170                                            incidentParticle, targetParticle,
    171                                            atomicWeight, atomicNumber);
    172         if (!successful)
    173             QuasiElasticScattering( successful, pv, vecLength,
    174                                     excitationEnergyGNP, excitationEnergyDTA,
    175                                     incidentParticle, targetParticle,
    176                                     atomicWeight, atomicNumber);
    177       }
    178     if (!successful)
    179       {
    180             ElasticScattering( successful, pv, vecLength,
    181                                incidentParticle,   
    182                                atomicWeight, atomicNumber);
    183       }
    184 
    185     if (!successful)
    186       {
    187         G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles" << G4endl;
    188       }
    189       FillParticleChange(pv,  vecLength);
    190       delete [] pv;
    191       theParticleChange.SetStatusChange(stopAndKill);
    192       return & theParticleChange;
    193   }
     122  FirstIntInCasKaonMinus(inElastic, availableEnergy, pv, vecLength,
     123                         incidentParticle, targetParticle);
     124
     125  if (verboseLevel > 1)
     126    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl;
     127
     128  if ((vecLength > 0) && (availableEnergy > 1.))
     129    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     130                                  pv, vecLength,
     131                                  incidentParticle, targetParticle);
     132
     133  HighEnergyCascading(successful, pv, vecLength,
     134                      excitationEnergyGNP, excitationEnergyDTA,
     135                      incidentParticle, targetParticle,
     136                      atomicWeight, atomicNumber);
     137  if (!successful)
     138    HighEnergyClusterProduction(successful, pv, vecLength,
     139                                excitationEnergyGNP, excitationEnergyDTA,
     140                                incidentParticle, targetParticle,
     141                                atomicWeight, atomicNumber);
     142  if (!successful)
     143    MediumEnergyCascading(successful, pv, vecLength,
     144                          excitationEnergyGNP, excitationEnergyDTA,
     145                          incidentParticle, targetParticle,
     146                          atomicWeight, atomicNumber);
     147
     148  if (!successful)
     149    MediumEnergyClusterProduction(successful, pv, vecLength,
     150                                  excitationEnergyGNP, excitationEnergyDTA,       
     151                                  incidentParticle, targetParticle,
     152                                  atomicWeight, atomicNumber);
     153  if (!successful)
     154    QuasiElasticScattering(successful, pv, vecLength,
     155                           excitationEnergyGNP, excitationEnergyDTA,
     156                           incidentParticle, targetParticle,
     157                           atomicWeight, atomicNumber);
     158  if (!successful)
     159    ElasticScattering(successful, pv, vecLength,
     160                      incidentParticle,   
     161                      atomicWeight, atomicNumber);
     162  if (!successful)
     163    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     164           << G4endl;
     165
     166  FillParticleChange(pv,  vecLength);
     167  delete [] pv;
     168  theParticleChange.SetStatusChange(stopAndKill);
     169  return &theParticleChange;
     170}
     171
    194172
    195173void
    196   G4HEKaonMinusInelastic::FirstIntInCasKaonMinus( G4bool &inElastic,
    197                                                   const G4double availableEnergy,
    198                                                   G4HEVector pv[],
    199                                                   G4int &vecLen,
    200                                                   G4HEVector incidentParticle,
    201                                                   G4HEVector targetParticle)
     174G4HEKaonMinusInelastic::FirstIntInCasKaonMinus(G4bool& inElastic,
     175                                               const G4double availableEnergy,
     176                                               G4HEVector pv[],
     177                                               G4int& vecLen,
     178                                               const G4HEVector& incidentParticle,
     179                                               const G4HEVector& targetParticle)
    202180
    203181// Kaon- undergoes interaction with nucleon within a nucleus.  Check if it is
     
    208186// protons/neutrons by kaons or strange baryons according to the average
    209187// multiplicity per inelastic reaction.
    210 
    211  {
    212    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    213    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    214 
    215    static const G4double protb = 0.7;
    216    static const G4double neutb = 0.7;
    217    static const G4double     c = 1.25;
    218 
    219    static const G4int   numMul = 1200;
    220    static const G4int   numSec = 60;
    221 
    222    G4int              neutronCode = Neutron.getCode();
    223    G4int               protonCode = Proton.getCode();
    224    G4int            kaonMinusCode = KaonMinus.getCode();
    225    G4int             kaonZeroCode = KaonZero.getCode();
    226    G4int         antiKaonZeroCode = AntiKaonZero.getCode(); 
    227 
    228    G4int               targetCode = targetParticle.getCode();
    229 //   G4double          incidentMass = incidentParticle.getMass();
    230 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    231    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    232 
    233    static G4bool first = true;
    234    static G4double protmul[numMul], protnorm[numSec];  // proton constants
    235    static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
    236 
    237 //                                misc. local variables
    238 //                                np = number of pi+,  nm = number of pi-,  nz = number of pi0
    239 
    240    G4int i, counter, nt, np, nm, nz;
     188{
     189  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     190  static const G4double expxl = -expxu;         // lower bound for arg. of exp
     191
     192  static const G4double protb = 0.7;
     193  static const G4double neutb = 0.7;
     194  static const G4double     c = 1.25;
     195
     196  static const G4int numMul = 1200;
     197  static const G4int numSec = 60;
     198
     199  G4int neutronCode = Neutron.getCode();
     200  G4int protonCode = Proton.getCode();
     201  G4int kaonMinusCode = KaonMinus.getCode();
     202  G4int kaonZeroCode = KaonZero.getCode();
     203  G4int antiKaonZeroCode = AntiKaonZero.getCode(); 
     204
     205  G4int targetCode = targetParticle.getCode();
     206  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     207
     208  static G4bool first = true;
     209  static G4double protmul[numMul], protnorm[numSec];  // proton constants
     210  static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
     211
     212  // misc. local variables
     213  // np = number of pi+,  nm = number of pi-,  nz = number of pi0
     214
     215  G4int i, counter, nt, np, nm, nz;
    241216
    242217   if( first )
    243      {                         // compute normalization constants, this will only be done once
     218     {       // compute normalization constants, this will only be done once
    244219       first = false;
    245220       for( i=0; i<numMul; i++ )protmul[i]  = 0.0;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEKaonPlusInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HEKaonPlusInelastic.cc,v 1.14 2008/03/17 20:49:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HEKaonPlusInelastic.cc,v 1.16 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     35// and the low energy two-body model. Not included are the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest. 
    4138// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4239// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4542#include "G4HEKaonPlusInelastic.hh"
    4643
    47 G4HadFinalState *  G4HEKaonPlusInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double A = targetNucleus.GetN();
    54     const G4double Z = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
     44G4HadFinalState*
     45G4HEKaonPlusInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     46                                     G4Nucleus& targetNucleus)
     47{
     48  G4HEVector* pv = new G4HEVector[MAXPART];
     49  const G4HadProjectile* aParticle = &aTrack;
     50  const G4double A = targetNucleus.GetN();
     51  const G4double Z = targetNucleus.GetZ();
     52  G4HEVector incidentParticle(aParticle);
    5653     
    57     G4double atomicNumber = Z;
    58     G4double atomicWeight = A;
    59 
    60     G4int    incidentCode          = incidentParticle.getCode();
    61     G4double incidentMass          = incidentParticle.getMass();
    62     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    63     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    64     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    65 
    66     if(incidentKineticEnergy < 1.)
    67       {
    68         G4cout << "GHEKaonPlusInelastic: incident energy < 1 GeV" << G4endl;
    69       }
    70     if(verboseLevel > 1)
    71       {
    72         G4cout << "G4HEKaonPlusInelastic::ApplyYourself" << G4endl;
    73         G4cout << "incident particle " << incidentParticle.getName()
    74              << "mass "              << incidentMass
    75              << "kinetic energy "    << incidentKineticEnergy
    76              << G4endl;
    77         G4cout << "target material with (A,Z) = ("
    78              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    79       }
    80 
    81     G4double inelasticity  = NuclearInelasticity(incidentKineticEnergy,
    82                                                  atomicWeight, atomicNumber);
    83     if(verboseLevel > 1)
    84         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     54  G4double atomicNumber = Z;
     55  G4double atomicWeight = A;
     56
     57  G4int incidentCode = incidentParticle.getCode();
     58  G4double incidentMass = incidentParticle.getMass();
     59  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     60  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     61  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     62
     63  if (incidentKineticEnergy < 1.)
     64    G4cout << "GHEKaonPlusInelastic: incident energy < 1 GeV" << G4endl;
     65
     66  if (verboseLevel > 1) {
     67    G4cout << "G4HEKaonPlusInelastic::ApplyYourself" << G4endl;
     68    G4cout << "incident particle " << incidentParticle.getName()
     69           << "mass "              << incidentMass
     70           << "kinetic energy "    << incidentKineticEnergy
     71           << G4endl;
     72    G4cout << "target material with (A,Z) = ("
     73           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     74  }
     75
     76  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     77                                              atomicWeight, atomicNumber);
     78  if (verboseLevel > 1)
     79    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    8580   
    86     incidentKineticEnergy -= inelasticity;
     81  incidentKineticEnergy -= inelasticity;
    8782   
    88     G4double excitationEnergyGNP = 0.;
    89     G4double excitationEnergyDTA = 0.;
    90 
    91     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    92                                                atomicWeight, atomicNumber,
    93                                                excitationEnergyGNP,
    94                                                excitationEnergyDTA);
    95     if(verboseLevel > 1)
    96       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     83  G4double excitationEnergyGNP = 0.;
     84  G4double excitationEnergyDTA = 0.;
     85
     86  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     87                                          atomicWeight, atomicNumber,
     88                                          excitationEnergyGNP,
     89                                          excitationEnergyDTA);
     90  if (verboseLevel > 1)
     91    G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    9792           << excitationEnergyDTA << G4endl;             
    9893
    99 
    100     incidentKineticEnergy -= excitation;
    101     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    102     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    103                                   *(incidentTotalEnergy+incidentMass));
    104 
    105 
    106     G4HEVector targetParticle;
    107 
    108     if(G4UniformRand() < atomicNumber/atomicWeight)
    109       {
    110         targetParticle.setDefinition("Proton");
    111       }
    112     else
    113       {
    114         targetParticle.setDefinition("Neutron");
    115       }
    116 
    117     G4double targetMass         = targetParticle.getMass();
    118     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    119                                        + 2.0*targetMass*incidentTotalEnergy);
    120     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    121 
    122                                                                 // this was the meaning of inElastic in the
    123                                                                 // original Gheisha stand-alone version.
    124 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    125 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    126                                                                 // by unknown reasons, it has been replaced
    127                                                                 // to the following code in Geant???
    128     G4bool inElastic = true;
    129 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    130 
    131     vecLength  = 0;           
     94  incidentKineticEnergy -= excitation;
     95  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     96  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)
     97                                    *(incidentTotalEnergy+incidentMass));
     98
     99  G4HEVector targetParticle;
     100
     101  if (G4UniformRand() < atomicNumber/atomicWeight) {
     102    targetParticle.setDefinition("Proton");
     103  } else {
     104    targetParticle.setDefinition("Neutron");
     105  }
     106
     107  G4double targetMass = targetParticle.getMass();
     108  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     109                                        + targetMass*targetMass
     110                                        + 2.0*targetMass*incidentTotalEnergy);
     111  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     112
     113  G4bool inElastic = true;
     114  vecLength = 0;
    132115       
    133     if(verboseLevel > 1)
    134       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     116  if (verboseLevel > 1)
     117    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    135118           << incidentCode << G4endl;
    136119
    137     G4bool successful = false;
     120  G4bool successful = false;
    138121   
    139     if(inElastic || (!inElastic && atomicWeight < 1.5))
    140       {
    141         FirstIntInCasKaonPlus(inElastic, availableEnergy, pv, vecLength,
    142                               incidentParticle, targetParticle, atomicWeight);
    143 
    144         if(verboseLevel > 1)
    145            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    146 
    147 
    148 
    149         if ((vecLength > 0) && (availableEnergy > 1.))
    150                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    151                                                   pv, vecLength,
    152                                                   incidentParticle, targetParticle);
    153             HighEnergyCascading( successful, pv, vecLength,
    154                                  excitationEnergyGNP, excitationEnergyDTA,
    155                                  incidentParticle, targetParticle,
    156                                  atomicWeight, atomicNumber);
    157         if (!successful)
    158             HighEnergyClusterProduction( successful, pv, vecLength,
    159                                          excitationEnergyGNP, excitationEnergyDTA,
    160                                          incidentParticle, targetParticle,
    161                                          atomicWeight, atomicNumber);
    162         if (!successful)
    163             MediumEnergyCascading( successful, pv, vecLength,
    164                                    excitationEnergyGNP, excitationEnergyDTA,
    165                                    incidentParticle, targetParticle,
    166                                    atomicWeight, atomicNumber);
    167 
    168         if (!successful)
    169             MediumEnergyClusterProduction( successful, pv, vecLength,
    170                                            excitationEnergyGNP, excitationEnergyDTA,       
    171                                            incidentParticle, targetParticle,
    172                                            atomicWeight, atomicNumber);
    173         if (!successful)
    174             QuasiElasticScattering( successful, pv, vecLength,
    175                                     excitationEnergyGNP, excitationEnergyDTA,
    176                                     incidentParticle, targetParticle,
    177                                     atomicWeight, atomicNumber);
    178       }
    179     if (!successful)
    180       {
    181             ElasticScattering( successful, pv, vecLength,
    182                                incidentParticle,   
    183                                atomicWeight, atomicNumber);
    184       }
    185 
    186     if (!successful)
    187       {
    188         G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles" << G4endl;
    189       }
    190       FillParticleChange(pv,  vecLength);
    191       delete [] pv;
    192       theParticleChange.SetStatusChange(stopAndKill);
    193       return & theParticleChange;
    194   }
     122  FirstIntInCasKaonPlus(inElastic, availableEnergy, pv, vecLength,
     123                        incidentParticle, targetParticle, atomicWeight);
     124
     125  if (verboseLevel > 1)
     126    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl;
     127
     128  if ((vecLength > 0) && (availableEnergy > 1.))
     129    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     130                                  pv, vecLength,
     131                                  incidentParticle, targetParticle);
     132
     133  HighEnergyCascading(successful, pv, vecLength,
     134                      excitationEnergyGNP, excitationEnergyDTA,
     135                      incidentParticle, targetParticle,
     136                      atomicWeight, atomicNumber);
     137  if (!successful)
     138    HighEnergyClusterProduction(successful, pv, vecLength,
     139                                excitationEnergyGNP, excitationEnergyDTA,
     140                                incidentParticle, targetParticle,
     141                                atomicWeight, atomicNumber);
     142  if (!successful)
     143    MediumEnergyCascading(successful, pv, vecLength,
     144                          excitationEnergyGNP, excitationEnergyDTA,
     145                          incidentParticle, targetParticle,
     146                          atomicWeight, atomicNumber);
     147
     148  if (!successful)
     149    MediumEnergyClusterProduction(successful, pv, vecLength,
     150                                  excitationEnergyGNP, excitationEnergyDTA,       
     151                                  incidentParticle, targetParticle,
     152                                  atomicWeight, atomicNumber);
     153  if (!successful)
     154    QuasiElasticScattering(successful, pv, vecLength,
     155                           excitationEnergyGNP, excitationEnergyDTA,
     156                           incidentParticle, targetParticle,
     157                           atomicWeight, atomicNumber);
     158  if (!successful)
     159    ElasticScattering(successful, pv, vecLength,
     160                      incidentParticle,   
     161                      atomicWeight, atomicNumber);
     162
     163  if (!successful)
     164    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     165           << G4endl;
     166
     167  FillParticleChange(pv,  vecLength);
     168  delete [] pv;
     169  theParticleChange.SetStatusChange(stopAndKill);
     170  return &theParticleChange;
     171}
     172
    195173
    196174void
    197 G4HEKaonPlusInelastic::FirstIntInCasKaonPlus( G4bool &inElastic,
    198                                               const G4double availableEnergy,
    199                                               G4HEVector pv[],
    200                                               G4int &vecLen,
    201                                               G4HEVector incidentParticle,
    202                                               G4HEVector targetParticle,
    203                                               const G4double atomicWeight)
     175G4HEKaonPlusInelastic::FirstIntInCasKaonPlus(G4bool& inElastic,
     176                                             const G4double availableEnergy,
     177                                             G4HEVector pv[],
     178                                             G4int& vecLen,
     179                                             const G4HEVector& incidentParticle,
     180                                             const G4HEVector& targetParticle,
     181                                             const G4double atomicWeight)
    204182
    205183// Kaon+ undergoes interaction with nucleon within a nucleus.  Check if it is
     
    210188// protons/neutrons by kaons or strange baryons according to the average
    211189// multiplicity per inelastic reaction.
    212 
    213  {
    214    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    215    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    216 
    217    static const G4double protb = 0.7;
    218    static const G4double neutb = 0.7;
    219    static const G4double     c = 1.25;
    220 
    221    static const G4int   numMul = 1200;
    222    static const G4int   numSec = 60;
    223 
    224    G4int              neutronCode = Neutron.getCode();
    225    G4int              protonCode  = Proton.getCode();
    226 
    227    G4int               targetCode = targetParticle.getCode();
    228 //   G4double          incidentMass = incidentParticle.getMass();
    229 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    230    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    231 
    232    static G4bool first = true;
    233    static G4double protmul[numMul], protnorm[numSec];  // proton constants
    234    static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
    235 
    236 //                                misc. local variables
    237 //                                np = number of pi+,  nm = number of pi-,  nz = number of pi0
    238 
    239    G4int i, counter, nt, np, nm, nz;
     190{
     191  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     192  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     193
     194  static const G4double protb = 0.7;
     195  static const G4double neutb = 0.7;
     196  static const G4double     c = 1.25;
     197
     198  static const G4int   numMul = 1200;
     199  static const G4int   numSec = 60;
     200
     201  G4int neutronCode = Neutron.getCode();
     202  G4int protonCode = Proton.getCode();
     203
     204  G4int targetCode = targetParticle.getCode();
     205  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     206
     207  static G4bool first = true;
     208  static G4double protmul[numMul], protnorm[numSec];  // proton constants
     209  static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
     210
     211  // misc. local variables
     212  // np = number of pi+,  nm = number of pi-,  nz = number of pi0
     213
     214  G4int i, counter, nt, np, nm, nz;
    240215
    241216   if( first )
    242      {                         // compute normalization constants, this will only be done once
     217     {         // compute normalization constants, this will only be done once
    243218       first = false;
    244219       for( i=0; i<numMul; i++ )protmul[i]  = 0.0;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEKaonZeroInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HEKaonZeroInelastic.cc,v 1.16 2010/02/09 22:02:20 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HEKaonZeroInelastic.cc,v 1.18 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     35// and the low energy two-body model. Not included are the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest. 
    4138// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4239// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4542#include "G4HEKaonZeroInelastic.hh"
    4643
    47 G4HadFinalState *  G4HEKaonZeroInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double A = targetNucleus.GetN();
    54     const G4double Z = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
     44G4HadFinalState*
     45G4HEKaonZeroInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     46                                     G4Nucleus& targetNucleus)
     47{
     48  G4HEVector* pv = new G4HEVector[MAXPART];
     49  const G4HadProjectile* aParticle = &aTrack;
     50  const G4double A = targetNucleus.GetN();
     51  const G4double Z = targetNucleus.GetZ();
     52  G4HEVector incidentParticle(aParticle);
    5653     
    57     G4double atomicNumber = Z;
    58     G4double atomicWeight = A;
    59 
    60     G4int    incidentCode          = incidentParticle.getCode();
    61     G4double incidentMass          = incidentParticle.getMass();
    62     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    63     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    64     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    65 
    66     if(incidentKineticEnergy < 1.)
    67       {
    68         G4cout << "GHEKaonZeroInelastic: incident energy < 1 GeV" << G4endl;;
    69       }
    70     if(verboseLevel > 1)
    71       {
    72         G4cout << "G4HEKaonZeroInelastic::ApplyYourself" << G4endl;
    73         G4cout << "incident particle " << incidentParticle.getName()
    74              << "mass "              << incidentMass
    75              << "kinetic energy "    << incidentKineticEnergy
    76              << G4endl;
    77         G4cout << "target material with (A,Z) = ("
    78              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    79       }
     54  G4double atomicNumber = Z;
     55  G4double atomicWeight = A;
     56
     57  G4int incidentCode = incidentParticle.getCode();
     58  G4double incidentMass = incidentParticle.getMass();
     59  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     60  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     61  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     62
     63  if (incidentKineticEnergy < 1.)
     64    G4cout << "GHEKaonZeroInelastic: incident energy < 1 GeV" << G4endl;;
     65
     66  if (verboseLevel > 1) {
     67    G4cout << "G4HEKaonZeroInelastic::ApplyYourself" << G4endl;
     68    G4cout << "incident particle " << incidentParticle.getName()
     69           << "mass "              << incidentMass
     70           << "kinetic energy "    << incidentKineticEnergy
     71           << G4endl;
     72    G4cout << "target material with (A,Z) = ("
     73           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     74  }
    8075   
    81     G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
    82                                                  atomicWeight, atomicNumber);
    83     if(verboseLevel > 1)
    84         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     76  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     77                                              atomicWeight, atomicNumber);
     78  if (verboseLevel > 1)
     79    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    8580   
    86     incidentKineticEnergy -= inelasticity;
     81  incidentKineticEnergy -= inelasticity;
    8782   
    88     G4double excitationEnergyGNP = 0.;
    89     G4double excitationEnergyDTA = 0.;
    90 
    91     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    92                                                atomicWeight, atomicNumber,
    93                                                excitationEnergyGNP,
    94                                                excitationEnergyDTA);
    95     if(verboseLevel > 1)
    96       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     83  G4double excitationEnergyGNP = 0.;
     84  G4double excitationEnergyDTA = 0.;
     85
     86  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     87                                          atomicWeight, atomicNumber,
     88                                          excitationEnergyGNP,
     89                                          excitationEnergyDTA);
     90  if (verboseLevel > 1)
     91    G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    9792           << excitationEnergyDTA << G4endl;             
    9893
    99 
    100     incidentKineticEnergy -= excitation;
    101     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    102     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    103                                   *(incidentTotalEnergy+incidentMass));
    104 
    105 
    106     G4HEVector targetParticle;
    107     if(G4UniformRand() < atomicNumber/atomicWeight)
    108       {
    109         targetParticle.setDefinition("Proton");
    110       }
    111     else
    112       {
    113         targetParticle.setDefinition("Neutron");
    114       }
    115 
    116     G4double targetMass         = targetParticle.getMass();
    117     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    118                                        + 2.0*targetMass*incidentTotalEnergy);
    119     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    120 
    121                                                                 // this was the meaning of inElastic in the
    122                                                                 // original Gheisha stand-alone version.
    123 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    124 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    125                                                                 // by unknown reasons, it has been replaced
    126                                                                 // to the following code in Geant???
    127     G4bool inElastic = true;
    128 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    129 
    130     vecLength = 0;           
    131        
    132     if(verboseLevel > 1)
    133       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     94  incidentKineticEnergy -= excitation;
     95  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     96  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)
     97                                    *(incidentTotalEnergy+incidentMass));
     98
     99  G4HEVector targetParticle;
     100  if (G4UniformRand() < atomicNumber/atomicWeight) {
     101    targetParticle.setDefinition("Proton");
     102  } else {
     103    targetParticle.setDefinition("Neutron");
     104  }
     105
     106  G4double targetMass = targetParticle.getMass();
     107  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     108                                        + targetMass*targetMass
     109                                        + 2.0*targetMass*incidentTotalEnergy);
     110  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     111
     112  G4bool inElastic = true;
     113  vecLength = 0;
     114
     115  if (verboseLevel > 1)
     116    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    134117           << incidentCode << G4endl;
    135118
    136     G4bool successful = false;
     119  G4bool successful = false;
    137120   
    138     if(inElastic || (!inElastic && atomicWeight < 1.5))
    139       {
    140         FirstIntInCasKaonZero(inElastic, availableEnergy, pv, vecLength,
    141                               incidentParticle, targetParticle, atomicWeight);
    142 
    143         if(verboseLevel > 1)
    144            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    145 
    146 
    147         if ((vecLength > 0) && (availableEnergy > 1.))
    148                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    149                                                   pv, vecLength,
    150                                                   incidentParticle, targetParticle);
    151             HighEnergyCascading( successful, pv, vecLength,
    152                                  excitationEnergyGNP, excitationEnergyDTA,
    153                                  incidentParticle, targetParticle,
    154                                  atomicWeight, atomicNumber);
    155         if (!successful)
    156             HighEnergyClusterProduction( successful, pv, vecLength,
    157                                          excitationEnergyGNP, excitationEnergyDTA,
    158                                          incidentParticle, targetParticle,
    159                                          atomicWeight, atomicNumber);
    160         if (!successful)
    161             MediumEnergyCascading( successful, pv, vecLength,
    162                                    excitationEnergyGNP, excitationEnergyDTA,
    163                                    incidentParticle, targetParticle,
    164                                    atomicWeight, atomicNumber);
    165 
    166         if (!successful)
    167             MediumEnergyClusterProduction( successful, pv, vecLength,
    168                                            excitationEnergyGNP, excitationEnergyDTA,       
    169                                            incidentParticle, targetParticle,
    170                                            atomicWeight, atomicNumber);
    171         if (!successful)
    172             QuasiElasticScattering( successful, pv, vecLength,
    173                                     excitationEnergyGNP, excitationEnergyDTA,
    174                                     incidentParticle, targetParticle,
    175                                     atomicWeight, atomicNumber);
    176       }
    177     if (!successful)
    178       {
    179             ElasticScattering( successful, pv, vecLength,
    180                                incidentParticle,   
    181                                atomicWeight, atomicNumber);
    182       }
    183 
    184     if (!successful)
    185         G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
    186                << G4endl;
    187 
    188     FillParticleChange(pv,  vecLength);
    189 
    190     delete [] pv;
    191     theParticleChange.SetStatusChange(stopAndKill);
    192     return & theParticleChange;
    193   }
     121  FirstIntInCasKaonZero(inElastic, availableEnergy, pv, vecLength,
     122                        incidentParticle, targetParticle, atomicWeight);
     123
     124  if (verboseLevel > 1)
     125    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl;
     126
     127  if ((vecLength > 0) && (availableEnergy > 1.))
     128    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     129                                  pv, vecLength,
     130                                  incidentParticle, targetParticle);
     131
     132  HighEnergyCascading(successful, pv, vecLength,
     133                      excitationEnergyGNP, excitationEnergyDTA,
     134                      incidentParticle, targetParticle,
     135                      atomicWeight, atomicNumber);
     136  if (!successful)
     137    HighEnergyClusterProduction(successful, pv, vecLength,
     138                                excitationEnergyGNP, excitationEnergyDTA,
     139                                incidentParticle, targetParticle,
     140                                atomicWeight, atomicNumber);
     141  if (!successful)
     142    MediumEnergyCascading(successful, pv, vecLength,
     143                          excitationEnergyGNP, excitationEnergyDTA,
     144                          incidentParticle, targetParticle,
     145                          atomicWeight, atomicNumber);
     146
     147  if (!successful)
     148    MediumEnergyClusterProduction(successful, pv, vecLength,
     149                                  excitationEnergyGNP, excitationEnergyDTA,       
     150                                  incidentParticle, targetParticle,
     151                                  atomicWeight, atomicNumber);
     152  if (!successful)
     153    QuasiElasticScattering(successful, pv, vecLength,
     154                           excitationEnergyGNP, excitationEnergyDTA,
     155                           incidentParticle, targetParticle,
     156                           atomicWeight, atomicNumber);
     157  if (!successful)
     158    ElasticScattering(successful, pv, vecLength,
     159                      incidentParticle,   
     160                      atomicWeight, atomicNumber);
     161
     162  if (!successful)
     163    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     164           << G4endl;
     165
     166  FillParticleChange(pv,  vecLength);
     167
     168  delete [] pv;
     169  theParticleChange.SetStatusChange(stopAndKill);
     170  return &theParticleChange;
     171}
     172
    194173
    195174void
    196 G4HEKaonZeroInelastic::FirstIntInCasKaonZero( G4bool &inElastic,
    197                                               const G4double availableEnergy,
    198                                               G4HEVector pv[],
    199                                               G4int &vecLen,
    200                                               G4HEVector incidentParticle,
    201                                               G4HEVector targetParticle,
    202                                               const G4double atomicWeight)
     175G4HEKaonZeroInelastic::FirstIntInCasKaonZero(G4bool& inElastic,
     176                                             const G4double availableEnergy,
     177                                             G4HEVector pv[],
     178                                             G4int& vecLen,
     179                                             const G4HEVector& incidentParticle,
     180                                             const G4HEVector& targetParticle,
     181                                             const G4double atomicWeight)
    203182
    204183// Kaon0 undergoes interaction with nucleon within a nucleus.  Check if it is
     
    209188// protons/neutrons by kaons or strange baryons according to the average
    210189// multiplicity per inelastic reaction.
    211 
    212  {
    213    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    214    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    215 
    216    static const G4double protb = 0.7;
    217    static const G4double neutb = 0.7;
    218    static const G4double     c = 1.25;
    219 
    220    static const G4int   numMul = 1200;
    221    static const G4int   numSec = 60;
    222 
    223    G4int              neutronCode = Neutron.getCode();
    224    G4int              protonCode  = Proton.getCode();
    225 
    226    G4int               targetCode = targetParticle.getCode();
    227 //   G4double          incidentMass = incidentParticle.getMass();
    228 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    229    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    230 
    231    static G4bool first = true;
    232    static G4double protmul[numMul], protnorm[numSec];  // proton constants
    233    static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
    234 
    235 //                                misc. local variables
    236 //                                np = number of pi+,  nm = number of pi-,  nz = number of pi0
    237 
    238    G4int i, counter, nt, np, nm, nz;
     190{
     191  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     192  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     193
     194  static const G4double protb = 0.7;
     195  static const G4double neutb = 0.7;
     196  static const G4double     c = 1.25;
     197
     198  static const G4int numMul = 1200;
     199  static const G4int numSec = 60;
     200
     201  G4int neutronCode = Neutron.getCode();
     202  G4int protonCode  = Proton.getCode();
     203
     204  G4int targetCode = targetParticle.getCode();
     205  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     206
     207  static G4bool first = true;
     208  static G4double protmul[numMul], protnorm[numSec];  // proton constants
     209  static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
     210
     211  // misc. local variables
     212  // np = number of pi+,  nm = number of pi-,  nz = number of pi0
     213
     214  G4int i, counter, nt, np, nm, nz;
    239215
    240216   if( first )
    241      {                         // compute normalization constants, this will only be done once
     217     {     // compute normalization constants, this will only be done once
    242218       first = false;
    243219       for( i=0; i<numMul; i++ )protmul[i]  = 0.0;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEKaonZeroLongInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4HEKaonZeroLongInelastic.cc,v 1.11 2010/02/09 21:59:10 dennis Exp $
    27 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    28 //
     26// $Id: G4HEKaonZeroLongInelastic.cc,v 1.13 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2928//
    3029
     
    3231#include "G4ios.hh"
    3332
    34 //
    3533// G4 Process: Gheisha High Energy Collision model.
    3634// This includes the high energy cascading model, the two-body-resonance model
    37 // and the low energy two-body model. Not included are the low energy stuff like
    38 // nuclear reactions, nuclear fission without any cascading and all processes for
    39 // particles at rest.
     35// and the low energy two-body model. Not included are the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest.
    4038// 
    4139// New version by D.H. Wright (SLAC) to fix seg fault in old version
     
    4543#include "G4HEKaonZeroLongInelastic.hh"
    4644
    47 G4HadFinalState* G4HEKaonZeroLongInelastic::
    48 ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus)
     45G4HadFinalState*
     46G4HEKaonZeroLongInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     47                                         G4Nucleus& targetNucleus)
    4948{
    50   G4HEVector * pv = new G4HEVector[MAXPART];
    51   const G4HadProjectile *aParticle = &aTrack;
     49  G4HEVector* pv = new G4HEVector[MAXPART];
     50  const G4HadProjectile* aParticle = &aTrack;
    5251  const G4double atomicWeight = targetNucleus.GetN();
    5352  const G4double atomicNumber = targetNucleus.GetZ();
    5453  G4HEVector incidentParticle(aParticle);
    5554
    56   G4int    incidentCode          = incidentParticle.getCode();
    57   G4double incidentMass          = incidentParticle.getMass();
    58   G4double incidentTotalEnergy   = incidentParticle.getEnergy();
     55  G4int incidentCode = incidentParticle.getCode();
     56  G4double incidentMass = incidentParticle.getMass();
     57  G4double incidentTotalEnergy = incidentParticle.getEnergy();
    5958  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    6059  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     
    9392  incidentKineticEnergy -= excitation;
    9493  incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    95   incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    96                                   *(incidentTotalEnergy+incidentMass));
    97 
     94  incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)
     95                                     *(incidentTotalEnergy+incidentMass));
    9896
    9997  G4HEVector targetParticle;
    100   if(G4UniformRand() < atomicNumber/atomicWeight) {
     98  if (G4UniformRand() < atomicNumber/atomicWeight) {
    10199    targetParticle.setDefinition("Proton");
    102100  } else {
     
    105103
    106104  G4double targetMass = targetParticle.getMass();
    107   G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    108                                        + 2.0*targetMass*incidentTotalEnergy);
     105  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     106                                        + targetMass*targetMass
     107                                        + 2.0*targetMass*incidentTotalEnergy);
    109108  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
    110                                     // this was the meaning of inElastic in the
    111                                     // original Gheisha stand-alone version.
    112 //  G4bool inElastic = InElasticCrossSectionInFirstInt
    113 //                      (availableEnergy, incidentCode, incidentTotalMomentum); 
    114 // for unknown reasons, it has been replaced by the following code in Geant???
    115109
    116110  G4bool inElastic = true;
    117 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    118 
    119111  vecLength = 0;           
    120112       
     
    125117  G4bool successful = false;
    126118   
    127   if(inElastic || (!inElastic && atomicWeight < 1.5)) {
    128  
    129     // Split K0L into K0 and K0bar
    130     if (G4UniformRand() < 0.5)
    131       FirstIntInCasAntiKaonZero(inElastic, availableEnergy, pv, vecLength,
    132                                 incidentParticle, targetParticle );
    133     else
    134       FirstIntInCasKaonZero(inElastic, availableEnergy, pv, vecLength,
    135                             incidentParticle, targetParticle, atomicWeight );
    136 
    137     // Do nuclear interaction with either K0 or K0bar
    138     if ((vecLength > 0) && (availableEnergy > 1.))
    139       StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
    140                                     pv, vecLength,
    141                                     incidentParticle, targetParticle);
    142     HighEnergyCascading(successful, pv, vecLength,
    143                         excitationEnergyGNP, excitationEnergyDTA,
    144                         incidentParticle, targetParticle,
    145                         atomicWeight, atomicNumber);
    146     if (!successful)
    147       HighEnergyClusterProduction(successful, pv, vecLength,
    148                                   excitationEnergyGNP, excitationEnergyDTA,
     119  // Split K0L into K0 and K0bar
     120  if (G4UniformRand() < 0.5)
     121    FirstIntInCasAntiKaonZero(inElastic, availableEnergy, pv, vecLength,
     122                              incidentParticle, targetParticle);
     123  else
     124    FirstIntInCasKaonZero(inElastic, availableEnergy, pv, vecLength,
     125                          incidentParticle, targetParticle, atomicWeight);
     126
     127  // Do nuclear interaction with either K0 or K0bar
     128  if ((vecLength > 0) && (availableEnergy > 1.))
     129    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     130                                  pv, vecLength,
     131                                  incidentParticle, targetParticle);
     132
     133  HighEnergyCascading(successful, pv, vecLength,
     134                      excitationEnergyGNP, excitationEnergyDTA,
     135                      incidentParticle, targetParticle,
     136                      atomicWeight, atomicNumber);
     137  if (!successful)
     138    HighEnergyClusterProduction(successful, pv, vecLength,
     139                                excitationEnergyGNP, excitationEnergyDTA,
     140                                incidentParticle, targetParticle,
     141                                atomicWeight, atomicNumber);
     142  if (!successful)
     143    MediumEnergyCascading(successful, pv, vecLength,
     144                          excitationEnergyGNP, excitationEnergyDTA,
     145                          incidentParticle, targetParticle,
     146                          atomicWeight, atomicNumber);
     147
     148  if (!successful)
     149    MediumEnergyClusterProduction(successful, pv, vecLength,
     150                                  excitationEnergyGNP, excitationEnergyDTA,       
    149151                                  incidentParticle, targetParticle,
    150152                                  atomicWeight, atomicNumber);
    151     if (!successful)
    152       MediumEnergyCascading(successful, pv, vecLength,
    153                             excitationEnergyGNP, excitationEnergyDTA,
    154                             incidentParticle, targetParticle,
    155                             atomicWeight, atomicNumber);
    156 
    157     if (!successful)
    158       MediumEnergyClusterProduction(successful, pv, vecLength,
    159                                     excitationEnergyGNP, excitationEnergyDTA,       
    160                                     incidentParticle, targetParticle,
    161                                     atomicWeight, atomicNumber);
    162     if (!successful)
    163       QuasiElasticScattering(successful, pv, vecLength,
    164                              excitationEnergyGNP, excitationEnergyDTA,
    165                              incidentParticle, targetParticle,
    166                              atomicWeight, atomicNumber);
    167   }
     153  if (!successful)
     154    QuasiElasticScattering(successful, pv, vecLength,
     155                           excitationEnergyGNP, excitationEnergyDTA,
     156                           incidentParticle, targetParticle,
     157                           atomicWeight, atomicNumber);
    168158
    169159  if (!successful)
     
    193183  delete [] pv;
    194184  theParticleChange.SetStatusChange(stopAndKill);
    195   return & theParticleChange;
     185  return &theParticleChange;
    196186}
    197187
    198188
    199189void
    200 G4HEKaonZeroLongInelastic::FirstIntInCasKaonZero(G4bool &inElastic,
     190G4HEKaonZeroLongInelastic::FirstIntInCasKaonZero(G4bool& inElastic,
    201191                                                 const G4double availableEnergy,
    202192                                                 G4HEVector pv[],
    203                                                  G4int &vecLen,
    204                                                  G4HEVector incidentParticle,
    205                                                  G4HEVector targetParticle,
     193                                                 G4int& vecLen,
     194                                                 const G4HEVector& incidentParticle,
     195                                                 const G4HEVector& targetParticle,
    206196                                                 const G4double atomicWeight)
    207197
     
    213203// protons/neutrons by kaons or strange baryons according to the average
    214204// multiplicity per inelastic reaction.
    215 
    216205{
    217   static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    218   static const G4double expxl = -expxu;         // lower bound for arg. of exp
     206  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     207  static const G4double expxl = -expxu;             // lower bound for arg. of exp
    219208
    220209  static const G4double protb = 0.7;
     
    521510
    522511void
    523 G4HEKaonZeroLongInelastic::FirstIntInCasAntiKaonZero(G4bool &inElastic,
     512G4HEKaonZeroLongInelastic::FirstIntInCasAntiKaonZero(G4bool& inElastic,
    524513                                                     const G4double availableEnergy,
    525514                                                     G4HEVector pv[],
    526                                                      G4int &vecLen,
    527                                                      G4HEVector incidentParticle,
    528                                                      G4HEVector targetParticle )
     515                                                     G4int& vecLen,
     516                                                     const G4HEVector& incidentParticle,
     517                                                     const G4HEVector& targetParticle)
    529518
    530519// AntiKaon0 undergoes interaction with nucleon within a nucleus.  Check if it is
     
    560549  static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
    561550
    562 //  misc. local variables
    563 //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
     551  //  misc. local variables
     552  //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
    564553
    565554  G4int i, counter, nt, np, nm, nz;
    566555
    567   if(first) {
     556  if (first) {
    568557    // compute normalization constants, this will only be done once
    569558    first = false;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEKaonZeroShortInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4HEKaonZeroShortInelastic.cc,v 1.11 2010/02/09 21:58:57 dennis Exp $
    27 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    28 //
     26// $Id: G4HEKaonZeroShortInelastic.cc,v 1.13 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2928//
    3029
     
    3231#include "G4ios.hh"
    3332
    34 //
    3533// G4 Process: Gheisha High Energy Collision model.
    3634// This includes the high energy cascading model, the two-body-resonance model
    37 // and the low energy two-body model. Not included are the low energy stuff like
    38 // nuclear reactions, nuclear fission without any cascading and all processes for
    39 // particles at rest.
     35// and the low energy two-body model. Not included are the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest.
    4038// 
    4139// New version by D.H. Wright (SLAC) to fix seg fault in old version
     
    4543#include "G4HEKaonZeroShortInelastic.hh"
    4644
    47 G4HadFinalState* G4HEKaonZeroShortInelastic::
    48 ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus)
     45G4HadFinalState*
     46G4HEKaonZeroShortInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     47                                          G4Nucleus& targetNucleus)
    4948{
    50   G4HEVector * pv = new G4HEVector[MAXPART];
    51   const G4HadProjectile *aParticle = &aTrack;
     49  G4HEVector* pv = new G4HEVector[MAXPART];
     50  const G4HadProjectile* aParticle = &aTrack;
    5251  const G4double atomicWeight = targetNucleus.GetN();
    5352  const G4double atomicNumber = targetNucleus.GetZ();
    5453  G4HEVector incidentParticle(aParticle);
    5554
    56   G4int    incidentCode          = incidentParticle.getCode();
    57   G4double incidentMass          = incidentParticle.getMass();
    58   G4double incidentTotalEnergy   = incidentParticle.getEnergy();
     55  G4int incidentCode = incidentParticle.getCode();
     56  G4double incidentMass = incidentParticle.getMass();
     57  G4double incidentTotalEnergy = incidentParticle.getEnergy();
    5958  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    6059  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     
    9291
    9392  incidentKineticEnergy -= excitation;
    94   incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    95   incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    96                                   *(incidentTotalEnergy+incidentMass));
    97 
     93  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     94  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)                   
     95                                    *(incidentTotalEnergy+incidentMass));
    9896
    9997  G4HEVector targetParticle;
     
    105103
    106104  G4double targetMass = targetParticle.getMass();
    107   G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    108                                        + 2.0*targetMass*incidentTotalEnergy);
     105  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     106                                        + targetMass*targetMass
     107                                        + 2.0*targetMass*incidentTotalEnergy);
    109108  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
    110                                     // this was the meaning of inElastic in the
    111                                     // original Gheisha stand-alone version.
    112 //  G4bool inElastic = InElasticCrossSectionInFirstInt
    113 //                      (availableEnergy, incidentCode, incidentTotalMomentum); 
    114 // for unknown reasons, it has been replaced by the following code in Geant???
    115109
    116110  G4bool inElastic = true;
    117 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    118 
    119111  vecLength = 0;           
    120112       
     
    125117  G4bool successful = false;
    126118   
    127   if(inElastic || (!inElastic && atomicWeight < 1.5)) {
    128  
    129     // Split K0L into K0 and K0bar
    130     if (G4UniformRand() < 0.5)
    131       FirstIntInCasAntiKaonZero(inElastic, availableEnergy, pv, vecLength,
    132                                 incidentParticle, targetParticle );
    133     else
    134       FirstIntInCasKaonZero(inElastic, availableEnergy, pv, vecLength,
    135                             incidentParticle, targetParticle, atomicWeight );
    136 
    137     // Do nuclear interaction with either K0 or K0bar
    138     if ((vecLength > 0) && (availableEnergy > 1.))
    139       StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
    140                                     pv, vecLength,
    141                                     incidentParticle, targetParticle);
    142     HighEnergyCascading(successful, pv, vecLength,
    143                         excitationEnergyGNP, excitationEnergyDTA,
    144                         incidentParticle, targetParticle,
    145                         atomicWeight, atomicNumber);
    146     if (!successful)
    147       HighEnergyClusterProduction(successful, pv, vecLength,
    148                                   excitationEnergyGNP, excitationEnergyDTA,
     119  // Split K0L into K0 and K0bar
     120  if (G4UniformRand() < 0.5)
     121    FirstIntInCasAntiKaonZero(inElastic, availableEnergy, pv, vecLength,
     122                              incidentParticle, targetParticle );
     123  else
     124    FirstIntInCasKaonZero(inElastic, availableEnergy, pv, vecLength,
     125                          incidentParticle, targetParticle, atomicWeight );
     126
     127  // Do nuclear interaction with either K0 or K0bar
     128  if ((vecLength > 0) && (availableEnergy > 1.))
     129    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     130                                  pv, vecLength,
     131                                  incidentParticle, targetParticle);
     132
     133  HighEnergyCascading(successful, pv, vecLength,
     134                      excitationEnergyGNP, excitationEnergyDTA,
     135                      incidentParticle, targetParticle,
     136                      atomicWeight, atomicNumber);
     137  if (!successful)
     138    HighEnergyClusterProduction(successful, pv, vecLength,
     139                                excitationEnergyGNP, excitationEnergyDTA,
     140                                incidentParticle, targetParticle,
     141                                atomicWeight, atomicNumber);
     142  if (!successful)
     143    MediumEnergyCascading(successful, pv, vecLength,
     144                          excitationEnergyGNP, excitationEnergyDTA,
     145                          incidentParticle, targetParticle,
     146                          atomicWeight, atomicNumber);
     147
     148  if (!successful)
     149    MediumEnergyClusterProduction(successful, pv, vecLength,
     150                                  excitationEnergyGNP, excitationEnergyDTA,       
    149151                                  incidentParticle, targetParticle,
    150152                                  atomicWeight, atomicNumber);
    151     if (!successful)
    152       MediumEnergyCascading(successful, pv, vecLength,
    153                             excitationEnergyGNP, excitationEnergyDTA,
    154                             incidentParticle, targetParticle,
    155                             atomicWeight, atomicNumber);
    156 
    157     if (!successful)
    158       MediumEnergyClusterProduction(successful, pv, vecLength,
    159                                     excitationEnergyGNP, excitationEnergyDTA,       
    160                                     incidentParticle, targetParticle,
    161                                     atomicWeight, atomicNumber);
    162     if (!successful)
    163       QuasiElasticScattering(successful, pv, vecLength,
    164                              excitationEnergyGNP, excitationEnergyDTA,
    165                              incidentParticle, targetParticle,
    166                              atomicWeight, atomicNumber);
    167   }
     153  if (!successful)
     154    QuasiElasticScattering(successful, pv, vecLength,
     155                           excitationEnergyGNP, excitationEnergyDTA,
     156                           incidentParticle, targetParticle,
     157                           atomicWeight, atomicNumber);
    168158
    169159  if (!successful)
     
    193183  delete [] pv;
    194184  theParticleChange.SetStatusChange(stopAndKill);
    195   return & theParticleChange;
     185  return &theParticleChange;
    196186}
    197187
    198188
    199189void
    200 G4HEKaonZeroShortInelastic::FirstIntInCasKaonZero(G4bool &inElastic,
    201                                                  const G4double availableEnergy,
    202                                                  G4HEVector pv[],
    203                                                  G4int &vecLen,
    204                                                  G4HEVector incidentParticle,
    205                                                  G4HEVector targetParticle,
    206                                                  const G4double atomicWeight)
     190G4HEKaonZeroShortInelastic::FirstIntInCasKaonZero(G4bool& inElastic,
     191                                                  const G4double availableEnergy,
     192                                                  G4HEVector pv[],
     193                                                  G4int& vecLen,
     194                                                  const G4HEVector& incidentParticle,
     195                                                  const G4HEVector& targetParticle,
     196                                                  const G4double atomicWeight)
    207197
    208198// Kaon0 undergoes interaction with nucleon within a nucleus.  Check if it is
     
    213203// protons/neutrons by kaons or strange baryons according to the average
    214204// multiplicity per inelastic reaction.
    215 
    216205{
    217   static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    218   static const G4double expxl = -expxu;         // lower bound for arg. of exp
     206  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     207  static const G4double expxl = -expxu;             // lower bound for arg. of exp
    219208
    220209  static const G4double protb = 0.7;
     
    521510
    522511void
    523 G4HEKaonZeroShortInelastic::FirstIntInCasAntiKaonZero(G4bool &inElastic,
    524                                                      const G4double availableEnergy,
    525                                                      G4HEVector pv[],
    526                                                      G4int &vecLen,
    527                                                      G4HEVector incidentParticle,
    528                                                      G4HEVector targetParticle )
     512G4HEKaonZeroShortInelastic::FirstIntInCasAntiKaonZero(G4bool& inElastic,
     513                                                      const G4double availableEnergy,
     514                                                      G4HEVector pv[],
     515                                                      G4int& vecLen,
     516                                                      const G4HEVector& incidentParticle,
     517                                                      const G4HEVector& targetParticle)
    529518
    530519// AntiKaon0 undergoes interaction with nucleon within a nucleus.  Check if it is
     
    535524// protons/neutrons by kaons or strange baryons according to the average
    536525// multiplicity per inelastic reaction.
    537 
    538526{
    539   static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    540   static const G4double expxl = -expxu;         // lower bound for arg. of exp
     527  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     528  static const G4double expxl = -expxu;             // lower bound for arg. of exp
    541529
    542530  static const G4double protb = 0.7;
     
    544532  static const G4double     c = 1.25;
    545533
    546   static const G4int   numMul = 1200;
    547   static const G4int   numSec = 60;
     534  static const G4int numMul = 1200;
     535  static const G4int numSec = 60;
    548536
    549537  G4int neutronCode = Neutron.getCode();
     
    560548  static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
    561549
    562 // misc. local variables
    563 // np = number of pi+,  nm = number of pi-,  nz = number of pi0
     550  // misc. local variables
     551  // np = number of pi+,  nm = number of pi-,  nz = number of pi0
    564552
    565553  G4int i, counter, nt, np, nm, nz;
    566554
    567   if(first) {
     555  if (first) {
    568556    // compute normalization constants, this will only be done once
    569557    first = false;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HELambdaInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HELambdaInelastic.cc,v 1.15 2008/03/17 20:49:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HELambdaInelastic.cc,v 1.17 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     35// and the low energy two-body model. Not included are the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest. 
    4138// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4239// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4542#include "G4HELambdaInelastic.hh"
    4643
    47 G4HadFinalState *  G4HELambdaInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double A = targetNucleus.GetN();
    54     const G4double Z = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
     44G4HadFinalState*
     45G4HELambdaInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     46                                   G4Nucleus& targetNucleus)
     47{
     48  G4HEVector* pv = new G4HEVector[MAXPART];
     49  const G4HadProjectile* aParticle = &aTrack;
     50  const G4double A = targetNucleus.GetN();
     51  const G4double Z = targetNucleus.GetZ();
     52  G4HEVector incidentParticle(aParticle);
    5653     
    57     G4double atomicNumber = Z;
    58     G4double atomicWeight = A;
    59 
    60     G4int    incidentCode          = incidentParticle.getCode();
    61     G4double incidentMass          = incidentParticle.getMass();
    62     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    63     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    64     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    65 
    66     if(incidentKineticEnergy < 1.)
    67       {
    68         G4cout << "GHELambdaInelastic: incident energy < 1 GeV" << G4endl;
    69       }
    70     if(verboseLevel > 1)
    71       {
    72         G4cout << "G4HELambdaInelastic::ApplyYourself" << G4endl;
    73         G4cout << "incident particle " << incidentParticle.getName()
    74              << "mass "              << incidentMass
    75              << "kinetic energy "    << incidentKineticEnergy
    76              << G4endl;
    77         G4cout << "target material with (A,Z) = ("
    78              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    79       }
    80 
    81     G4double inelasticity  = NuclearInelasticity(incidentKineticEnergy,
    82                                                  atomicWeight, atomicNumber);
    83     if(verboseLevel > 1)
    84         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     54  G4double atomicNumber = Z;
     55  G4double atomicWeight = A;
     56
     57  G4int incidentCode = incidentParticle.getCode();
     58  G4double incidentMass = incidentParticle.getMass();
     59  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     60  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     61  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     62
     63  if (incidentKineticEnergy < 1.)
     64    G4cout << "GHELambdaInelastic: incident energy < 1 GeV" << G4endl;
     65
     66  if (verboseLevel > 1) {
     67    G4cout << "G4HELambdaInelastic::ApplyYourself" << G4endl;
     68    G4cout << "incident particle " << incidentParticle.getName()
     69           << "mass "              << incidentMass
     70           << "kinetic energy "    << incidentKineticEnergy
     71           << G4endl;
     72    G4cout << "target material with (A,Z) = ("
     73           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     74  }
     75
     76  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     77                                              atomicWeight, atomicNumber);
     78  if (verboseLevel > 1)
     79    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    8580   
    86     incidentKineticEnergy -= inelasticity;
     81  incidentKineticEnergy -= inelasticity;
    8782   
    88     G4double excitationEnergyGNP = 0.;
    89     G4double excitationEnergyDTA = 0.;
    90 
    91     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    92                                                atomicWeight, atomicNumber,
    93                                                excitationEnergyGNP,
    94                                                excitationEnergyDTA);
    95     if(verboseLevel > 1)
    96       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     83  G4double excitationEnergyGNP = 0.;
     84  G4double excitationEnergyDTA = 0.;
     85
     86  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     87                                          atomicWeight, atomicNumber,
     88                                          excitationEnergyGNP,
     89                                          excitationEnergyDTA);
     90  if (verboseLevel > 1)
     91    G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    9792           << excitationEnergyDTA << G4endl;             
    9893
    99 
    100     incidentKineticEnergy -= excitation;
    101     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    102     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    103                                   *(incidentTotalEnergy+incidentMass));
    104 
    105 
    106     G4HEVector targetParticle;
    107     if(G4UniformRand() < atomicNumber/atomicWeight)
    108       {
    109         targetParticle.setDefinition("Proton");
    110       }
    111     else
    112       {
    113         targetParticle.setDefinition("Neutron");
    114       }
    115 
    116     G4double targetMass         = targetParticle.getMass();
    117     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    118                                        + 2.0*targetMass*incidentTotalEnergy);
    119     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    120 
    121                                                                 // this was the meaning of inElastic in the
    122                                                                 // original Gheisha stand-alone version.
    123 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    124 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    125                                                                 // by unknown reasons, it has been replaced
    126                                                                 // to the following code in Geant???
    127     G4bool inElastic = true;
    128 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    129 
    130     vecLength = 0;           
     94  incidentKineticEnergy -= excitation;
     95  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     96  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)                   
     97                                    *(incidentTotalEnergy+incidentMass));
     98
     99  G4HEVector targetParticle;
     100  if (G4UniformRand() < atomicNumber/atomicWeight) {
     101    targetParticle.setDefinition("Proton");
     102  } else {
     103    targetParticle.setDefinition("Neutron");
     104  }
     105
     106  G4double targetMass = targetParticle.getMass();
     107  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     108                                        + targetMass*targetMass
     109                                        + 2.0*targetMass*incidentTotalEnergy);
     110  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     111
     112  G4bool inElastic = true;
     113  vecLength = 0;           
    131114       
    132     if(verboseLevel > 1)
    133       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     115  if (verboseLevel > 1)
     116    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    134117           << incidentCode << G4endl;
    135118
    136     G4bool successful = false;
     119  G4bool successful = false;
    137120   
    138     if(inElastic || (!inElastic && atomicWeight < 1.5))
    139       {
    140         FirstIntInCasLambda(inElastic, availableEnergy, pv, vecLength,
    141                             incidentParticle, targetParticle, atomicWeight);
    142 
    143         if(verboseLevel > 1)
    144            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    145 
    146 
    147         if ((vecLength > 0) && (availableEnergy > 1.))
    148                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    149                                                   pv, vecLength,
    150                                                   incidentParticle, targetParticle);
    151             HighEnergyCascading( successful, pv, vecLength,
    152                                  excitationEnergyGNP, excitationEnergyDTA,
    153                                  incidentParticle, targetParticle,
    154                                  atomicWeight, atomicNumber);
    155         if (!successful)
    156             HighEnergyClusterProduction( successful, pv, vecLength,
    157                                          excitationEnergyGNP, excitationEnergyDTA,
    158                                          incidentParticle, targetParticle,
    159                                          atomicWeight, atomicNumber);
    160         if (!successful)
    161             MediumEnergyCascading( successful, pv, vecLength,
    162                                    excitationEnergyGNP, excitationEnergyDTA,
    163                                    incidentParticle, targetParticle,
    164                                    atomicWeight, atomicNumber);
    165 
    166         if (!successful)
    167             MediumEnergyClusterProduction( successful, pv, vecLength,
    168                                            excitationEnergyGNP, excitationEnergyDTA,       
    169                                            incidentParticle, targetParticle,
    170                                            atomicWeight, atomicNumber);
    171         if (!successful)
    172             QuasiElasticScattering( successful, pv, vecLength,
    173                                     excitationEnergyGNP, excitationEnergyDTA,
    174                                     incidentParticle, targetParticle,
    175                                     atomicWeight, atomicNumber);
    176       }
    177     if (!successful)
    178       {
    179             ElasticScattering( successful, pv, vecLength,
    180                                incidentParticle,   
    181                                atomicWeight, atomicNumber);
    182       }
    183 
    184     if (!successful)
    185       {
    186         G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles" << G4endl;
    187       }
    188       FillParticleChange(pv,  vecLength);
    189       delete [] pv;
    190       theParticleChange.SetStatusChange(stopAndKill);
    191       return & theParticleChange;
    192   }
     121  FirstIntInCasLambda(inElastic, availableEnergy, pv, vecLength,
     122                      incidentParticle, targetParticle, atomicWeight);
     123
     124  if (verboseLevel > 1)
     125    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl;
     126
     127  if ((vecLength > 0) && (availableEnergy > 1.))
     128    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     129                                  pv, vecLength,
     130                                  incidentParticle, targetParticle);
     131
     132  HighEnergyCascading(successful, pv, vecLength,
     133                      excitationEnergyGNP, excitationEnergyDTA,
     134                      incidentParticle, targetParticle,
     135                      atomicWeight, atomicNumber);
     136  if (!successful)
     137    HighEnergyClusterProduction(successful, pv, vecLength,
     138                                excitationEnergyGNP, excitationEnergyDTA,
     139                                incidentParticle, targetParticle,
     140                                atomicWeight, atomicNumber);
     141  if (!successful)
     142    MediumEnergyCascading(successful, pv, vecLength,
     143                          excitationEnergyGNP, excitationEnergyDTA,
     144                          incidentParticle, targetParticle,
     145                          atomicWeight, atomicNumber);
     146
     147  if (!successful)
     148    MediumEnergyClusterProduction(successful, pv, vecLength,
     149                                  excitationEnergyGNP, excitationEnergyDTA,       
     150                                  incidentParticle, targetParticle,
     151                                  atomicWeight, atomicNumber);
     152  if (!successful)
     153    QuasiElasticScattering(successful, pv, vecLength,
     154                           excitationEnergyGNP, excitationEnergyDTA,
     155                           incidentParticle, targetParticle,
     156                           atomicWeight, atomicNumber);
     157  if (!successful)
     158    ElasticScattering(successful, pv, vecLength,
     159                      incidentParticle,   
     160                      atomicWeight, atomicNumber);
     161
     162  if (!successful)
     163    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     164           << G4endl;
     165  FillParticleChange(pv, vecLength);
     166  delete [] pv;
     167  theParticleChange.SetStatusChange(stopAndKill);
     168  return &theParticleChange;
     169}
     170
    193171
    194172void
    195 G4HELambdaInelastic::FirstIntInCasLambda( G4bool &inElastic,
    196                                           const G4double availableEnergy,
    197                                           G4HEVector pv[],
    198                                           G4int &vecLen,
    199                                           G4HEVector incidentParticle,
    200                                           G4HEVector targetParticle,
    201                                           const G4double atomicWeight)
     173G4HELambdaInelastic::FirstIntInCasLambda(G4bool& inElastic,
     174                                         const G4double availableEnergy,
     175                                         G4HEVector pv[],
     176                                         G4int& vecLen,
     177                                         const G4HEVector& incidentParticle,
     178                                         const G4HEVector& targetParticle,
     179                                         const G4double atomicWeight)
    202180
    203181// Lambda undergoes interaction with nucleon within a nucleus.  Check if it is
     
    208186// data.  Replace some pions or protons/neutrons by kaons or strange baryons
    209187// according to the average multiplicity per inelastic reaction.
    210 
    211  {
    212    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    213    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    214 
    215    static const G4double protb = 0.7;
    216    static const G4double neutb = 0.7;             
    217    static const G4double     c = 1.25;
    218 
    219    static const G4int   numMul = 1200;
    220    static const G4int   numSec = 60;
    221 
    222 //   G4int              neutronCode = Neutron.getCode();
    223    G4int              protonCode  = Proton.getCode();
    224 
    225    G4int               targetCode = targetParticle.getCode();
    226 //   G4double          incidentMass = incidentParticle.getMass();
    227 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    228    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    229 
    230    static G4bool first = true;
    231    static G4double protmul[numMul], protnorm[numSec];  // proton constants
    232    static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
    233 
    234    //  misc. local variables
    235    //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
    236 
    237    G4int i, counter, nt, np, nm, nz;
     188{
     189  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     190  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     191
     192  static const G4double protb = 0.7;
     193  static const G4double neutb = 0.7;             
     194  static const G4double     c = 1.25;
     195
     196  static const G4int numMul = 1200;
     197  static const G4int numSec = 60;
     198
     199  G4int protonCode  = Proton.getCode();
     200
     201  G4int targetCode = targetParticle.getCode();
     202  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     203
     204  static G4bool first = true;
     205  static G4double protmul[numMul], protnorm[numSec];  // proton constants
     206  static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
     207
     208  //  misc. local variables
     209  //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
     210
     211  G4int i, counter, nt, np, nm, nz;
    238212
    239213   if( first )
  • trunk/source/processes/hadronic/models/high_energy/src/G4HENeutronInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HENeutronInelastic.cc,v 1.15 2008/03/17 20:49:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HENeutronInelastic.cc,v 1.17 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     35// and the low energy two-body model. Not included are the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest. 
    4138// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4239// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4542#include "G4HENeutronInelastic.hh"
    4643
    47 G4HadFinalState *  G4HENeutronInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double A = targetNucleus.GetN();
    54     const G4double Z = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
     44G4HadFinalState*
     45G4HENeutronInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     46                                    G4Nucleus& targetNucleus)
     47{
     48  G4HEVector* pv = new G4HEVector[MAXPART];
     49  const G4HadProjectile* aParticle = &aTrack;
     50  const G4double A = targetNucleus.GetN();
     51  const G4double Z = targetNucleus.GetZ();
     52  G4HEVector incidentParticle(aParticle);
    5653     
    57     G4double atomicNumber = Z;
    58     G4double atomicWeight = A;
    59 
    60     G4int    incidentCode          = incidentParticle.getCode();
    61     G4double incidentMass          = incidentParticle.getMass();
    62     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    63     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    64     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    65 
    66     if(incidentKineticEnergy < 1.)
    67       {
    68         G4cout << "GHENeutronInelastic: incident energy < 1 GeV" << G4endl;
    69       }
    70     if(verboseLevel > 1)
    71       {
    72         G4cout << "G4HENeutronInelastic::ApplyYourself" << G4endl;
    73         G4cout << "incident particle " << incidentParticle.getName()
    74              << "mass "              << incidentMass
    75              << "kinetic energy "    << incidentKineticEnergy
    76              << G4endl;
    77         G4cout << "target material with (A,Z) = ("
    78              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    79       }
     54  G4double atomicNumber = Z;
     55  G4double atomicWeight = A;
     56
     57  G4int incidentCode = incidentParticle.getCode();
     58  G4double incidentMass = incidentParticle.getMass();
     59  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     60  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     61  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     62
     63  if (incidentKineticEnergy < 1.)
     64    G4cout << "GHENeutronInelastic: incident energy < 1 GeV" << G4endl;
    8065   
    81     G4double inelasticity  = NuclearInelasticity(incidentKineticEnergy,
    82                                                  atomicWeight, atomicNumber);
    83     if(verboseLevel > 1)
    84         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     66  if (verboseLevel > 1) {
     67    G4cout << "G4HENeutronInelastic::ApplyYourself" << G4endl;
     68    G4cout << "incident particle " << incidentParticle.getName()
     69           << "mass "              << incidentMass
     70           << "kinetic energy "    << incidentKineticEnergy
     71           << G4endl;
     72    G4cout << "target material with (A,Z) = ("
     73           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     74  }
    8575   
    86     incidentKineticEnergy -= inelasticity;
     76  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     77                                              atomicWeight, atomicNumber);
     78  if (verboseLevel > 1)
     79    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    8780   
    88     G4double excitationEnergyGNP = 0.;
    89     G4double excitationEnergyDTA = 0.;
    90 
    91     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    92                                                atomicWeight, atomicNumber,
    93                                                excitationEnergyGNP,
    94                                                excitationEnergyDTA);
    95     if(verboseLevel > 1)
    96       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     81  incidentKineticEnergy -= inelasticity;
     82   
     83  G4double excitationEnergyGNP = 0.;
     84  G4double excitationEnergyDTA = 0.;
     85
     86  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     87                                          atomicWeight, atomicNumber,
     88                                          excitationEnergyGNP,
     89                                          excitationEnergyDTA);
     90  if (verboseLevel > 1)
     91    G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    9792           << excitationEnergyDTA << G4endl;             
    9893
    99 
    100     incidentKineticEnergy -= excitation;
    101     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    102     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    103                                   *(incidentTotalEnergy+incidentMass));
    104 
    105 
    106     G4HEVector targetParticle;
    107     if(G4UniformRand() < atomicNumber/atomicWeight)
    108       {
    109         targetParticle.setDefinition("Proton");
    110       }
    111     else
    112       {
    113         targetParticle.setDefinition("Neutron");
    114       }
    115 
    116     G4double targetMass         = targetParticle.getMass();
    117     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    118                                        + 2.0*targetMass*incidentTotalEnergy);
    119     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    120 
    121                                                                 // this was the meaning of inElastic in the
    122                                                                 // original Gheisha stand-alone version.
    123 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    124 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    125                                                                 // by unknown reasons, it has been replaced
    126                                                                 // to the following code in Geant???
    127     G4bool inElastic = true;
    128 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    129 
    130     vecLength = 0;           
    131        
    132     if(verboseLevel > 1)
    133       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     94  incidentKineticEnergy -= excitation;
     95  incidentTotalEnergy  = incidentKineticEnergy + incidentMass;
     96  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)                   
     97                                    *(incidentTotalEnergy+incidentMass));
     98
     99  G4HEVector targetParticle;
     100  if (G4UniformRand() < atomicNumber/atomicWeight) {
     101    targetParticle.setDefinition("Proton");
     102  } else {
     103    targetParticle.setDefinition("Neutron");
     104  }
     105
     106  G4double targetMass = targetParticle.getMass();
     107  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     108                                        + targetMass*targetMass
     109                                        + 2.0*targetMass*incidentTotalEnergy);
     110  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     111
     112  // In the original Gheisha code the inElastic flag was set as follows
     113  //   G4bool inElastic = InElasticCrossSectionInFirstInt
     114  //                      (availableEnergy, incidentCode, incidentTotalMomentum); 
     115  // For unknown reasons, it has been replaced by the following code in Geant???
     116  //
     117  G4bool inElastic = true;
     118  //   if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
     119
     120  vecLength = 0;
     121
     122  if (verboseLevel > 1)
     123    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    134124           << incidentCode << G4endl;
    135125
    136     G4bool successful = false;
     126  G4bool successful = false;
    137127   
    138     if(inElastic || (!inElastic && atomicWeight < 1.5))
    139       {
    140         FirstIntInCasNeutron(inElastic, availableEnergy, pv, vecLength,
    141                              incidentParticle, targetParticle, atomicWeight);
    142 
    143         if(verboseLevel > 1)
    144            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    145 
    146 
    147         if ((vecLength > 0) && (availableEnergy > 1.))
    148                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    149                                                   pv, vecLength,
    150                                                   incidentParticle, targetParticle);
    151             HighEnergyCascading( successful, pv, vecLength,
    152                                  excitationEnergyGNP, excitationEnergyDTA,
    153                                  incidentParticle, targetParticle,
    154                                  atomicWeight, atomicNumber);
    155         if (!successful)
    156             HighEnergyClusterProduction( successful, pv, vecLength,
    157                                          excitationEnergyGNP, excitationEnergyDTA,
    158                                          incidentParticle, targetParticle,
    159                                          atomicWeight, atomicNumber);
    160         if (!successful)
    161             MediumEnergyCascading( successful, pv, vecLength,
    162                                    excitationEnergyGNP, excitationEnergyDTA,
    163                                    incidentParticle, targetParticle,
    164                                    atomicWeight, atomicNumber);
    165 
    166         if (!successful)
    167             MediumEnergyClusterProduction( successful, pv, vecLength,
    168                                            excitationEnergyGNP, excitationEnergyDTA,       
    169                                            incidentParticle, targetParticle,
    170                                            atomicWeight, atomicNumber);
    171         if (!successful)
    172             QuasiElasticScattering( successful, pv, vecLength,
    173                                     excitationEnergyGNP, excitationEnergyDTA,
    174                                     incidentParticle, targetParticle,
    175                                     atomicWeight, atomicNumber);
    176       }
    177     if (!successful)
    178       {
    179             ElasticScattering( successful, pv, vecLength,
    180                                incidentParticle,   
    181                                atomicWeight, atomicNumber);
    182       }
    183 
    184     if (!successful)
    185       {
    186         G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles" << G4endl;
    187       }
    188       FillParticleChange(pv,  vecLength);
    189       delete [] pv;
    190       theParticleChange.SetStatusChange(stopAndKill);
    191       return & theParticleChange;
    192   }
     128  FirstIntInCasNeutron(inElastic, availableEnergy, pv, vecLength,
     129                       incidentParticle, targetParticle, atomicWeight);
     130
     131  if (verboseLevel > 1)
     132    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl;
     133
     134  if ((vecLength > 0) && (availableEnergy > 1.))
     135    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     136                                  pv, vecLength,
     137                                  incidentParticle, targetParticle);
     138
     139  HighEnergyCascading(successful, pv, vecLength,
     140                      excitationEnergyGNP, excitationEnergyDTA,
     141                      incidentParticle, targetParticle,
     142                      atomicWeight, atomicNumber);
     143  if (!successful)
     144    HighEnergyClusterProduction(successful, pv, vecLength,
     145                                excitationEnergyGNP, excitationEnergyDTA,
     146                                incidentParticle, targetParticle,
     147                                atomicWeight, atomicNumber);
     148  if (!successful)
     149    MediumEnergyCascading(successful, pv, vecLength,
     150                          excitationEnergyGNP, excitationEnergyDTA,
     151                          incidentParticle, targetParticle,
     152                          atomicWeight, atomicNumber);
     153
     154  if (!successful)
     155    MediumEnergyClusterProduction(successful, pv, vecLength,
     156                                  excitationEnergyGNP, excitationEnergyDTA,       
     157                                  incidentParticle, targetParticle,
     158                                  atomicWeight, atomicNumber);
     159  if (!successful)
     160    QuasiElasticScattering(successful, pv, vecLength,
     161                           excitationEnergyGNP, excitationEnergyDTA,
     162                           incidentParticle, targetParticle,
     163                           atomicWeight, atomicNumber);
     164  if (!successful)
     165    ElasticScattering(successful, pv, vecLength,
     166                      incidentParticle,   
     167                      atomicWeight, atomicNumber);
     168
     169  if (!successful)
     170    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     171           << G4endl;
     172
     173  FillParticleChange(pv, vecLength);
     174  delete [] pv;
     175  theParticleChange.SetStatusChange(stopAndKill);
     176  return &theParticleChange;
     177}
     178
    193179
    194180void
    195 G4HENeutronInelastic::FirstIntInCasNeutron( G4bool &inElastic,
    196                                             const G4double availableEnergy,
    197                                             G4HEVector pv[],
    198                                             G4int &vecLen,
    199                                             G4HEVector incidentParticle,
    200                                             G4HEVector targetParticle,
    201                                             const G4double atomicWeight)
     181G4HENeutronInelastic::FirstIntInCasNeutron(G4bool& inElastic,
     182                                           const G4double availableEnergy,
     183                                           G4HEVector pv[],
     184                                           G4int& vecLen,
     185                                           const G4HEVector& incidentParticle,
     186                                           const G4HEVector& targetParticle,
     187                                           const G4double atomicWeight)
    202188
    203189// Neutron undergoes interaction with nucleon within a nucleus.  Check if it is
     
    208194// protons/neutrons by kaons or strange baryons according to the average
    209195// multiplicity per inelastic reaction.
    210 
    211  {
    212    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    213    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    214 
    215    static const G4double protb = 0.35;
    216    static const G4double neutb = 0.35;             
    217    static const G4double     c = 1.25;
    218 
    219    static const G4int   numMul = 1200;
    220    static const G4int   numSec = 60;
    221 
    222    G4int              neutronCode = Neutron.getCode();
    223    G4int              protonCode  = Proton.getCode();
    224 
    225    G4int               targetCode = targetParticle.getCode();
    226 //   G4double          incidentMass = incidentParticle.getMass();
    227 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    228    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    229 
    230    static G4bool first = true;
    231    static G4double protmul[numMul], protnorm[numSec];  // proton constants
    232    static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
    233 
    234                               //  misc. local variables
    235                               //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
    236 
    237    G4int i, counter, nt, np, nm, nz;
     196{
     197  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     198  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     199
     200  static const G4double protb = 0.35;
     201  static const G4double neutb = 0.35;             
     202  static const G4double     c = 1.25;
     203
     204  static const G4int   numMul = 1200;
     205  static const G4int   numSec = 60;
     206
     207  G4int neutronCode = Neutron.getCode();
     208  G4int protonCode  = Proton.getCode();
     209
     210  G4int targetCode = targetParticle.getCode();
     211  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     212
     213  static G4bool first = true;
     214  static G4double protmul[numMul], protnorm[numSec];  // proton constants
     215  static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
     216
     217  //  misc. local variables
     218  //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
     219
     220  G4int i, counter, nt, np, nm, nz;
    238221
    239222   if( first )
    240      {                         // compute normalization constants, this will only be done once
     223     {     // compute normalization constants, this will only be done once
    241224       first = false;
    242225       for( i=0; i<numMul; i++ )protmul[i]  = 0.0;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEOmegaMinusInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HEOmegaMinusInelastic.cc,v 1.15 2008/03/17 20:49:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HEOmegaMinusInelastic.cc,v 1.17 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     35// and the low energy two-body model. Not included are the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest. 
    4138// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4239// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4542#include "G4HEOmegaMinusInelastic.hh"
    4643
    47 G4HadFinalState *  G4HEOmegaMinusInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double A = targetNucleus.GetN();
    54     const G4double Z = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
     44G4HadFinalState*
     45G4HEOmegaMinusInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     46                                       G4Nucleus& targetNucleus)
     47{
     48  G4HEVector* pv = new G4HEVector[MAXPART];
     49  const G4HadProjectile* aParticle = &aTrack;
     50  const G4double A = targetNucleus.GetN();
     51  const G4double Z = targetNucleus.GetZ();
     52  G4HEVector incidentParticle(aParticle);
    5653     
    57     G4double atomicNumber = Z;
    58     G4double atomicWeight = A;
    59 
    60     G4int    incidentCode          = incidentParticle.getCode();
    61     G4double incidentMass          = incidentParticle.getMass();
    62     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    63     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    64     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    65 
    66     if(incidentKineticEnergy < 1.)
    67       {
    68         G4cout << "GHEOmegaMinusInelastic: incident energy < 1 GeV" << G4endl;
    69       }
    70     if(verboseLevel > 1)
    71       {
    72         G4cout << "G4HEOmegaMinusInelastic::ApplyYourself" << G4endl;
    73         G4cout << "incident particle " << incidentParticle.getName()
    74              << "mass "              << incidentMass
    75              << "kinetic energy "    << incidentKineticEnergy
    76              << G4endl;
    77         G4cout << "target material with (A,Z) = ("
    78              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    79       }
     54  G4double atomicNumber = Z;
     55  G4double atomicWeight = A;
     56
     57  G4int incidentCode = incidentParticle.getCode();
     58  G4double incidentMass = incidentParticle.getMass();
     59  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     60  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     61  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     62
     63  if (incidentKineticEnergy < 1.)
     64    G4cout << "GHEOmegaMinusInelastic: incident energy < 1 GeV" << G4endl;
     65
     66  if (verboseLevel > 1) {
     67    G4cout << "G4HEOmegaMinusInelastic::ApplyYourself" << G4endl;
     68    G4cout << "incident particle " << incidentParticle.getName()
     69           << "mass "              << incidentMass
     70           << "kinetic energy "    << incidentKineticEnergy
     71           << G4endl;
     72    G4cout << "target material with (A,Z) = ("
     73           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     74  }
    8075   
    81     G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
    82                                                  atomicWeight, atomicNumber);
    83     if(verboseLevel > 1)
    84         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     76  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     77                                              atomicWeight, atomicNumber);
     78  if (verboseLevel > 1)
     79    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    8580   
    86     incidentKineticEnergy -= inelasticity;
     81  incidentKineticEnergy -= inelasticity;
    8782   
    88     G4double excitationEnergyGNP = 0.;
    89     G4double excitationEnergyDTA = 0.;
    90 
    91     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    92                                                atomicWeight, atomicNumber,
    93                                                excitationEnergyGNP,
    94                                                excitationEnergyDTA);
    95     if(verboseLevel > 1)
    96       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     83  G4double excitationEnergyGNP = 0.;
     84  G4double excitationEnergyDTA = 0.;
     85
     86  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     87                                          atomicWeight, atomicNumber,
     88                                          excitationEnergyGNP,
     89                                          excitationEnergyDTA);
     90  if (verboseLevel > 1)
     91    G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    9792           << excitationEnergyDTA << G4endl;             
    9893
    99 
    100     incidentKineticEnergy -= excitation;
    101     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    102     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    103                                   *(incidentTotalEnergy+incidentMass));
    104 
    105 
    106     G4HEVector targetParticle;
    107     if(G4UniformRand() < atomicNumber/atomicWeight)
    108       {
    109         targetParticle.setDefinition("Proton");
    110       }
    111     else
    112       {
    113         targetParticle.setDefinition("Neutron");
    114       }
    115 
    116     G4double targetMass         = targetParticle.getMass();
    117     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    118                                        + 2.0*targetMass*incidentTotalEnergy);
    119     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    120 
    121                                                                 // this was the meaning of inElastic in the
    122                                                                 // original Gheisha stand-alone version.
    123 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    124 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    125                                                                 // by unknown reasons, it has been replaced
    126                                                                 // to the following code in Geant???
    127     G4bool inElastic = true;
    128 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    129 
    130     vecLength = 0;           
     94  incidentKineticEnergy -= excitation;
     95  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     96  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)                   
     97                                    *(incidentTotalEnergy+incidentMass));
     98
     99  G4HEVector targetParticle;
     100  if (G4UniformRand() < atomicNumber/atomicWeight) {
     101    targetParticle.setDefinition("Proton");
     102  } else {
     103    targetParticle.setDefinition("Neutron");
     104  }
     105
     106  G4double targetMass = targetParticle.getMass();
     107  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     108                                        + targetMass*targetMass
     109                                        + 2.0*targetMass*incidentTotalEnergy);
     110  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     111
     112  G4bool inElastic = true;
     113  vecLength = 0;
    131114       
    132     if(verboseLevel > 1)
    133       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     115  if (verboseLevel > 1)
     116    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    134117           << incidentCode << G4endl;
    135118
    136     G4bool successful = false;
     119  G4bool successful = false;
    137120   
    138     if(inElastic || (!inElastic && atomicWeight < 1.5))
    139       {
    140         FirstIntInCasOmegaMinus(inElastic, availableEnergy, pv, vecLength,
    141                                 incidentParticle, targetParticle, atomicWeight);
    142 
    143         if(verboseLevel > 1)
    144            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    145 
    146 
    147         if ((vecLength > 0) && (availableEnergy > 1.))
    148                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    149                                                   pv, vecLength,
    150                                                   incidentParticle, targetParticle);
    151             HighEnergyCascading( successful, pv, vecLength,
    152                                  excitationEnergyGNP, excitationEnergyDTA,
    153                                  incidentParticle, targetParticle,
    154                                  atomicWeight, atomicNumber);
    155         if (!successful)
    156             HighEnergyClusterProduction( successful, pv, vecLength,
    157                                          excitationEnergyGNP, excitationEnergyDTA,
    158                                          incidentParticle, targetParticle,
    159                                          atomicWeight, atomicNumber);
    160         if (!successful)
    161             MediumEnergyCascading( successful, pv, vecLength,
    162                                    excitationEnergyGNP, excitationEnergyDTA,
    163                                    incidentParticle, targetParticle,
    164                                    atomicWeight, atomicNumber);
    165 
    166         if (!successful)
    167             MediumEnergyClusterProduction( successful, pv, vecLength,
    168                                            excitationEnergyGNP, excitationEnergyDTA,       
    169                                            incidentParticle, targetParticle,
    170                                            atomicWeight, atomicNumber);
    171         if (!successful)
    172             QuasiElasticScattering( successful, pv, vecLength,
    173                                     excitationEnergyGNP, excitationEnergyDTA,
    174                                     incidentParticle, targetParticle,
    175                                     atomicWeight, atomicNumber);
    176       }
    177     if (!successful)
    178       {
    179             ElasticScattering( successful, pv, vecLength,
    180                                incidentParticle,   
    181                                atomicWeight, atomicNumber);
    182       }
    183 
    184     if (!successful)
    185       {
    186         G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles" << G4endl;
    187       }
    188       FillParticleChange(pv,  vecLength);
    189       delete [] pv;
    190       theParticleChange.SetStatusChange(stopAndKill);
    191       return & theParticleChange;
    192   }
     121  FirstIntInCasOmegaMinus(inElastic, availableEnergy, pv, vecLength,
     122                          incidentParticle, targetParticle, atomicWeight);
     123
     124  if (verboseLevel > 1)
     125    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl;
     126
     127  if ((vecLength > 0) && (availableEnergy > 1.))
     128    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     129                                  pv, vecLength,
     130                                  incidentParticle, targetParticle);
     131
     132  HighEnergyCascading(successful, pv, vecLength,
     133                      excitationEnergyGNP, excitationEnergyDTA,
     134                      incidentParticle, targetParticle,
     135                      atomicWeight, atomicNumber);
     136  if (!successful)
     137    HighEnergyClusterProduction(successful, pv, vecLength,
     138                                excitationEnergyGNP, excitationEnergyDTA,
     139                                incidentParticle, targetParticle,
     140                                atomicWeight, atomicNumber);
     141  if (!successful)
     142    MediumEnergyCascading(successful, pv, vecLength,
     143                          excitationEnergyGNP, excitationEnergyDTA,
     144                          incidentParticle, targetParticle,
     145                          atomicWeight, atomicNumber);
     146
     147  if (!successful)
     148    MediumEnergyClusterProduction(successful, pv, vecLength,
     149                                  excitationEnergyGNP, excitationEnergyDTA,       
     150                                  incidentParticle, targetParticle,
     151                                  atomicWeight, atomicNumber);
     152  if (!successful)
     153    QuasiElasticScattering(successful, pv, vecLength,
     154                           excitationEnergyGNP, excitationEnergyDTA,
     155                           incidentParticle, targetParticle,
     156                           atomicWeight, atomicNumber);
     157  if (!successful)
     158    ElasticScattering(successful, pv, vecLength,
     159                      incidentParticle,   
     160                      atomicWeight, atomicNumber);
     161
     162  if (!successful)
     163    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     164           << G4endl;
     165
     166  FillParticleChange(pv,  vecLength);
     167  delete [] pv;
     168  theParticleChange.SetStatusChange(stopAndKill);
     169  return &theParticleChange;
     170}
     171
    193172
    194173void
    195 G4HEOmegaMinusInelastic::FirstIntInCasOmegaMinus( G4bool &inElastic,
    196                                                   const G4double availableEnergy,
    197                                                   G4HEVector pv[],
    198                                                   G4int &vecLen,
    199                                                   G4HEVector incidentParticle,
    200                                                   G4HEVector targetParticle,
    201                                                   const G4double atomicWeight)
     174G4HEOmegaMinusInelastic::FirstIntInCasOmegaMinus(G4bool& inElastic,
     175                                                 const G4double availableEnergy,
     176                                                 G4HEVector pv[],
     177                                                 G4int& vecLen,
     178                                                 const G4HEVector& incidentParticle,
     179                                                 const G4HEVector& targetParticle,
     180                                                 const G4double atomicWeight)
    202181
    203182// Xi0 undergoes interaction with nucleon within a nucleus.  Check if it is
     
    208187// protons/neutrons by kaons or strange baryons according to the average
    209188// multiplicity per inelastic reaction.
    210 
    211  {
    212    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    213    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    214 
    215    static const G4double protb = 0.7;
    216    static const G4double neutb = 0.7;             
    217    static const G4double     c = 1.25;
    218 
    219    static const G4int   numMul = 1200;
    220    static const G4int   numSec = 60;
    221 
    222 //   G4int              neutronCode = Neutron.getCode();
    223    G4int              protonCode  = Proton.getCode();
    224 
    225    G4int               targetCode = targetParticle.getCode();
    226 //   G4double          incidentMass = incidentParticle.getMass();
    227 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    228    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    229 
    230    static G4bool first = true;
    231    static G4double protmul[numMul], protnorm[numSec];  // proton constants
    232    static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
    233 
    234                               //  misc. local variables
    235                               //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
    236 
    237    G4int i, counter, nt, np, nm, nz;
     189{
     190  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     191  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     192
     193  static const G4double protb = 0.7;
     194  static const G4double neutb = 0.7;             
     195  static const G4double     c = 1.25;
     196
     197  static const G4int numMul = 1200;
     198  static const G4int numSec = 60;
     199
     200  G4int protonCode  = Proton.getCode();
     201
     202  G4int targetCode = targetParticle.getCode();
     203  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     204
     205  static G4bool first = true;
     206  static G4double protmul[numMul], protnorm[numSec];  // proton constants
     207  static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
     208
     209  //  misc. local variables
     210  //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
     211
     212  G4int i, counter, nt, np, nm, nz;
    238213
    239214   if( first )
    240      {                         // compute normalization constants, this will only be done once
     215     {    // compute normalization constants, this will only be done once
    241216       first = false;
    242217       for( i=0; i<numMul; i++ )protmul[i]  = 0.0;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEPionMinusInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
     26// $Id: G4HEPionMinusInelastic.cc,v 1.17 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2628//
    27 // $Id: G4HEPionMinusInelastic.cc,v 1.15 2008/03/17 20:49:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 
    3029// 11-OCT-2007 F.W. Jones: fixed incorrect Imax (should be Imin) in
    3130//             sampling of charge exchange.
     
    3534#include "G4ios.hh"
    3635
    37 //
    3836// G4 Process: Gheisha High Energy Collision model.
    3937// This includes the high energy cascading model, the two-body-resonance model
    40 // and the low energy two-body model. Not included are the low energy stuff like
    41 // nuclear reactions, nuclear fission without any cascading and all processes for
    42 // particles at rest. 
     38// and the low energy two-body model. Not included are the low energy stuff
     39// like nuclear reactions, nuclear fission without any cascading and all
     40// processes for particles at rest. 
    4341// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4442// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4745#include "G4HEPionMinusInelastic.hh"
    4846
    49 G4HadFinalState * G4HEPionMinusInelastic::
    50 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    51   {
    52     G4HEVector * pv = new G4HEVector[MAXPART];
    53     const G4HadProjectile *aParticle = &aTrack;
    54 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    55     const G4double A = targetNucleus.GetN();
    56     const G4double Z = targetNucleus.GetZ();
    57     G4HEVector incidentParticle(aParticle);
     47G4HadFinalState*
     48G4HEPionMinusInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     49                                      G4Nucleus& targetNucleus)
     50{
     51  G4HEVector* pv = new G4HEVector[MAXPART];
     52  const G4HadProjectile* aParticle = &aTrack;
     53  const G4double A = targetNucleus.GetN();
     54  const G4double Z = targetNucleus.GetZ();
     55  G4HEVector incidentParticle(aParticle);
    5856     
    59     G4double atomicNumber = Z;
    60     G4double atomicWeight = A;
    61 
    62     G4int    incidentCode          = incidentParticle.getCode();
    63     G4double incidentMass          = incidentParticle.getMass();
    64     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    65     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    66     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    67 
    68     if(incidentKineticEnergy < 1.)
    69       {
    70         G4cout << "GHEPionMinusInelastic: incident energy < 1 GeV" << G4endl ;
    71       }
    72     if(verboseLevel > 1)
    73       {
    74         G4cout << "G4HEPionMinusInelastic::ApplyYourself" << G4endl;
    75         G4cout << "incident particle " << incidentParticle.getName()
    76              << "mass "              << incidentMass
    77              << "kinetic energy "    << incidentKineticEnergy
    78              << G4endl;
    79         G4cout << "target material with (A,Z) = ("
    80              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    81       }
    82 
    83     G4double inelasticity  = NuclearInelasticity(incidentKineticEnergy,
    84                                                  atomicWeight, atomicNumber);
    85     if(verboseLevel > 1)
    86         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    87 
    88     incidentKineticEnergy -= inelasticity;
     57  G4double atomicNumber = Z;
     58  G4double atomicWeight = A;
     59
     60  G4int incidentCode = incidentParticle.getCode();
     61  G4double incidentMass = incidentParticle.getMass();
     62  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     63  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     64  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     65
     66  if (incidentKineticEnergy < 1.)
     67    G4cout << "GHEPionMinusInelastic: incident energy < 1 GeV" << G4endl;
     68
     69  if (verboseLevel > 1) {
     70    G4cout << "G4HEPionMinusInelastic::ApplyYourself" << G4endl;
     71    G4cout << "incident particle " << incidentParticle.getName()
     72           << "mass "              << incidentMass
     73           << "kinetic energy "    << incidentKineticEnergy
     74           << G4endl;
     75    G4cout << "target material with (A,Z) = ("
     76           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     77  }
     78
     79  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     80                                              atomicWeight, atomicNumber);
     81  if (verboseLevel > 1)
     82    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     83
     84  incidentKineticEnergy -= inelasticity;
    8985   
    90     G4double excitationEnergyGNP = 0.;
    91     G4double excitationEnergyDTA = 0.;
    92 
    93     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    94                                                atomicWeight, atomicNumber,
    95                                                excitationEnergyGNP,
    96                                                excitationEnergyDTA);
    97     if(verboseLevel > 1)
    98       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    99            << excitationEnergyDTA << G4endl;             
    100 
    101 
    102     incidentKineticEnergy -= excitation;
    103     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    104     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    105                                   *(incidentTotalEnergy+incidentMass));
    106 
    107     G4HEVector targetParticle;
     86  G4double excitationEnergyGNP = 0.;
     87  G4double excitationEnergyDTA = 0.;
     88
     89  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     90                                          atomicWeight, atomicNumber,
     91                                          excitationEnergyGNP,
     92                                          excitationEnergyDTA);
     93  if (verboseLevel > 1)
     94    G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     95           << excitationEnergyDTA << G4endl;
     96
     97  incidentKineticEnergy -= excitation;
     98  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     99  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)                   
     100                                    *(incidentTotalEnergy+incidentMass));
     101
     102  G4HEVector targetParticle;
    108103 
    109     if(G4UniformRand() < atomicNumber/atomicWeight)
    110       {
    111         targetParticle.setDefinition("Proton");
    112       }
    113     else
    114       {
    115         targetParticle.setDefinition("Neutron");
    116       }
    117 
    118     G4double targetMass         = targetParticle.getMass();
    119     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    120                                        + 2.0*targetMass*incidentTotalEnergy);
    121     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    122 
    123                                                                 // this was the meaning of inElastic in the
    124                                                                 // original Gheisha stand-alone version.
    125 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    126 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    127                                                                 // by unknown reasons, it has been replaced
    128                                                                 // to the following code in Geant???
    129     G4bool inElastic = true;
    130 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    131 
    132     vecLength = 0;           
     104  if (G4UniformRand() < atomicNumber/atomicWeight) {
     105    targetParticle.setDefinition("Proton");
     106  } else {
     107    targetParticle.setDefinition("Neutron");
     108  }
     109
     110  G4double targetMass = targetParticle.getMass();
     111  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     112                                        + targetMass*targetMass
     113                                        + 2.0*targetMass*incidentTotalEnergy);
     114  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     115
     116  // The value of the inElastic flag was originally defined in the Gheisha
     117  // stand-alone code as follows:
     118  //   G4bool inElastic = InElasticCrossSectionInFirstInt
     119  //                      (availableEnergy, incidentCode, incidentTotalMomentum); 
     120  // For unknown reasons, it was replaced by the following code in Geant
     121
     122  G4bool inElastic = true;
     123  //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
     124
     125  vecLength = 0;
    133126       
    134     if(verboseLevel > 1)
    135       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     127  if (verboseLevel > 1)
     128    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    136129           << incidentCode << G4endl;
    137130
    138     G4bool successful = false;
     131  G4bool successful = false;
    139132   
    140     if(inElastic || (!inElastic && atomicWeight < 1.5))
    141       {
    142         FirstIntInCasPionMinus(inElastic, availableEnergy, pv, vecLength,
    143                                incidentParticle, targetParticle);
    144 
    145         if(verboseLevel > 1)
    146            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    147 
    148 
    149         if ((vecLength > 0) && (availableEnergy > 1.))
    150                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    151                                                   pv, vecLength,
    152                                                   incidentParticle, targetParticle);
    153             HighEnergyCascading( successful, pv, vecLength,
    154                                  excitationEnergyGNP, excitationEnergyDTA,
    155                                  incidentParticle, targetParticle,
    156                                  atomicWeight, atomicNumber);
    157         if (!successful)
    158             HighEnergyClusterProduction( successful, pv, vecLength,
    159                                          excitationEnergyGNP, excitationEnergyDTA,
    160                                          incidentParticle, targetParticle,
    161                                          atomicWeight, atomicNumber);
    162         if (!successful)
    163             MediumEnergyCascading( successful, pv, vecLength,
    164                                    excitationEnergyGNP, excitationEnergyDTA,
    165                                    incidentParticle, targetParticle,
    166                                    atomicWeight, atomicNumber);
    167 
    168         if (!successful)
    169             MediumEnergyClusterProduction( successful, pv, vecLength,
    170                                            excitationEnergyGNP, excitationEnergyDTA,       
    171                                            incidentParticle, targetParticle,
    172                                            atomicWeight, atomicNumber);
    173         if (!successful)
    174             QuasiElasticScattering( successful, pv, vecLength,
    175                                     excitationEnergyGNP, excitationEnergyDTA,
    176                                     incidentParticle, targetParticle,
    177                                     atomicWeight, atomicNumber);
    178       }
    179     if (!successful)
    180       {
    181             ElasticScattering( successful, pv, vecLength,
    182                                incidentParticle,   
    183                                atomicWeight, atomicNumber);
    184       }
    185 
    186     if (!successful)
    187       {
    188         G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles" << G4endl;
    189       }
    190       FillParticleChange(pv,  vecLength);
    191       delete [] pv;
    192       theParticleChange.SetStatusChange(stopAndKill);
    193       return & theParticleChange;
    194   }
     133  FirstIntInCasPionMinus(inElastic, availableEnergy, pv, vecLength,
     134                         incidentParticle, targetParticle);
     135
     136  if (verboseLevel > 1)
     137    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl;
     138
     139  if ((vecLength > 0) && (availableEnergy > 1.))
     140    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     141                                  pv, vecLength,
     142                                  incidentParticle, targetParticle);
     143
     144  HighEnergyCascading(successful, pv, vecLength,
     145                      excitationEnergyGNP, excitationEnergyDTA,
     146                      incidentParticle, targetParticle,
     147                      atomicWeight, atomicNumber);
     148  if (!successful)
     149    HighEnergyClusterProduction(successful, pv, vecLength,
     150                                excitationEnergyGNP, excitationEnergyDTA,
     151                                incidentParticle, targetParticle,
     152                                atomicWeight, atomicNumber);
     153  if (!successful)
     154    MediumEnergyCascading(successful, pv, vecLength,
     155                          excitationEnergyGNP, excitationEnergyDTA,
     156                          incidentParticle, targetParticle,
     157                          atomicWeight, atomicNumber);
     158
     159  if (!successful)
     160    MediumEnergyClusterProduction(successful, pv, vecLength,
     161                                  excitationEnergyGNP, excitationEnergyDTA,       
     162                                  incidentParticle, targetParticle,
     163                                  atomicWeight, atomicNumber);
     164  if (!successful)
     165    QuasiElasticScattering(successful, pv, vecLength,
     166                           excitationEnergyGNP, excitationEnergyDTA,
     167                           incidentParticle, targetParticle,
     168                           atomicWeight, atomicNumber);
     169  if (!successful)
     170    ElasticScattering(successful, pv, vecLength,
     171                      incidentParticle,   
     172                      atomicWeight, atomicNumber);
     173
     174  if (!successful)
     175    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     176           << G4endl;
     177
     178  FillParticleChange(pv,  vecLength);
     179  delete [] pv;
     180  theParticleChange.SetStatusChange(stopAndKill);
     181  return &theParticleChange;
     182}
     183
    195184
    196185void
    197 G4HEPionMinusInelastic::FirstIntInCasPionMinus( G4bool &inElastic,
    198                                                 const G4double availableEnergy,
    199                                                 G4HEVector pv[],
    200                                                 G4int &vecLen,
    201                                                 G4HEVector incidentParticle,
    202                                                 G4HEVector targetParticle)
     186G4HEPionMinusInelastic::FirstIntInCasPionMinus(G4bool& inElastic,
     187                                               const G4double availableEnergy,
     188                                               G4HEVector pv[],
     189                                               G4int& vecLen,
     190                                               const G4HEVector& incidentParticle,
     191                                               const G4HEVector& targetParticle)
    203192
    204193// Pion- undergoes interaction with nucleon within a nucleus.  Check if it is
     
    209198// protons/neutrons by kaons or strange baryons according to the average
    210199// multiplicity per inelastic reaction.
    211 
    212  {
    213    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    214    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    215 
    216    static const G4double protb = 0.7;
    217    static const G4double neutb = 0.7;
    218    static const G4double     c = 1.25;
    219 
    220    static const G4int   numMul = 1200;
    221    static const G4int   numSec = 60;
    222 
    223 //   G4int              neutronCode = Neutron.getCode();
    224    G4int              protonCode  = Proton.getCode();
    225 
    226    G4int               targetCode = targetParticle.getCode();
    227 //   G4double          incidentMass = incidentParticle.getMass();
    228 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    229    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    230 
    231    static G4bool first = true;
    232    static G4double protmul[numMul], protnorm[numSec];  // proton constants
    233    static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
    234 
    235 //                                misc. local variables
    236 //                                np = number of pi+,  nm = number of pi-,  nz = number of pi0
    237 
    238    G4int i, counter, nt, np, nm, nz;
     200{
     201  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     202  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     203
     204  static const G4double protb = 0.7;
     205  static const G4double neutb = 0.7;
     206  static const G4double     c = 1.25;
     207
     208  static const G4int numMul = 1200;
     209  static const G4int numSec = 60;
     210
     211  G4int protonCode  = Proton.getCode();
     212
     213  G4int targetCode = targetParticle.getCode();
     214  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     215
     216  static G4bool first = true;
     217  static G4double protmul[numMul], protnorm[numSec];  // proton constants
     218  static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
     219
     220  // misc. local variables
     221  // np = number of pi+,  nm = number of pi-,  nz = number of pi0
     222
     223  G4int i, counter, nt, np, nm, nz;
    239224
    240225   if( first )
    241      {                         // compute normalization constants, this will only be done once
     226     {    // compute normalization constants, this will only be done once
    242227       first = false;
    243228       for( i=0; i<numMul; i++ )protmul[i]  = 0.0;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEPionPlusInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HEPionPlusInelastic.cc,v 1.15 2008/03/17 20:49:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HEPionPlusInelastic.cc,v 1.17 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     35// and the low energy two-body model. Not included are the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest. 
    4138// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4239// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4542#include "G4HEPionPlusInelastic.hh"
    4643
    47 G4HadFinalState *  G4HEPionPlusInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double A = targetNucleus.GetN();
    54     const G4double Z = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
     44G4HadFinalState*
     45G4HEPionPlusInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     46                                     G4Nucleus& targetNucleus)
     47{
     48  G4HEVector* pv = new G4HEVector[MAXPART];
     49  const G4HadProjectile* aParticle = &aTrack;
     50  const G4double A = targetNucleus.GetN();
     51  const G4double Z = targetNucleus.GetZ();
     52  G4HEVector incidentParticle(aParticle);
    5653     
    57     G4double atomicNumber = Z;
    58     G4double atomicWeight = A;
    59 
    60     G4int    incidentCode          = incidentParticle.getCode();
    61     G4double incidentMass          = incidentParticle.getMass();
    62     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    63     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    64     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    65 
    66     if(incidentKineticEnergy < 1.)
    67       {
    68         G4cout << "G4HEPionPlusInelastic: incident energy < 1 GeV" << G4endl;
    69       }
    70     if(verboseLevel > 1)
    71       {
    72         G4cout << "G4HEPionPlusInelastic::ApplyYourself" << G4endl;
    73         G4cout << "incident particle " << incidentParticle.getName()
    74              << "mass "              << incidentMass
    75              << "kinetic energy "    << incidentKineticEnergy
    76              << G4endl;
    77         G4cout << "target material with (A,Z) = ("
    78              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    79       }
    80 
    81     G4double inelasticity  = NuclearInelasticity(incidentKineticEnergy,
    82                                                  atomicWeight, atomicNumber);
    83     if(verboseLevel > 1)
    84         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     54  G4double atomicNumber = Z;
     55  G4double atomicWeight = A;
     56
     57  G4int incidentCode = incidentParticle.getCode();
     58  G4double incidentMass = incidentParticle.getMass();
     59  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     60  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     61  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     62
     63  if (incidentKineticEnergy < 1.)
     64    G4cout << "G4HEPionPlusInelastic: incident energy < 1 GeV" << G4endl;
     65
     66  if (verboseLevel > 1) {
     67    G4cout << "G4HEPionPlusInelastic::ApplyYourself" << G4endl;
     68    G4cout << "incident particle " << incidentParticle.getName()
     69           << "mass "              << incidentMass
     70           << "kinetic energy "    << incidentKineticEnergy
     71           << G4endl;
     72    G4cout << "target material with (A,Z) = ("
     73           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     74  }
     75
     76  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     77                                              atomicWeight, atomicNumber);
     78  if (verboseLevel > 1)
     79    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    8580   
    86     incidentKineticEnergy -= inelasticity;
     81  incidentKineticEnergy -= inelasticity;
    8782   
    88     G4double excitationEnergyGNP = 0.;
    89     G4double excitationEnergyDTA = 0.;
    90 
    91     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    92                                                atomicWeight, atomicNumber,
    93                                                excitationEnergyGNP,
    94                                                excitationEnergyDTA);
    95     if(verboseLevel > 1)
    96       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     83  G4double excitationEnergyGNP = 0.;
     84  G4double excitationEnergyDTA = 0.;
     85
     86  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     87                                          atomicWeight, atomicNumber,
     88                                          excitationEnergyGNP,
     89                                          excitationEnergyDTA);
     90  if (verboseLevel > 1)
     91    G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    9792           << excitationEnergyDTA << G4endl;             
    9893
    99 
    100     incidentKineticEnergy -= excitation;
    101     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    102     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    103                                   *(incidentTotalEnergy+incidentMass));
    104 
    105 
    106     G4HEVector targetParticle;
    107     if(G4UniformRand() < atomicNumber/atomicWeight)
    108       {
    109         targetParticle.setDefinition("Proton");
    110       }
    111     else
    112       {
    113         targetParticle.setDefinition("Neutron");
    114       }
    115 
    116     G4double targetMass         = targetParticle.getMass();
    117     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    118                                        + 2.0*targetMass*incidentTotalEnergy);
    119     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    120 
    121                                                                 // this was the meaning of inElastic in the
    122                                                                 // original Gheisha stand-alone version.
    123 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    124 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    125                                                                 // by unknown reasons, it has been replaced
    126                                                                 // to the following code in Geant???
    127     G4bool inElastic = true;
    128 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    129 
    130     vecLength      = 0;           
     94  incidentKineticEnergy -= excitation;
     95  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     96  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)                   
     97                                    *(incidentTotalEnergy+incidentMass));
     98
     99  G4HEVector targetParticle;
     100  if (G4UniformRand() < atomicNumber/atomicWeight) {
     101    targetParticle.setDefinition("Proton");
     102  } else {
     103    targetParticle.setDefinition("Neutron");
     104  }
     105
     106  G4double targetMass = targetParticle.getMass();
     107  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     108                                        + targetMass*targetMass
     109                                        + 2.0*targetMass*incidentTotalEnergy);
     110  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     111
     112  G4bool inElastic = true;
     113
     114  vecLength = 0;
    131115       
    132     if(verboseLevel > 1)
    133       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     116  if (verboseLevel > 1)
     117    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    134118           << incidentCode << G4endl;
    135119
    136     G4bool successful = false;
     120  G4bool successful = false;
    137121   
    138     if(inElastic || (!inElastic && atomicWeight < 1.5))
    139       {
    140         FirstIntInCasPionPlus(inElastic, availableEnergy, pv, vecLength,
    141                               incidentParticle, targetParticle, atomicWeight);
    142 
    143         if(verboseLevel > 1)
    144            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    145 
    146 
    147         if ((vecLength > 0) && (availableEnergy > 1.))
    148                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    149                                                   pv, vecLength,
    150                                                   incidentParticle, targetParticle);
    151             HighEnergyCascading( successful, pv, vecLength,
    152                                  excitationEnergyGNP, excitationEnergyDTA,
    153                                  incidentParticle, targetParticle,
    154                                  atomicWeight, atomicNumber);
    155         if (!successful)
    156             HighEnergyClusterProduction( successful, pv, vecLength,
    157                                          excitationEnergyGNP, excitationEnergyDTA,
    158                                          incidentParticle, targetParticle,
    159                                          atomicWeight, atomicNumber);
    160         if (!successful)
    161             MediumEnergyCascading( successful, pv, vecLength,
    162                                    excitationEnergyGNP, excitationEnergyDTA,
    163                                    incidentParticle, targetParticle,
    164                                    atomicWeight, atomicNumber);
    165 
    166         if (!successful)
    167             MediumEnergyClusterProduction( successful, pv, vecLength,
    168                                            excitationEnergyGNP, excitationEnergyDTA,       
    169                                            incidentParticle, targetParticle,
    170                                            atomicWeight, atomicNumber);
    171         if (!successful)
    172             QuasiElasticScattering( successful, pv, vecLength,
    173                                     excitationEnergyGNP, excitationEnergyDTA,
    174                                     incidentParticle, targetParticle,
    175                                     atomicWeight, atomicNumber);
    176       }
    177     if (!successful)
    178       {
    179             ElasticScattering( successful, pv, vecLength,
    180                                incidentParticle,   
    181                                atomicWeight, atomicNumber);
    182       }
    183 
    184     if (!successful)
    185       {
    186         G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles" << G4endl;
    187       }
    188 
    189       FillParticleChange(pv,  vecLength);
    190       delete [] pv;
    191       theParticleChange.SetStatusChange(stopAndKill);
    192       return & theParticleChange;
    193   }
     122  FirstIntInCasPionPlus(inElastic, availableEnergy, pv, vecLength,
     123                        incidentParticle, targetParticle, atomicWeight);
     124
     125  if (verboseLevel > 1)
     126    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl;
     127
     128  if ((vecLength > 0) && (availableEnergy > 1.))
     129    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     130                                  pv, vecLength,
     131                                  incidentParticle, targetParticle);
     132
     133  HighEnergyCascading(successful, pv, vecLength,
     134                      excitationEnergyGNP, excitationEnergyDTA,
     135                      incidentParticle, targetParticle,
     136                      atomicWeight, atomicNumber);
     137  if (!successful)
     138    HighEnergyClusterProduction(successful, pv, vecLength,
     139                                excitationEnergyGNP, excitationEnergyDTA,
     140                                incidentParticle, targetParticle,
     141                                atomicWeight, atomicNumber);
     142  if (!successful)
     143    MediumEnergyCascading(successful, pv, vecLength,
     144                          excitationEnergyGNP, excitationEnergyDTA,
     145                          incidentParticle, targetParticle,
     146                          atomicWeight, atomicNumber);
     147
     148  if (!successful)
     149    MediumEnergyClusterProduction(successful, pv, vecLength,
     150                                  excitationEnergyGNP, excitationEnergyDTA,       
     151                                  incidentParticle, targetParticle,
     152                                  atomicWeight, atomicNumber);
     153  if (!successful)
     154    QuasiElasticScattering(successful, pv, vecLength,
     155                           excitationEnergyGNP, excitationEnergyDTA,
     156                           incidentParticle, targetParticle,
     157                           atomicWeight, atomicNumber);
     158  if (!successful)
     159    ElasticScattering(successful, pv, vecLength,
     160                      incidentParticle,   
     161                      atomicWeight, atomicNumber);
     162
     163  if (!successful)
     164    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     165           << G4endl;
     166
     167  FillParticleChange(pv, vecLength);
     168  delete [] pv;
     169  theParticleChange.SetStatusChange(stopAndKill);
     170  return &theParticleChange;
     171}
     172
    194173
    195174void
    196 G4HEPionPlusInelastic::FirstIntInCasPionPlus( G4bool &inElastic,
    197                                               const G4double availableEnergy,
    198                                               G4HEVector pv[],
    199                                               G4int &vecLen,
    200                                               G4HEVector incidentParticle,
    201                                               G4HEVector targetParticle,
    202                                               const G4double atomicWeight)
     175G4HEPionPlusInelastic::FirstIntInCasPionPlus(G4bool& inElastic,
     176                                             const G4double availableEnergy,
     177                                             G4HEVector pv[],
     178                                             G4int& vecLen,
     179                                             const G4HEVector& incidentParticle,
     180                                             const G4HEVector& targetParticle,
     181                                             const G4double atomicWeight)
    203182
    204183// Pion+ undergoes interaction with nucleon within a nucleus.  Check if it is
     
    209188// protons/neutrons by kaons or strange baryons according to the average
    210189// multiplicity per inelastic reaction.
    211 
    212  {
    213    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    214    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    215 
    216    static const G4double protb = 0.7;
    217    static const G4double neutb = 0.7;
    218    static const G4double     c = 1.25;
    219 
    220    static const G4int   numMul = 1200;
    221    static const G4int   numSec = 60;
    222 
    223    G4int              neutronCode = Neutron.getCode();
    224    G4int              protonCode  = Proton.getCode();
    225    G4double           pionMass    = PionPlus.getMass();
    226 
    227    G4int               targetCode = targetParticle.getCode();
    228 //   G4double          incidentMass = incidentParticle.getMass();
    229 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    230    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    231 
    232    static G4bool first = true;
    233    static G4double protmul[numMul], protnorm[numSec];  // proton constants
    234    static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
    235 
    236 //                                misc. local variables
    237 //                                np = number of pi+,  nm = number of pi-,  nz = number of pi0
    238 
    239    G4int i, counter, nt, np, nm, nz;
     190{
     191  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     192  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     193
     194  static const G4double protb = 0.7;
     195  static const G4double neutb = 0.7;
     196  static const G4double     c = 1.25;
     197
     198  static const G4int numMul = 1200;
     199  static const G4int numSec = 60;
     200
     201  G4int neutronCode = Neutron.getCode();
     202  G4int protonCode = Proton.getCode();
     203  G4double pionMass = PionPlus.getMass();
     204
     205  G4int targetCode = targetParticle.getCode();
     206  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     207
     208  static G4bool first = true;
     209  static G4double protmul[numMul], protnorm[numSec];  // proton constants
     210  static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
     211
     212  // misc. local variables
     213  // np = number of pi+,  nm = number of pi-,  nz = number of pi0
     214
     215  G4int i, counter, nt, np, nm, nz;
    240216
    241217   if( first )
    242      {                         // compute normalization constants, this will only be done once
     218     {   // compute normalization constants, this will only be done once
    243219       first = false;
    244220       for( i=0; i<numMul; i++ )protmul[i]  = 0.0;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEProtonInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HEProtonInelastic.cc,v 1.14 2008/03/17 20:49:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HEProtonInelastic.cc,v 1.16 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     35// and the low energy two-body model. Not included are the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest. 
    4138// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4239// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4542#include "G4HEProtonInelastic.hh"
    4643
    47 G4HadFinalState *  G4HEProtonInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double A = targetNucleus.GetN();
    54     const G4double Z = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
     44G4HadFinalState*
     45G4HEProtonInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     46                                   G4Nucleus& targetNucleus)
     47{
     48  G4HEVector* pv = new G4HEVector[MAXPART];
     49  const G4HadProjectile* aParticle = &aTrack;
     50  const G4double A = targetNucleus.GetN();
     51  const G4double Z = targetNucleus.GetZ();
     52  G4HEVector incidentParticle(aParticle);
    5653     
    57     G4double atomicNumber = Z;
    58     G4double atomicWeight = A;
    59 
    60     if(verboseLevel > 1)
    61       G4cout << "Z , A = " << atomicNumber << "  " << atomicWeight << G4endl;
    62 
    63     G4int    incidentCode          = incidentParticle.getCode();
    64     G4double incidentMass          = incidentParticle.getMass();
    65     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    66     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    67     G4double incidentKineticEnergy = incidentParticle.getKineticEnergy();
    68 
    69     if(incidentKineticEnergy < 1.)
    70       {
    71         G4cout << "GHEProtonInelastic: incident energy < 1 GeV" << G4endl;
    72       }
    73     if(verboseLevel > 1)
    74       {
    75         G4cout << "G4HEProtonInelastic::ApplyYourself" << G4endl;
    76         G4cout << "incident particle " << incidentParticle.getName() << " "
    77              << "mass "              << incidentMass << " "
    78              << "kinetic energy "    << incidentKineticEnergy
    79              << G4endl;
    80         G4cout << "target material with (A,Z) = ("
    81              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    82       }
     54  G4double atomicNumber = Z;
     55  G4double atomicWeight = A;
     56
     57  if (verboseLevel > 1)
     58    G4cout << "Z , A = " << atomicNumber << "  " << atomicWeight << G4endl;
     59
     60  G4int incidentCode = incidentParticle.getCode();
     61  G4double incidentMass = incidentParticle.getMass();
     62  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     63  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     64  G4double incidentKineticEnergy = incidentParticle.getKineticEnergy();
     65
     66  if (incidentKineticEnergy < 1.)
     67    G4cout << "GHEProtonInelastic: incident energy < 1 GeV" << G4endl;
     68
     69  if (verboseLevel > 1) {
     70    G4cout << "G4HEProtonInelastic::ApplyYourself" << G4endl;
     71    G4cout << "incident particle " << incidentParticle.getName() << " "
     72           << "mass "              << incidentMass << " "
     73           << "kinetic energy "    << incidentKineticEnergy
     74           << G4endl;
     75    G4cout << "target material with (A,Z) = ("
     76           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     77  }
    8378   
    84     G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
    85                                                  atomicWeight, atomicNumber);
    86     if(verboseLevel > 1)
    87         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    88 
    89     incidentKineticEnergy -= inelasticity;
     79  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     80                                              atomicWeight, atomicNumber);
     81  if (verboseLevel > 1)
     82    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     83
     84  incidentKineticEnergy -= inelasticity;
    9085   
    91     G4double excitationEnergyGNP = 0.;
    92     G4double excitationEnergyDTA = 0.;
    93 
    94     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    95                                                atomicWeight, atomicNumber,
    96                                                excitationEnergyGNP,
    97                                                excitationEnergyDTA);
    98 
    99     if(verboseLevel > 1)
    100       G4cout << "nuclear excitation = " << excitation << " " << excitationEnergyGNP << " "
    101            << excitationEnergyDTA << G4endl;             
    102 
    103 
    104     incidentKineticEnergy -= excitation;
    105     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    106     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    107                                   *(incidentTotalEnergy+incidentMass));
    108 
    109 
    110     G4HEVector targetParticle;
    111     if(G4UniformRand() < atomicNumber/atomicWeight)
    112       {
    113         targetParticle.setDefinition("Proton");
    114       }
    115     else
    116       {
    117         targetParticle.setDefinition("Neutron");
    118       }
    119 
    120     G4double targetMass         = targetParticle.getMass();
    121     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    122                                        + 2.0*targetMass*incidentTotalEnergy);
    123     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    124 
    125                                                                 // this was the meaning of inElastic in the
    126                                                                 // original Gheisha stand-alone version.
    127 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    128 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    129                                                                 // by unknown reasons, it has been replaced
    130                                                                 // to the following code in Geant???
    131     G4bool inElastic = true;
    132 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    133 
    134     vecLength = 0;           
     86  G4double excitationEnergyGNP = 0.;
     87  G4double excitationEnergyDTA = 0.;
     88
     89  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     90                                          atomicWeight, atomicNumber,
     91                                          excitationEnergyGNP,
     92                                          excitationEnergyDTA);
     93
     94  if (verboseLevel > 1)
     95    G4cout << "nuclear excitation = " << excitation << " "
     96           << excitationEnergyGNP << " " << excitationEnergyDTA << G4endl;             
     97
     98  incidentKineticEnergy -= excitation;
     99  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     100  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)
     101                                    *(incidentTotalEnergy+incidentMass));
     102
     103  G4HEVector targetParticle;
     104  if (G4UniformRand() < atomicNumber/atomicWeight) {
     105    targetParticle.setDefinition("Proton");
     106  } else {
     107    targetParticle.setDefinition("Neutron");
     108  }
     109
     110  G4double targetMass = targetParticle.getMass();
     111  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     112                                        + targetMass*targetMass
     113                                        + 2.0*targetMass*incidentTotalEnergy);
     114  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     115
     116  // In the original Gheisha code, the inElastic flag was defined as follows:
     117  //   G4bool inElastic = InElasticCrossSectionInFirstInt
     118  //              (availableEnergy, incidentCode, incidentTotalMomentum);
     119  // For unknown reasons, it was replaced by the following code in Geant???
     120
     121  G4bool inElastic = true;
     122  //  if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
     123
     124  vecLength = 0;
    135125       
    136     if(verboseLevel > 1)
    137       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     126  if (verboseLevel > 1)
     127    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    138128           << incidentCode << G4endl;
    139129
    140     G4bool successful = false;
     130  G4bool successful = false;
    141131   
    142     if(inElastic || (!inElastic && atomicWeight < 1.5))
    143       {
    144         FirstIntInCasProton(inElastic, availableEnergy, pv, vecLength,
    145                             incidentParticle, targetParticle, atomicWeight);
    146 
    147         if(verboseLevel > 1)
    148            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    149 
    150 
    151         if ((vecLength > 0) && (availableEnergy > 1.))
    152                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    153                                                   pv, vecLength,
    154                                                   incidentParticle, targetParticle);
    155             HighEnergyCascading( successful, pv, vecLength,
    156                                  excitationEnergyGNP, excitationEnergyDTA,
    157                                  incidentParticle, targetParticle,
    158                                  atomicWeight, atomicNumber);
    159         if (!successful)
    160             HighEnergyClusterProduction( successful, pv, vecLength,
    161                                          excitationEnergyGNP, excitationEnergyDTA,
    162                                          incidentParticle, targetParticle,
    163                                          atomicWeight, atomicNumber);
    164         if (!successful)
    165             MediumEnergyCascading( successful, pv, vecLength,
    166                                    excitationEnergyGNP, excitationEnergyDTA,
    167                                    incidentParticle, targetParticle,
    168                                    atomicWeight, atomicNumber);
    169 
    170         if (!successful)
    171             MediumEnergyClusterProduction( successful, pv, vecLength,
    172                                            excitationEnergyGNP, excitationEnergyDTA,       
    173                                            incidentParticle, targetParticle,
    174                                            atomicWeight, atomicNumber);
    175         if (!successful)
    176             QuasiElasticScattering( successful, pv, vecLength,
    177                                     excitationEnergyGNP, excitationEnergyDTA,
    178                                     incidentParticle, targetParticle,
    179                                     atomicWeight, atomicNumber);
    180       }
    181     if (!successful)
    182       {
    183             ElasticScattering( successful, pv, vecLength,
    184                                incidentParticle,   
    185                                atomicWeight, atomicNumber);
    186       }
    187 
    188     if (!successful)
    189       {
    190         G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles" << G4endl;
    191       }
    192       FillParticleChange(pv,  vecLength);
    193       delete [] pv;
    194       theParticleChange.SetStatusChange(stopAndKill);
    195       return & theParticleChange;
    196   }
     132  FirstIntInCasProton(inElastic, availableEnergy, pv, vecLength,
     133                      incidentParticle, targetParticle, atomicWeight);
     134
     135  if (verboseLevel > 1)
     136    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl;
     137
     138  if ((vecLength > 0) && (availableEnergy > 1.))
     139    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     140                                  pv, vecLength,
     141                                  incidentParticle, targetParticle);
     142
     143  HighEnergyCascading(successful, pv, vecLength,
     144                      excitationEnergyGNP, excitationEnergyDTA,
     145                      incidentParticle, targetParticle,
     146                      atomicWeight, atomicNumber);
     147  if (!successful)
     148    HighEnergyClusterProduction(successful, pv, vecLength,
     149                                excitationEnergyGNP, excitationEnergyDTA,
     150                                incidentParticle, targetParticle,
     151                                atomicWeight, atomicNumber);
     152  if (!successful)
     153    MediumEnergyCascading(successful, pv, vecLength,
     154                          excitationEnergyGNP, excitationEnergyDTA,
     155                          incidentParticle, targetParticle,
     156                          atomicWeight, atomicNumber);
     157
     158  if (!successful)
     159    MediumEnergyClusterProduction(successful, pv, vecLength,
     160                                  excitationEnergyGNP, excitationEnergyDTA,       
     161                                  incidentParticle, targetParticle,
     162                                  atomicWeight, atomicNumber);
     163  if (!successful)
     164    QuasiElasticScattering(successful, pv, vecLength,
     165                           excitationEnergyGNP, excitationEnergyDTA,
     166                           incidentParticle, targetParticle,
     167                           atomicWeight, atomicNumber);
     168  if (!successful)
     169    ElasticScattering(successful, pv, vecLength,
     170                      incidentParticle,   
     171                      atomicWeight, atomicNumber);
     172
     173  if (!successful)
     174    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     175           << G4endl;
     176
     177  FillParticleChange(pv, vecLength);
     178  delete [] pv;
     179  theParticleChange.SetStatusChange(stopAndKill);
     180  return &theParticleChange;
     181}
     182
    197183
    198184void
    199 G4HEProtonInelastic::FirstIntInCasProton( G4bool &inElastic,
    200                                           const G4double availableEnergy,
    201                                           G4HEVector pv[],
    202                                           G4int &vecLen,
    203                                           G4HEVector incidentParticle,
    204                                           G4HEVector targetParticle,
    205                                           const G4double atomicWeight)
     185G4HEProtonInelastic::FirstIntInCasProton(G4bool& inElastic,
     186                                         const G4double availableEnergy,
     187                                         G4HEVector pv[],
     188                                         G4int& vecLen,
     189                                         const G4HEVector& incidentParticle,
     190                                         const G4HEVector& targetParticle,
     191                                         const G4double atomicWeight)
    206192
    207193// Proton undergoes interaction with nucleon within a nucleus.  Check if it is
     
    212198// protons/neutrons by kaons or strange baryons according to the average
    213199// multiplicity per inelastic reaction.
    214 
    215  {
    216    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    217    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    218 
    219    static const G4double protb = 0.7;
    220    static const G4double neutb = 0.35;
    221    static const G4double     c = 1.25;
    222 
    223    static const G4int   numMul = 1200;
    224    static const G4int   numSec = 60;
    225 
    226    G4int              neutronCode = Neutron.getCode();
    227    G4int              protonCode  = Proton.getCode();
    228    G4double           pionMass    = PionPlus.getMass();
    229 
    230    G4int               targetCode = targetParticle.getCode();
    231 //   G4double          incidentMass = incidentParticle.getMass();
    232 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    233    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    234 
    235    static G4bool first = true;
    236    static G4double protmul[numMul], protnorm[numSec];  // proton constants
    237    static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
    238 
    239                               //  misc. local variables
    240                               //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
    241 
    242    G4int i, counter, nt, np, nm, nz;
    243 
    244    if( first )
    245      {                         // compute normalization constants, this will only be done once
    246        first = false;
    247        for( i=0; i<numMul; i++ )protmul[i]  = 0.0;
    248        for( i=0; i<numSec; i++ )protnorm[i] = 0.0;
    249        counter = -1;
    250        for( np=0; np<(numSec/3); np++ )
    251           {
    252             for( nm=Imax(0,np-2); nm<=np; nm++ )
    253                {
    254                  for( nz=0; nz<numSec/3; nz++ )
    255                     {
    256                       if( ++counter < numMul )
    257                         {
    258                           nt = np+nm+nz;
    259                           if( (nt>0) && (nt<=numSec) )
    260                             {
    261                               protmul[counter] = pmltpc(np,nm,nz,nt,protb,c)
    262                                                  /(Factorial(2-np+nm)*Factorial(np-nm)) ;
    263                               protnorm[nt-1] += protmul[counter];
    264                             }
    265                         }
    266                     }
    267                }
     200{
     201  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     202  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     203
     204  static const G4double protb = 0.7;
     205  static const G4double neutb = 0.35;
     206  static const G4double     c = 1.25;
     207
     208  static const G4int numMul = 1200;
     209  static const G4int numSec = 60;
     210
     211  G4int neutronCode = Neutron.getCode();
     212  G4int protonCode = Proton.getCode();
     213  G4double pionMass = PionPlus.getMass();
     214
     215  G4int targetCode = targetParticle.getCode();
     216  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     217
     218  static G4bool first = true;
     219  static G4double protmul[numMul], protnorm[numSec];  // proton constants
     220  static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
     221
     222  //  misc. local variables
     223  //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
     224
     225  G4int i, counter, nt, np, nm, nz;
     226
     227  if (first) {
     228    // compute normalization constants, this will only be done once
     229    first = false;
     230    for (i=0; i<numMul; i++) protmul[i] = 0.0;
     231    for (i=0; i<numSec; i++) protnorm[i] = 0.0;
     232    counter = -1;
     233    for (np=0; np<(numSec/3); np++) {
     234      for (nm=Imax(0,np-2); nm<=np; nm++) {
     235        for (nz=0; nz<numSec/3; nz++) {
     236          if (++counter < numMul) {
     237            nt = np+nm+nz;
     238            if ( (nt>0) && (nt<=numSec) ) {
     239              protmul[counter] = pmltpc(np,nm,nz,nt,protb,c)
     240                                 /(Factorial(2-np+nm)*Factorial(np-nm)) ;
     241              protnorm[nt-1] += protmul[counter];
     242            }
    268243          }
    269        for( i=0; i<numMul; i++ )neutmul[i]  = 0.0;
    270        for( i=0; i<numSec; i++ )neutnorm[i] = 0.0;
    271        counter = -1;
    272        for( np=0; np<numSec/3; np++ )
    273           {
    274             for( nm=Imax(0,np-1); nm<=(np+1); nm++ )
    275                {
    276                  for( nz=0; nz<numSec/3; nz++ )
    277                     {
    278                       if( ++counter < numMul )
    279                         {
    280                           nt = np+nm+nz;
    281                           if( (nt>0) && (nt<=numSec) )
    282                             {
    283                                neutmul[counter] = pmltpc(np,nm,nz,nt,neutb,c)
    284                                                   /(Factorial(1-np+nm)*Factorial(1+np-nm));
    285                                neutnorm[nt-1] += neutmul[counter];
    286                             }
    287                         }
    288                     }
    289                }
     244        }
     245      }
     246    }
     247
     248    for( i=0; i<numMul; i++ )neutmul[i]  = 0.0;
     249    for( i=0; i<numSec; i++ )neutnorm[i] = 0.0;
     250    counter = -1;
     251    for (np=0; np<numSec/3; np++) {
     252      for (nm=Imax(0,np-1); nm<=(np+1); nm++) {
     253        for (nz=0; nz<numSec/3; nz++) {
     254          if (++counter < numMul) {
     255            nt = np+nm+nz;
     256            if ( (nt>0) && (nt<=numSec) ) {
     257              neutmul[counter] = pmltpc(np,nm,nz,nt,neutb,c)
     258                                 /(Factorial(1-np+nm)*Factorial(1+np-nm));
     259              neutnorm[nt-1] += neutmul[counter];
     260            }
    290261          }
    291        for( i=0; i<numSec; i++ )
    292           {
    293             if( protnorm[i] > 0.0 )protnorm[i] = 1.0/protnorm[i];
    294             if( neutnorm[i] > 0.0 )neutnorm[i] = 1.0/neutnorm[i];
    295           }
    296      }                                          // end of initialization
     262        }
     263      }
     264    }
     265    for (i=0; i<numSec; i++) {
     266      if( protnorm[i] > 0.0 )protnorm[i] = 1.0/protnorm[i];
     267      if( neutnorm[i] > 0.0 )neutnorm[i] = 1.0/neutnorm[i];
     268    }
     269  }                   // end of initialization
    297270
    298271         
    299                                               // initialize the first two places
    300                                               // the same as beam and target                                   
    301    pv[0] = incidentParticle;
    302    pv[1] = targetParticle;
    303    vecLen = 2;
     272  // initialize the first two places
     273  // the same as beam and target                                   
     274  pv[0] = incidentParticle;
     275  pv[1] = targetParticle;
     276  vecLen = 2;
    304277
    305278   if( !inElastic )
  • trunk/source/processes/hadronic/models/high_energy/src/G4HESigmaMinusInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HESigmaMinusInelastic.cc,v 1.15 2008/03/17 20:49:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HESigmaMinusInelastic.cc,v 1.17 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     35// and the low energy two-body model. Not included are the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest. 
    4138// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4239// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4542#include "G4HESigmaMinusInelastic.hh"
    4643
    47 G4HadFinalState *  G4HESigmaMinusInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double A = targetNucleus.GetN();
    54     const G4double Z = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
     44G4HadFinalState*
     45G4HESigmaMinusInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     46                                       G4Nucleus& targetNucleus)
     47{
     48  G4HEVector* pv = new G4HEVector[MAXPART];
     49  const G4HadProjectile* aParticle = &aTrack;
     50  const G4double A = targetNucleus.GetN();
     51  const G4double Z = targetNucleus.GetZ();
     52  G4HEVector incidentParticle(aParticle);
    5653     
    57     G4double atomicNumber = Z;
    58     G4double atomicWeight = A;
    59 
    60     G4int    incidentCode          = incidentParticle.getCode();
    61     G4double incidentMass          = incidentParticle.getMass();
    62     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    63     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    64     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    65 
    66     if(incidentKineticEnergy < 1.)
    67       {
    68         G4cout << "GHESigmaMinusInelastic: incident energy < 1 GeV" << G4endl;
    69       }
    70     if(verboseLevel > 1)
    71       {
    72         G4cout << "G4HESigmaMinusInelastic::ApplyYourself" << G4endl;
    73         G4cout << "incident particle " << incidentParticle.getName()
    74              << "mass "              << incidentMass
    75              << "kinetic energy "    << incidentKineticEnergy
    76              << G4endl;
    77         G4cout << "target material with (A,Z) = ("
    78              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    79       }
    80 
    81     G4double inelasticity  = NuclearInelasticity(incidentKineticEnergy,
    82                                                  atomicWeight, atomicNumber);
    83     if(verboseLevel > 1)
    84         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    85 
    86     incidentKineticEnergy -= inelasticity;
     54  G4double atomicNumber = Z;
     55  G4double atomicWeight = A;
     56
     57  G4int incidentCode = incidentParticle.getCode();
     58  G4double incidentMass = incidentParticle.getMass();
     59  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     60  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     61  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     62
     63  if (incidentKineticEnergy < 1.)
     64    G4cout << "GHESigmaMinusInelastic: incident energy < 1 GeV" << G4endl;
     65
     66  if (verboseLevel > 1) {
     67    G4cout << "G4HESigmaMinusInelastic::ApplyYourself" << G4endl;
     68    G4cout << "incident particle " << incidentParticle.getName()
     69           << "mass "              << incidentMass
     70           << "kinetic energy "    << incidentKineticEnergy
     71           << G4endl;
     72    G4cout << "target material with (A,Z) = ("
     73           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     74  }
     75
     76  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     77                                              atomicWeight, atomicNumber);
     78  if (verboseLevel > 1)
     79    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     80
     81  incidentKineticEnergy -= inelasticity;
    8782   
    88     G4double excitationEnergyGNP = 0.;
    89     G4double excitationEnergyDTA = 0.;
    90 
    91     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    92                                                atomicWeight, atomicNumber,
    93                                                excitationEnergyGNP,
    94                                                excitationEnergyDTA);
    95     if(verboseLevel > 1)
    96       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    97            << excitationEnergyDTA << G4endl;             
    98 
    99 
    100     incidentKineticEnergy -= excitation;
    101     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    102     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    103                                   *(incidentTotalEnergy+incidentMass));
    104 
    105 
    106     G4HEVector targetParticle;
    107     if(G4UniformRand() < atomicNumber/atomicWeight)
    108       {
    109         targetParticle.setDefinition("Proton");
    110       }
    111     else
    112       {
    113         targetParticle.setDefinition("Neutron");
    114       }
    115 
    116     G4double targetMass         = targetParticle.getMass();
    117     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    118                                        + 2.0*targetMass*incidentTotalEnergy);
    119     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    120 
    121                                                                 // this was the meaning of inElastic in the
    122                                                                 // original Gheisha stand-alone version.
    123 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    124 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    125                                                                 // by unknown reasons, it has been replaced
    126                                                                 // to the following code in Geant???
    127     G4bool inElastic = true;
    128 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    129 
    130     vecLength = 0;           
     83  G4double excitationEnergyGNP = 0.;
     84  G4double excitationEnergyDTA = 0.;
     85
     86  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     87                                          atomicWeight, atomicNumber,
     88                                          excitationEnergyGNP,
     89                                          excitationEnergyDTA);
     90  if (verboseLevel > 1)
     91    G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     92           << excitationEnergyDTA << G4endl;
     93
     94  incidentKineticEnergy -= excitation;
     95  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     96  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)
     97                                    *(incidentTotalEnergy+incidentMass));
     98
     99  G4HEVector targetParticle;
     100  if (G4UniformRand() < atomicNumber/atomicWeight) {
     101    targetParticle.setDefinition("Proton");
     102  } else {
     103    targetParticle.setDefinition("Neutron");
     104  }
     105
     106  G4double targetMass = targetParticle.getMass();
     107  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     108                                        + targetMass*targetMass
     109                                        + 2.0*targetMass*incidentTotalEnergy);
     110  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     111
     112  G4bool inElastic = true;
     113  vecLength = 0;
    131114       
    132     if(verboseLevel > 1)
    133       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     115  if (verboseLevel > 1)
     116    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    134117           << incidentCode << G4endl;
    135118
    136     G4bool successful = false;
     119  G4bool successful = false;
    137120   
    138     if(inElastic || (!inElastic && atomicWeight < 1.5))
    139       {
    140         FirstIntInCasSigmaMinus(inElastic, availableEnergy, pv, vecLength,
    141                                 incidentParticle, targetParticle, atomicWeight);
    142 
    143         if(verboseLevel > 1)
    144            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    145 
    146 
    147         if ((vecLength > 0) && (availableEnergy > 1.))
    148                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    149                                                   pv, vecLength,
    150                                                   incidentParticle, targetParticle);
    151             HighEnergyCascading( successful, pv, vecLength,
    152                                  excitationEnergyGNP, excitationEnergyDTA,
    153                                  incidentParticle, targetParticle,
    154                                  atomicWeight, atomicNumber);
    155         if (!successful)
    156             HighEnergyClusterProduction( successful, pv, vecLength,
    157                                          excitationEnergyGNP, excitationEnergyDTA,
    158                                          incidentParticle, targetParticle,
    159                                          atomicWeight, atomicNumber);
    160         if (!successful)
    161             MediumEnergyCascading( successful, pv, vecLength,
    162                                    excitationEnergyGNP, excitationEnergyDTA,
    163                                    incidentParticle, targetParticle,
    164                                    atomicWeight, atomicNumber);
    165 
    166         if (!successful)
    167             MediumEnergyClusterProduction( successful, pv, vecLength,
    168                                            excitationEnergyGNP, excitationEnergyDTA,       
    169                                            incidentParticle, targetParticle,
    170                                            atomicWeight, atomicNumber);
    171         if (!successful)
    172             QuasiElasticScattering( successful, pv, vecLength,
    173                                     excitationEnergyGNP, excitationEnergyDTA,
    174                                     incidentParticle, targetParticle,
    175                                     atomicWeight, atomicNumber);
    176       }
    177     if (!successful)
    178       {
    179             ElasticScattering( successful, pv, vecLength,
    180                                incidentParticle,   
    181                                atomicWeight, atomicNumber);
    182       }
    183 
    184     if (!successful)
    185       {
    186         G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles" << G4endl;
    187       }
    188       FillParticleChange(pv,  vecLength);
    189       delete [] pv;
    190       theParticleChange.SetStatusChange(stopAndKill);
    191       return & theParticleChange;
    192   }
     121  FirstIntInCasSigmaMinus(inElastic, availableEnergy, pv, vecLength,
     122                          incidentParticle, targetParticle, atomicWeight);
     123
     124  if (verboseLevel > 1)
     125    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl;
     126
     127  if ((vecLength > 0) && (availableEnergy > 1.))
     128    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     129                                  pv, vecLength,
     130                                  incidentParticle, targetParticle);
     131
     132  HighEnergyCascading(successful, pv, vecLength,
     133                      excitationEnergyGNP, excitationEnergyDTA,
     134                      incidentParticle, targetParticle,
     135                      atomicWeight, atomicNumber);
     136  if (!successful)
     137    HighEnergyClusterProduction(successful, pv, vecLength,
     138                                excitationEnergyGNP, excitationEnergyDTA,
     139                                incidentParticle, targetParticle,
     140                                atomicWeight, atomicNumber);
     141  if (!successful)
     142    MediumEnergyCascading(successful, pv, vecLength,
     143                          excitationEnergyGNP, excitationEnergyDTA,
     144                          incidentParticle, targetParticle,
     145                          atomicWeight, atomicNumber);
     146
     147  if (!successful)
     148    MediumEnergyClusterProduction(successful, pv, vecLength,
     149                                  excitationEnergyGNP, excitationEnergyDTA,       
     150                                  incidentParticle, targetParticle,
     151                                  atomicWeight, atomicNumber);
     152  if (!successful)
     153    QuasiElasticScattering(successful, pv, vecLength,
     154                           excitationEnergyGNP, excitationEnergyDTA,
     155                           incidentParticle, targetParticle,
     156                           atomicWeight, atomicNumber);
     157  if (!successful)
     158    ElasticScattering(successful, pv, vecLength,
     159                      incidentParticle,   
     160                      atomicWeight, atomicNumber);
     161
     162  if (!successful)
     163    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     164           << G4endl;
     165
     166  FillParticleChange(pv, vecLength);
     167  delete [] pv;
     168  theParticleChange.SetStatusChange(stopAndKill);
     169  return &theParticleChange;
     170}
     171
    193172
    194173void
    195 G4HESigmaMinusInelastic::FirstIntInCasSigmaMinus( G4bool &inElastic,
    196                                                   const G4double availableEnergy,
    197                                                   G4HEVector pv[],
    198                                                   G4int &vecLen,
    199                                                   G4HEVector incidentParticle,
    200                                                   G4HEVector targetParticle,
    201                                                   const G4double atomicWeight)
     174G4HESigmaMinusInelastic::FirstIntInCasSigmaMinus(G4bool& inElastic,
     175                                                 const G4double availableEnergy,
     176                                                 G4HEVector pv[],
     177                                                 G4int& vecLen,
     178                                                 const G4HEVector& incidentParticle,
     179                                                 const G4HEVector& targetParticle,
     180                                                 const G4double atomicWeight)
    202181
    203182// Sigma- undergoes interaction with nucleon within a nucleus.  Check if it is
     
    208187// protons/neutrons by kaons or strange baryons according to the average
    209188// multiplicity per inelastic reaction.
    210 
    211  {
    212    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    213    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    214 
    215    static const G4double protb = 0.7;
    216    static const G4double neutb = 0.7;             
    217    static const G4double     c = 1.25;
    218 
    219    static const G4int   numMul = 1200;
    220    static const G4int   numSec = 60;
    221 
    222    G4int              neutronCode = Neutron.getCode();
    223    G4int              protonCode  = Proton.getCode();
    224 
    225    G4int               targetCode = targetParticle.getCode();
    226 //   G4double          incidentMass = incidentParticle.getMass();
    227 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    228    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    229 
    230    static G4bool first = true;
    231    static G4double protmul[numMul], protnorm[numSec];  // proton constants
    232    static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
    233 
    234                               //  misc. local variables
    235                               //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
    236 
    237    G4int i, counter, nt, np, nm, nz;
     189{
     190  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     191  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     192
     193  static const G4double protb = 0.7;
     194  static const G4double neutb = 0.7;             
     195  static const G4double     c = 1.25;
     196
     197  static const G4int numMul = 1200;
     198  static const G4int numSec = 60;
     199
     200  G4int neutronCode = Neutron.getCode();
     201  G4int protonCode = Proton.getCode();
     202
     203  G4int targetCode = targetParticle.getCode();
     204  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     205
     206  static G4bool first = true;
     207  static G4double protmul[numMul], protnorm[numSec];  // proton constants
     208  static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
     209
     210  //  misc. local variables
     211  //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
     212
     213  G4int i, counter, nt, np, nm, nz;
    238214
    239215   if( first )
    240      {                         // compute normalization constants, this will only be done once
     216     {     // compute normalization constants, this will only be done once
    241217       first = false;
    242218       for( i=0; i<numMul; i++ )protmul[i]  = 0.0;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HESigmaPlusInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HESigmaPlusInelastic.cc,v 1.15 2008/03/17 20:49:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HESigmaPlusInelastic.cc,v 1.17 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     35// and the low energy two-body model. Not included are the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest. 
    4138// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4239// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4542#include "G4HESigmaPlusInelastic.hh"
    4643
    47 G4HadFinalState *  G4HESigmaPlusInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double A = targetNucleus.GetN();
    54     const G4double Z = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
     44G4HadFinalState*
     45G4HESigmaPlusInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     46                                      G4Nucleus& targetNucleus)
     47{
     48  G4HEVector* pv = new G4HEVector[MAXPART];
     49  const G4HadProjectile* aParticle = &aTrack;
     50  const G4double A = targetNucleus.GetN();
     51  const G4double Z = targetNucleus.GetZ();
     52  G4HEVector incidentParticle(aParticle);
    5653     
    57     G4double atomicNumber = Z;
    58     G4double atomicWeight = A;
    59 
    60     G4int    incidentCode          = incidentParticle.getCode();
    61     G4double incidentMass          = incidentParticle.getMass();
    62     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    63     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    64     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    65 
    66     if(incidentKineticEnergy < 1.)
    67       {
    68         G4cout << "GHESigmaPlusInelastic: incident energy < 1 GeV" << G4endl;
    69       }
    70     if(verboseLevel > 1)
    71       {
    72         G4cout << "G4HESigmaPlusInelastic::ApplyYourself" << G4endl;
    73         G4cout << "incident particle " << incidentParticle.getName()
    74              << "mass "              << incidentMass
    75              << "kinetic energy "    << incidentKineticEnergy
    76              << G4endl;
    77         G4cout << "target material with (A,Z) = ("
    78              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    79       }
    80 
    81     G4double inelasticity  = NuclearInelasticity(incidentKineticEnergy,
    82                                                  atomicWeight, atomicNumber);
    83     if(verboseLevel > 1)
    84         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    85 
    86     incidentKineticEnergy -= inelasticity;
     54  G4double atomicNumber = Z;
     55  G4double atomicWeight = A;
     56
     57  G4int incidentCode = incidentParticle.getCode();
     58  G4double incidentMass = incidentParticle.getMass();
     59  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     60  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     61  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     62
     63  if (incidentKineticEnergy < 1.)
     64    G4cout << "GHESigmaPlusInelastic: incident energy < 1 GeV" << G4endl;
     65
     66  if (verboseLevel > 1) {
     67    G4cout << "G4HESigmaPlusInelastic::ApplyYourself" << G4endl;
     68    G4cout << "incident particle " << incidentParticle.getName()
     69           << "mass "              << incidentMass
     70           << "kinetic energy "    << incidentKineticEnergy
     71           << G4endl;
     72    G4cout << "target material with (A,Z) = ("
     73           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     74  }
     75
     76  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     77                                              atomicWeight, atomicNumber);
     78  if (verboseLevel > 1)
     79    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     80
     81  incidentKineticEnergy -= inelasticity;
    8782   
    88     G4double excitationEnergyGNP = 0.;
    89     G4double excitationEnergyDTA = 0.;
    90 
    91     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    92                                                atomicWeight, atomicNumber,
    93                                                excitationEnergyGNP,
    94                                                excitationEnergyDTA);
    95     if(verboseLevel > 1)
    96       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    97            << excitationEnergyDTA << G4endl;             
    98 
    99 
    100     incidentKineticEnergy -= excitation;
    101     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    102     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    103                                   *(incidentTotalEnergy+incidentMass));
    104 
    105 
    106     G4HEVector targetParticle;
    107     if(G4UniformRand() < atomicNumber/atomicWeight)
    108       {
    109         targetParticle.setDefinition("Proton");
    110       }
    111     else
    112       {
    113         targetParticle.setDefinition("Neutron");
    114       }
    115 
    116     G4double targetMass         = targetParticle.getMass();
    117     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    118                                        + 2.0*targetMass*incidentTotalEnergy);
    119     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    120 
    121                                                                 // this was the meaning of inElastic in the
    122                                                                 // original Gheisha stand-alone version.
    123 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    124 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    125                                                                 // by unknown reasons, it has been replaced
    126                                                                 // to the following code in Geant???
    127     G4bool inElastic = true;
    128 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    129 
    130     vecLength  = 0;           
     83  G4double excitationEnergyGNP = 0.;
     84  G4double excitationEnergyDTA = 0.;
     85
     86  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     87                                          atomicWeight, atomicNumber,
     88                                          excitationEnergyGNP,
     89                                          excitationEnergyDTA);
     90  if (verboseLevel > 1)
     91    G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     92           << excitationEnergyDTA << G4endl;
     93
     94  incidentKineticEnergy -= excitation;
     95  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     96  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)
     97                                    *(incidentTotalEnergy+incidentMass));
     98
     99  G4HEVector targetParticle;
     100  if (G4UniformRand() < atomicNumber/atomicWeight) {
     101    targetParticle.setDefinition("Proton");
     102  } else {
     103    targetParticle.setDefinition("Neutron");
     104  }
     105
     106  G4double targetMass = targetParticle.getMass();
     107  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     108                                        + targetMass*targetMass
     109                                        + 2.0*targetMass*incidentTotalEnergy);
     110  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     111
     112  G4bool inElastic = true;
     113  vecLength = 0;
    131114       
    132     if(verboseLevel > 1)
    133       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     115  if (verboseLevel > 1)
     116    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    134117           << incidentCode << G4endl;
    135118
    136     G4bool successful = false;
     119  G4bool successful = false;
    137120   
    138     if(inElastic || (!inElastic && atomicWeight < 1.5))
    139       {
    140         FirstIntInCasSigmaPlus(inElastic, availableEnergy, pv, vecLength,
    141                                incidentParticle, targetParticle, atomicWeight);
    142 
    143         if(verboseLevel > 1)
    144            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    145 
    146 
    147         if ((vecLength > 0) && (availableEnergy > 1.))
    148                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    149                                                   pv, vecLength,
    150                                                   incidentParticle, targetParticle);
    151             HighEnergyCascading( successful, pv, vecLength,
    152                                  excitationEnergyGNP, excitationEnergyDTA,
    153                                  incidentParticle, targetParticle,
    154                                  atomicWeight, atomicNumber);
    155         if (!successful)
    156             HighEnergyClusterProduction( successful, pv, vecLength,
    157                                          excitationEnergyGNP, excitationEnergyDTA,
    158                                          incidentParticle, targetParticle,
    159                                          atomicWeight, atomicNumber);
    160         if (!successful)
    161             MediumEnergyCascading( successful, pv, vecLength,
    162                                    excitationEnergyGNP, excitationEnergyDTA,
    163                                    incidentParticle, targetParticle,
    164                                    atomicWeight, atomicNumber);
    165 
    166         if (!successful)
    167             MediumEnergyClusterProduction( successful, pv, vecLength,
    168                                            excitationEnergyGNP, excitationEnergyDTA,       
    169                                            incidentParticle, targetParticle,
    170                                            atomicWeight, atomicNumber);
    171         if (!successful)
    172             QuasiElasticScattering( successful, pv, vecLength,
    173                                     excitationEnergyGNP, excitationEnergyDTA,
    174                                     incidentParticle, targetParticle,
    175                                     atomicWeight, atomicNumber);
    176       }
    177     if (!successful)
    178       {
    179             ElasticScattering( successful, pv, vecLength,
    180                                incidentParticle,   
    181                                atomicWeight, atomicNumber);
    182       }
    183 
    184     if (!successful)
    185       {
    186         G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles" << G4endl;
    187       }
    188       FillParticleChange(pv,  vecLength);
    189       delete [] pv;
    190       theParticleChange.SetStatusChange(stopAndKill);
    191       return & theParticleChange;
    192   }
     121  FirstIntInCasSigmaPlus(inElastic, availableEnergy, pv, vecLength,
     122                         incidentParticle, targetParticle, atomicWeight);
     123
     124  if (verboseLevel > 1)
     125    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl;
     126
     127  if ((vecLength > 0) && (availableEnergy > 1.))
     128    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     129                                  pv, vecLength,
     130                                  incidentParticle, targetParticle);
     131
     132  HighEnergyCascading(successful, pv, vecLength,
     133                      excitationEnergyGNP, excitationEnergyDTA,
     134                      incidentParticle, targetParticle,
     135                      atomicWeight, atomicNumber);
     136  if (!successful)
     137    HighEnergyClusterProduction(successful, pv, vecLength,
     138                                excitationEnergyGNP, excitationEnergyDTA,
     139                                incidentParticle, targetParticle,
     140                                atomicWeight, atomicNumber);
     141  if (!successful)
     142    MediumEnergyCascading(successful, pv, vecLength,
     143                          excitationEnergyGNP, excitationEnergyDTA,
     144                          incidentParticle, targetParticle,
     145                          atomicWeight, atomicNumber);
     146
     147  if (!successful)
     148    MediumEnergyClusterProduction(successful, pv, vecLength,
     149                                  excitationEnergyGNP, excitationEnergyDTA,       
     150                                  incidentParticle, targetParticle,
     151                                  atomicWeight, atomicNumber);
     152  if (!successful)
     153    QuasiElasticScattering(successful, pv, vecLength,
     154                           excitationEnergyGNP, excitationEnergyDTA,
     155                           incidentParticle, targetParticle,
     156                           atomicWeight, atomicNumber);
     157  if (!successful)
     158    ElasticScattering(successful, pv, vecLength,
     159                      incidentParticle,   
     160                      atomicWeight, atomicNumber);
     161
     162  if (!successful)
     163    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     164           << G4endl;
     165
     166  FillParticleChange(pv, vecLength);
     167  delete [] pv;
     168  theParticleChange.SetStatusChange(stopAndKill);
     169  return &theParticleChange;
     170}
     171
    193172
    194173void
    195 G4HESigmaPlusInelastic::FirstIntInCasSigmaPlus( G4bool &inElastic,
    196                                                 const G4double availableEnergy,
    197                                                 G4HEVector pv[],
    198                                                 G4int &vecLen,
    199                                                 G4HEVector incidentParticle,
    200                                                 G4HEVector targetParticle,
    201                                                 const G4double atomicWeight)
     174G4HESigmaPlusInelastic::FirstIntInCasSigmaPlus(G4bool& inElastic,
     175                                               const G4double availableEnergy,
     176                                               G4HEVector pv[],
     177                                               G4int& vecLen,
     178                                               const G4HEVector& incidentParticle,
     179                                               const G4HEVector& targetParticle,
     180                                               const G4double atomicWeight)
    202181
    203182// Sigma+ undergoes interaction with nucleon within a nucleus.  Check if it is
     
    208187// protons/neutrons by kaons or strange baryons according to the average
    209188// multiplicity per inelastic reaction.
    210 
    211  {
    212    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    213    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    214 
    215    static const G4double protb = 0.7;
    216    static const G4double neutb = 0.7;             
    217    static const G4double     c = 1.25;
    218 
    219    static const G4int   numMul = 1200;
    220    static const G4int   numSec = 60;
    221 
    222 //   G4int              neutronCode = Neutron.getCode();
    223    G4int              protonCode  = Proton.getCode();
    224 
    225    G4int               targetCode = targetParticle.getCode();
    226 //   G4double          incidentMass = incidentParticle.getMass();
    227 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    228    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    229 
    230    static G4bool first = true;
    231    static G4double protmul[numMul], protnorm[numSec];  // proton constants
    232    static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
    233 
    234                               //  misc. local variables
    235                               //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
    236 
    237    G4int i, counter, nt, np, nm, nz;
     189{
     190  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     191  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     192
     193  static const G4double protb = 0.7;
     194  static const G4double neutb = 0.7;             
     195  static const G4double     c = 1.25;
     196
     197  static const G4int numMul = 1200;
     198  static const G4int numSec = 60;
     199
     200  G4int protonCode  = Proton.getCode();
     201
     202  G4int targetCode = targetParticle.getCode();
     203  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     204
     205  static G4bool first = true;
     206  static G4double protmul[numMul], protnorm[numSec];  // proton constants
     207  static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
     208
     209  //  misc. local variables
     210  //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
     211
     212  G4int i, counter, nt, np, nm, nz;
    238213
    239214   if( first )
    240      {                         // compute normalization constants, this will only be done once
     215     {   // compute normalization constants, this will only be done once
    241216       first = false;
    242217       for( i=0; i<numMul; i++ )protmul[i]  = 0.0;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HESigmaZeroInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HESigmaZeroInelastic.cc,v 1.11 2006/06/29 20:30:44 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HESigmaZeroInelastic.cc,v 1.12 2010/11/20 04:01:33 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     35// and the low energy two-body model. Not included are the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest. 
    4138// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4239// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4643#include "G4Gamma.hh"
    4744
    48 G4HadFinalState *  G4HESigmaZeroInelastic::
    49 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    50   {
    51     G4HEVector * pv = new G4HEVector[MAXPART];
    52     const G4HadProjectile *aParticle = &aTrack;
    53 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    54     G4HEVector incidentParticle(aParticle);
     45G4HadFinalState*
     46G4HESigmaZeroInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     47                                      G4Nucleus& targetNucleus)
     48{
     49  G4HEVector* pv = new G4HEVector[MAXPART];
     50  const G4HadProjectile* aParticle = &aTrack;
     51  G4HEVector incidentParticle(aParticle);
    5552     
    56     G4HELambdaInelastic theLambdaInelastic;
    57     theLambdaInelastic.SetMaxNumberOfSecondaries(MAXPART);
    58     theLambdaInelastic.SetVerboseLevel(verboseLevel);
     53  G4HELambdaInelastic theLambdaInelastic;
     54  theLambdaInelastic.SetMaxNumberOfSecondaries(MAXPART);
     55  theLambdaInelastic.SetVerboseLevel(verboseLevel);
    5956   
    60     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    61     G4double pgam = G4UniformRand()*incidentTotalMomentum*0.75;
    62     G4HEVector incidentLambda;
    63     incidentLambda.SmulAndUpdate( incidentParticle,
    64                                  (incidentTotalMomentum - pgam)/incidentTotalMomentum);                   
    65     G4DynamicParticle * aLambda = new G4DynamicParticle();
    66     aLambda->SetDefinition(G4Lambda::Lambda());
    67     aLambda->SetMomentum(incidentLambda.getMomentum());
    68     G4HadProjectile aLambdaTrack(*aLambda);
    69     G4HadFinalState * result = theLambdaInelastic.ApplyYourself(aLambdaTrack, targetNucleus);           
    70     vecLength = theLambdaInelastic.GetNumberOfSecondaries();
     57  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     58  G4double pgam = G4UniformRand()*incidentTotalMomentum*0.75;
     59  G4HEVector incidentLambda;
     60  incidentLambda.SmulAndUpdate(incidentParticle,
     61                      (incidentTotalMomentum - pgam)/incidentTotalMomentum);                   
     62  G4DynamicParticle* aLambda = new G4DynamicParticle();
     63  aLambda->SetDefinition(G4Lambda::Lambda());
     64  aLambda->SetMomentum(incidentLambda.getMomentum());
     65  G4HadProjectile aLambdaTrack(*aLambda);
     66  G4HadFinalState* result =
     67          theLambdaInelastic.ApplyYourself(aLambdaTrack, targetNucleus);               
     68  vecLength = theLambdaInelastic.GetNumberOfSecondaries();
    7169   
    72     pv[vecLength] = Gamma;
    73     pv[vecLength].setMomentum(incidentParticle.getMomentum());
    74     pv[vecLength].SmulAndUpdate( pv[vecLength],pgam/incidentTotalMomentum);
    75     G4DynamicParticle * aPhoton = new G4DynamicParticle();
    76     aPhoton->SetDefinition(G4Gamma::Gamma());
    77     aPhoton->SetMomentum(pv[vecLength].getMomentum());
    78     result->AddSecondary(aPhoton);
    79     delete [] pv;
    80     return result;
    81   }
    82        
     70  pv[vecLength] = Gamma;
     71  pv[vecLength].setMomentum(incidentParticle.getMomentum());
     72  pv[vecLength].SmulAndUpdate( pv[vecLength],pgam/incidentTotalMomentum);
     73  G4DynamicParticle* aPhoton = new G4DynamicParticle();
     74  aPhoton->SetDefinition(G4Gamma::Gamma());
     75  aPhoton->SetMomentum(pv[vecLength].getMomentum());
     76  result->AddSecondary(aPhoton);
     77  delete [] pv;
     78  return result;
     79}
    8380
    84 
    85 
    86 
    87 
    88 
    89 
    90 
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEVector.cc

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4HEVector.cc,v 1.20 2006/11/22 23:52:32 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4HEVector.cc,v 1.22 2010/11/29 05:44:44 dennis Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030//
     
    164164   }
    165165
    166 G4double
    167 G4HEVector::getTotalMomentum()
    168    {
    169      return std::sqrt(px*px + py*py + pz*pz);
    170    }
     166G4double G4HEVector::getTotalMomentum() const
     167{
     168  return std::sqrt(px*px + py*py + pz*pz);
     169}
    171170
    172171void
    173 G4HEVector::setMomentum( G4double x, G4double y, G4double z)
    174    {
    175      px = x;
    176      py = y;
    177      pz = z;
    178      return;
    179    }
    180 
    181 void
    182 G4HEVector::setMomentumAndUpdate( G4double x, G4double y, G4double z )
    183    {
    184      px = x;
    185      py = y;
    186      pz = z;
    187      energy        = std::sqrt(mass*mass + px*px + py*py + pz*pz);
    188      kineticEnergy = Amax(0.,energy-mass);
    189      return;
    190    }
    191 
    192 void
    193 G4HEVector::setMomentum( G4double x, G4double y )
    194    {
    195      px = x;
    196      py = y;
    197      return;
    198    }
     172G4HEVector::setMomentum(G4double x, G4double y, G4double z)
     173{
     174  px = x;
     175  py = y;
     176  pz = z;
     177  return;
     178}
     179
     180void
     181G4HEVector::setMomentumAndUpdate(G4double x, G4double y, G4double z)
     182{
     183  px = x;
     184  py = y;
     185  pz = z;
     186  energy = std::sqrt(mass*mass + px*px + py*py + pz*pz);
     187  kineticEnergy = Amax(0.,energy-mass);
     188  return;
     189}
     190
     191void
     192G4HEVector::setMomentum(G4double x, G4double y)
     193{
     194  px = x;
     195  py = y;
     196  return;
     197}
    199198
    200199void
     
    312311   }
    313312
    314 G4double
    315 G4HEVector::getEnergy()
    316    {
    317      return energy;
    318    }
    319 
    320 G4double
    321 G4HEVector::getKineticEnergy()
    322    {
    323      return kineticEnergy;
    324    }
     313G4double G4HEVector::getEnergy() const
     314{
     315  return energy;
     316}
     317
     318G4double G4HEVector::getKineticEnergy() const
     319{
     320  return kineticEnergy;
     321}
    325322
    326323void
     
    367364   }   
    368365
    369 G4double
    370 G4HEVector::getMass()
    371    {
    372      return mass;
    373    }
     366G4double G4HEVector::getMass() const
     367{
     368  return mass;
     369}
    374370
    375371void
     
    380376   }
    381377
    382 G4double
    383 G4HEVector::getCharge()
    384    {
    385      return charge;
    386    }
     378G4double G4HEVector::getCharge() const
     379{
     380  return charge;
     381}
    387382
    388383void
     
    433428   }
    434429
    435 G4int
    436 G4HEVector::getCode()
    437    {
    438      return code;
    439    }
    440 
    441 G4String
    442 G4HEVector::getName()
    443    {
    444      return particleName;
    445    }
    446 
    447 G4String
    448 G4HEVector::getType()
    449    {
    450      return particleType;
    451    }
     430G4int G4HEVector::getCode() const
     431{
     432  return code;
     433}
     434
     435G4String G4HEVector::getName() const
     436{
     437  return particleName;
     438}
     439
     440G4String G4HEVector::getType() const
     441{
     442  return particleType;
     443}
    452444 
    453 G4int
    454 G4HEVector::getBaryonNumber()
    455    {
    456      return baryon;
    457    }
    458 
    459 G4int
    460 G4HEVector::getStrangenessNumber()
    461    {
    462      return strangeness;
    463    }
     445G4int G4HEVector::getBaryonNumber() const
     446{
     447  return baryon;
     448}
     449
     450G4int G4HEVector::getStrangenessNumber() const
     451{
     452  return strangeness;
     453}
     454
    464455G4int
    465456G4HEVector::getQuarkContent(G4int flavor)
     
    589580   }
    590581
    591 G4double
    592 G4HEVector::CosAng( const G4HEVector & p )
    593    {
    594      G4double a = std::sqrt( (px*px + py*py + pz*pz)*(p.px*p.px + p.py*p.py + p.pz*p.pz) );
    595      if( a != 0.0 )
    596        {
    597          a = (px*p.px + py*p.py + pz*p.pz)/a;
    598          if( std::fabs(a) > 1.0 )
    599          {
    600            if(a<0.0) a=-1.0;
    601            else a=1.0;
    602          }   
    603        }
    604      return a;
    605    }
     582G4double G4HEVector::CosAng(const G4HEVector& p) const
     583{
     584  G4double a = std::sqrt( (px*px + py*py + pz*pz)*(p.px*p.px + p.py*p.py + p.pz*p.pz) );
     585  if (a != 0.0) {
     586    a = (px*p.px + py*p.py + pz*p.pz)/a;
     587    if (std::fabs(a) > 1.0) {
     588      if (a < 0.0) a = -1.0;
     589      else a = 1.0;
     590    }   
     591  }
     592  return a;
     593}
    606594
    607595G4double
     
    725713   }
    726714
    727 G4double
    728 G4HEVector::Length()
    729    {
    730      return  std::sqrt(px*px + py*py + pz*pz);
    731    }
     715G4double G4HEVector::Length() const
     716{
     717  return std::sqrt(px*px + py*py + pz*pz);
     718}
    732719
    733720void
     
    12971284}
    12981285
    1299 void
    1300 G4HEVector::Print( G4int L)
    1301    {
    1302      G4cout << "HEV: "
    1303           << L << " " << px << " " <<  py << " " <<  pz << " "
    1304           << energy << " " << mass << " " << charge << " "
    1305           << timeOfFlight << " " << side << " " << flag << " "
    1306           << code << " " << baryon << " " << particleName << G4endl;
    1307      /*
    1308      printf("HEV: %3d %6f.2 %6f.2 %6f.2 %6f.2 %6f.2 %3f.0 %4f.1 %3d
    1309              %3d %6d %6d %s \n", L, px, py, pz, energy, mass, charge,
    1310              timeOfFlight, side, flag, code, baryon, particleName);
    1311              */
    1312      return;                         
    1313    }
    1314 
     1286void G4HEVector::Print(G4int L) const
     1287{
     1288  G4cout << "HEV: "
     1289         << L << " " << px << " " <<  py << " " <<  pz << " "
     1290         << energy << " " << mass << " " << charge << " "
     1291         << timeOfFlight << " " << side << " " << flag << " "
     1292         << code << " " << baryon << " " << particleName << G4endl;
     1293  return;                         
     1294}
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEXiMinusInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HEXiMinusInelastic.cc,v 1.15 2008/03/17 20:49:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HEXiMinusInelastic.cc,v 1.17 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     35// and the low energy two-body model. Not included are the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest. 
    4138// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4239// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4542#include "G4HEXiMinusInelastic.hh"
    4643
    47 G4HadFinalState *  G4HEXiMinusInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double A = targetNucleus.GetN();
    54     const G4double Z = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
     44G4HadFinalState*
     45G4HEXiMinusInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     46                                    G4Nucleus& targetNucleus)
     47{
     48  G4HEVector* pv = new G4HEVector[MAXPART];
     49  const G4HadProjectile* aParticle = &aTrack;
     50  const G4double A = targetNucleus.GetN();
     51  const G4double Z = targetNucleus.GetZ();
     52  G4HEVector incidentParticle(aParticle);
    5653     
    57     G4double atomicNumber = Z;
    58     G4double atomicWeight = A;
    59 
    60     G4int    incidentCode          = incidentParticle.getCode();
    61     G4double incidentMass          = incidentParticle.getMass();
    62     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    63     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    64     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    65 
    66     if(incidentKineticEnergy < 1.)
    67       {
    68         G4cout << "GHEXiMinusInelastic: incident energy < 1 GeV" << G4endl;
    69       }
    70     if(verboseLevel > 1)
    71       {
    72         G4cout << "G4HEXiMinusInelastic::ApplyYourself" << G4endl;
    73         G4cout << "incident particle " << incidentParticle.getName()
    74              << "mass "              << incidentMass
    75              << "kinetic energy "    << incidentKineticEnergy
    76              << G4endl;
    77         G4cout << "target material with (A,Z) = ("
    78              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    79       }
     54  G4double atomicNumber = Z;
     55  G4double atomicWeight = A;
     56
     57  G4int incidentCode = incidentParticle.getCode();
     58  G4double incidentMass = incidentParticle.getMass();
     59  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     60  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     61  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     62
     63  if (incidentKineticEnergy < 1.)
     64    G4cout << "GHEXiMinusInelastic: incident energy < 1 GeV" << G4endl;
     65
     66  if (verboseLevel > 1) {
     67    G4cout << "G4HEXiMinusInelastic::ApplyYourself" << G4endl;
     68    G4cout << "incident particle " << incidentParticle.getName()
     69           << "mass "              << incidentMass
     70           << "kinetic energy "    << incidentKineticEnergy
     71           << G4endl;
     72    G4cout << "target material with (A,Z) = ("
     73           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     74  }
    8075   
    81     G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
    82                                                  atomicWeight, atomicNumber);
    83     if(verboseLevel > 1)
    84         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     76  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     77                                              atomicWeight, atomicNumber);
     78  if (verboseLevel > 1)
     79    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    8580   
    86     incidentKineticEnergy -= inelasticity;
     81  incidentKineticEnergy -= inelasticity;
    8782   
    88     G4double excitationEnergyGNP = 0.;
    89     G4double excitationEnergyDTA = 0.;
    90 
    91     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    92                                                atomicWeight, atomicNumber,
    93                                                excitationEnergyGNP,
    94                                                excitationEnergyDTA);
    95     if(verboseLevel > 1)
    96       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     83  G4double excitationEnergyGNP = 0.;
     84  G4double excitationEnergyDTA = 0.;
     85
     86  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     87                                          atomicWeight, atomicNumber,
     88                                          excitationEnergyGNP,
     89                                          excitationEnergyDTA);
     90  if (verboseLevel > 1)
     91    G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    9792           << excitationEnergyDTA << G4endl;             
    9893
    99 
    100     incidentKineticEnergy -= excitation;
    101     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    102     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    103                                   *(incidentTotalEnergy+incidentMass));
    104 
    105 
    106     G4HEVector targetParticle;
    107     if(G4UniformRand() < atomicNumber/atomicWeight)
    108       {
    109         targetParticle.setDefinition("Proton");
    110       }
    111     else
    112       {
    113         targetParticle.setDefinition("Neutron");
    114       }
    115 
    116     G4double targetMass         = targetParticle.getMass();
    117     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    118                                        + 2.0*targetMass*incidentTotalEnergy);
    119     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    120 
    121                                                                 // this was the meaning of inElastic in the
    122                                                                 // original Gheisha stand-alone version.
    123 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    124 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    125                                                                 // by unknown reasons, it has been replaced
    126                                                                 // to the following code in Geant???
    127     G4bool inElastic = true;
    128 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    129 
    130     vecLength = 0;           
     94  incidentKineticEnergy -= excitation;
     95  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     96  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)
     97                                    *(incidentTotalEnergy+incidentMass));
     98
     99  G4HEVector targetParticle;
     100  if (G4UniformRand() < atomicNumber/atomicWeight) {
     101    targetParticle.setDefinition("Proton");
     102  } else {
     103    targetParticle.setDefinition("Neutron");
     104  }
     105
     106  G4double targetMass = targetParticle.getMass();
     107  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     108                                        + targetMass*targetMass
     109                                        + 2.0*targetMass*incidentTotalEnergy);
     110  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     111
     112  G4bool inElastic = true;
     113  vecLength = 0;
    131114       
    132     if(verboseLevel > 1)
    133       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     115  if (verboseLevel > 1)
     116    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    134117           << incidentCode << G4endl;
    135118
    136     G4bool successful = false;
     119  G4bool successful = false;
    137120   
    138     if(inElastic || (!inElastic && atomicWeight < 1.5))
    139       {
    140         FirstIntInCasXiMinus(inElastic, availableEnergy, pv, vecLength,
    141                              incidentParticle, targetParticle, atomicWeight);
    142 
    143         if(verboseLevel > 1)
    144            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    145 
    146 
    147         if ((vecLength > 0) && (availableEnergy > 1.))
    148                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    149                                                   pv, vecLength,
    150                                                   incidentParticle, targetParticle);
    151             HighEnergyCascading( successful, pv, vecLength,
    152                                  excitationEnergyGNP, excitationEnergyDTA,
    153                                  incidentParticle, targetParticle,
    154                                  atomicWeight, atomicNumber);
    155         if (!successful)
    156             HighEnergyClusterProduction( successful, pv, vecLength,
    157                                          excitationEnergyGNP, excitationEnergyDTA,
    158                                          incidentParticle, targetParticle,
    159                                          atomicWeight, atomicNumber);
    160         if (!successful)
    161             MediumEnergyCascading( successful, pv, vecLength,
    162                                    excitationEnergyGNP, excitationEnergyDTA,
    163                                    incidentParticle, targetParticle,
    164                                    atomicWeight, atomicNumber);
    165 
    166         if (!successful)
    167             MediumEnergyClusterProduction( successful, pv, vecLength,
    168                                            excitationEnergyGNP, excitationEnergyDTA,       
    169                                            incidentParticle, targetParticle,
    170                                            atomicWeight, atomicNumber);
    171         if (!successful)
    172             QuasiElasticScattering( successful, pv, vecLength,
    173                                     excitationEnergyGNP, excitationEnergyDTA,
    174                                     incidentParticle, targetParticle,
    175                                     atomicWeight, atomicNumber);
    176       }
    177     if (!successful)
    178       {
    179             ElasticScattering( successful, pv, vecLength,
    180                                incidentParticle,   
    181                                atomicWeight, atomicNumber);
    182       }
    183 
    184     if (!successful)
    185       {
    186         G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles" << G4endl;
    187       }
    188       FillParticleChange(pv,  vecLength);
    189       delete [] pv;
    190       theParticleChange.SetStatusChange(stopAndKill);
    191       return & theParticleChange;
    192   }
     121  FirstIntInCasXiMinus(inElastic, availableEnergy, pv, vecLength,
     122                       incidentParticle, targetParticle, atomicWeight);
     123
     124  if (verboseLevel > 1)
     125    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl;
     126
     127  if ((vecLength > 0) && (availableEnergy > 1.))
     128    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     129                                  pv, vecLength,
     130                                  incidentParticle, targetParticle);
     131
     132  HighEnergyCascading(successful, pv, vecLength,
     133                      excitationEnergyGNP, excitationEnergyDTA,
     134                      incidentParticle, targetParticle,
     135                      atomicWeight, atomicNumber);
     136  if (!successful)
     137    HighEnergyClusterProduction(successful, pv, vecLength,
     138                                excitationEnergyGNP, excitationEnergyDTA,
     139                                incidentParticle, targetParticle,
     140                                atomicWeight, atomicNumber);
     141  if (!successful)
     142    MediumEnergyCascading(successful, pv, vecLength,
     143                          excitationEnergyGNP, excitationEnergyDTA,
     144                          incidentParticle, targetParticle,
     145                          atomicWeight, atomicNumber);
     146
     147  if (!successful)
     148    MediumEnergyClusterProduction(successful, pv, vecLength,
     149                                  excitationEnergyGNP, excitationEnergyDTA,       
     150                                  incidentParticle, targetParticle,
     151                                  atomicWeight, atomicNumber);
     152  if (!successful)
     153    QuasiElasticScattering(successful, pv, vecLength,
     154                           excitationEnergyGNP, excitationEnergyDTA,
     155                           incidentParticle, targetParticle,
     156                           atomicWeight, atomicNumber);
     157  if (!successful)
     158    ElasticScattering(successful, pv, vecLength,
     159                      incidentParticle,   
     160                      atomicWeight, atomicNumber);
     161
     162  if (!successful)
     163    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     164           << G4endl;
     165
     166  FillParticleChange(pv, vecLength);
     167  delete [] pv;
     168  theParticleChange.SetStatusChange(stopAndKill);
     169  return &theParticleChange;
     170}
     171
    193172
    194173void
    195 G4HEXiMinusInelastic::FirstIntInCasXiMinus( G4bool &inElastic,
    196                                             const G4double availableEnergy,
    197                                             G4HEVector pv[],
    198                                             G4int &vecLen,
    199                                             G4HEVector incidentParticle,
    200                                             G4HEVector targetParticle,
    201                                             const G4double atomicWeight)
     174G4HEXiMinusInelastic::FirstIntInCasXiMinus(G4bool& inElastic,
     175                                           const G4double availableEnergy,
     176                                           G4HEVector pv[],
     177                                           G4int& vecLen,
     178                                           const G4HEVector& incidentParticle,
     179                                           const G4HEVector& targetParticle,
     180                                           const G4double atomicWeight)
    202181
    203182// Xi0 undergoes interaction with nucleon within a nucleus.  Check if it is
     
    208187// protons/neutrons by kaons or strange baryons according to the average
    209188// multiplicity per inelastic reaction.
    210 
    211  {
    212    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    213    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    214 
    215    static const G4double protb = 0.7;
    216    static const G4double neutb = 0.7;             
    217    static const G4double     c = 1.25;
    218 
    219    static const G4int   numMul = 1200;
    220    static const G4int   numSec = 60;
    221 
    222    G4int              neutronCode = Neutron.getCode();
    223    G4int              protonCode  = Proton.getCode();
    224 
    225    G4int               targetCode = targetParticle.getCode();
    226 //   G4double          incidentMass = incidentParticle.getMass();
    227 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    228    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    229 
    230    static G4bool first = true;
    231    static G4double protmul[numMul], protnorm[numSec];  // proton constants
    232    static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
    233 
    234                               //  misc. local variables
    235                               //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
    236 
    237    G4int i, counter, nt, np, nm, nz;
     189{
     190  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     191  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     192
     193  static const G4double protb = 0.7;
     194  static const G4double neutb = 0.7;             
     195  static const G4double     c = 1.25;
     196
     197  static const G4int numMul = 1200;
     198  static const G4int numSec = 60;
     199
     200  G4int neutronCode = Neutron.getCode();
     201  G4int protonCode = Proton.getCode();
     202
     203  G4int targetCode = targetParticle.getCode();
     204  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     205
     206  static G4bool first = true;
     207  static G4double protmul[numMul], protnorm[numSec];  // proton constants
     208  static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
     209
     210  //  misc. local variables
     211  //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
     212
     213  G4int i, counter, nt, np, nm, nz;
    238214
    239215   if( first )
    240      {                         // compute normalization constants, this will only be done once
     216     {   // compute normalization constants, this will only be done once
    241217       first = false;
    242218       for( i=0; i<numMul; i++ )protmul[i]  = 0.0;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEXiZeroInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HEXiZeroInelastic.cc,v 1.15 2008/03/17 20:49:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HEXiZeroInelastic.cc,v 1.17 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     35// and the low energy two-body model. Not included are the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest. 
    4138// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4239// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4542#include "G4HEXiZeroInelastic.hh"
    4643
    47 G4HadFinalState *  G4HEXiZeroInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double A = targetNucleus.GetN();
    54     const G4double Z = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
     44G4HadFinalState*
     45G4HEXiZeroInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     46                                   G4Nucleus& targetNucleus)
     47{
     48  G4HEVector* pv = new G4HEVector[MAXPART];
     49  const G4HadProjectile* aParticle = &aTrack;
     50  const G4double A = targetNucleus.GetN();
     51  const G4double Z = targetNucleus.GetZ();
     52  G4HEVector incidentParticle(aParticle);
    5653     
    57     G4double atomicNumber = Z;
    58     G4double atomicWeight = A;
    59 
    60     G4int    incidentCode          = incidentParticle.getCode();
    61     G4double incidentMass          = incidentParticle.getMass();
    62     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    63     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    64     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    65 
    66     if(incidentKineticEnergy < 1.)
    67       {
    68         G4cout << "GHEXiZeroInelastic: incident energy < 1 GeV" << G4endl;
    69       }
    70     if(verboseLevel > 1)
    71       {
    72         G4cout << "G4HEXiZeroInelastic::ApplyYourself" << G4endl;
    73         G4cout << "incident particle " << incidentParticle.getName()
    74              << "mass "              << incidentMass
    75              << "kinetic energy "    << incidentKineticEnergy
    76              << G4endl;
    77         G4cout << "target material with (A,Z) = ("
    78              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    79       }
    80 
    81     G4double inelasticity  = NuclearInelasticity(incidentKineticEnergy,
    82                                                  atomicWeight, atomicNumber);
    83     if(verboseLevel > 1)
    84         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     54  G4double atomicNumber = Z;
     55  G4double atomicWeight = A;
     56
     57  G4int incidentCode = incidentParticle.getCode();
     58  G4double incidentMass = incidentParticle.getMass();
     59  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     60  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     61  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     62
     63  if (incidentKineticEnergy < 1.)
     64    G4cout << "GHEXiZeroInelastic: incident energy < 1 GeV" << G4endl;
     65
     66  if (verboseLevel > 1) {
     67    G4cout << "G4HEXiZeroInelastic::ApplyYourself" << G4endl;
     68    G4cout << "incident particle " << incidentParticle.getName()
     69           << "mass "              << incidentMass
     70           << "kinetic energy "    << incidentKineticEnergy
     71           << G4endl;
     72    G4cout << "target material with (A,Z) = ("
     73           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     74  }
     75
     76  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     77                                              atomicWeight, atomicNumber);
     78  if (verboseLevel > 1)
     79    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    8580   
    86     incidentKineticEnergy -= inelasticity;
     81  incidentKineticEnergy -= inelasticity;
    8782   
    88     G4double excitationEnergyGNP = 0.;
    89     G4double excitationEnergyDTA = 0.;
    90 
    91     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    92                                                atomicWeight, atomicNumber,
    93                                                excitationEnergyGNP,
    94                                                excitationEnergyDTA);
    95     if(verboseLevel > 1)
    96       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     83  G4double excitationEnergyGNP = 0.;
     84  G4double excitationEnergyDTA = 0.;
     85
     86  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     87                                          atomicWeight, atomicNumber,
     88                                          excitationEnergyGNP,
     89                                          excitationEnergyDTA);
     90  if (verboseLevel > 1)
     91    G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    9792           << excitationEnergyDTA << G4endl;             
    9893
    99 
    100     incidentKineticEnergy -= excitation;
    101     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    102     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    103                                   *(incidentTotalEnergy+incidentMass));
    104 
    105 
    106     G4HEVector targetParticle;
    107     if(G4UniformRand() < atomicNumber/atomicWeight)
    108       {
    109         targetParticle.setDefinition("Proton");
    110       }
    111     else
    112       {
    113         targetParticle.setDefinition("Neutron");
    114       }
    115 
    116     G4double targetMass         = targetParticle.getMass();
    117     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    118                                        + 2.0*targetMass*incidentTotalEnergy);
    119     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    120 
    121                                                                 // this was the meaning of inElastic in the
    122                                                                 // original Gheisha stand-alone version.
    123 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    124 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    125                                                                 // by unknown reasons, it has been replaced
    126                                                                 // to the following code in Geant???
    127     G4bool inElastic = true;
    128 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    129 
    130     vecLength = 0;           
     94  incidentKineticEnergy -= excitation;
     95  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     96  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)
     97                                    *(incidentTotalEnergy+incidentMass));
     98
     99  G4HEVector targetParticle;
     100  if (G4UniformRand() < atomicNumber/atomicWeight) {
     101    targetParticle.setDefinition("Proton");
     102  } else {
     103    targetParticle.setDefinition("Neutron");
     104  }
     105
     106  G4double targetMass = targetParticle.getMass();
     107  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     108                                         + targetMass*targetMass
     109                                         + 2.0*targetMass*incidentTotalEnergy);
     110  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     111
     112  G4bool inElastic = true;
     113  vecLength = 0;
    131114       
    132     if(verboseLevel > 1)
    133       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     115  if (verboseLevel > 1)
     116    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    134117           << incidentCode << G4endl;
    135118
    136     G4bool successful = false;
     119  G4bool successful = false;
    137120   
    138     if(inElastic || (!inElastic && atomicWeight < 1.5))
    139       {
    140         FirstIntInCasXiZero(inElastic, availableEnergy, pv, vecLength,
    141                             incidentParticle, targetParticle, atomicWeight);
    142 
    143         if(verboseLevel > 1)
    144            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    145 
    146 
    147         if ((vecLength > 0) && (availableEnergy > 1.))
    148                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    149                                                   pv, vecLength,
    150                                                   incidentParticle, targetParticle);
    151             HighEnergyCascading( successful, pv, vecLength,
    152                                  excitationEnergyGNP, excitationEnergyDTA,
    153                                  incidentParticle, targetParticle,
    154                                  atomicWeight, atomicNumber);
    155         if (!successful)
    156             HighEnergyClusterProduction( successful, pv, vecLength,
    157                                          excitationEnergyGNP, excitationEnergyDTA,
    158                                          incidentParticle, targetParticle,
    159                                          atomicWeight, atomicNumber);
    160         if (!successful)
    161             MediumEnergyCascading( successful, pv, vecLength,
    162                                    excitationEnergyGNP, excitationEnergyDTA,
    163                                    incidentParticle, targetParticle,
    164                                    atomicWeight, atomicNumber);
    165 
    166         if (!successful)
    167             MediumEnergyClusterProduction( successful, pv, vecLength,
    168                                            excitationEnergyGNP, excitationEnergyDTA,       
    169                                            incidentParticle, targetParticle,
    170                                            atomicWeight, atomicNumber);
    171         if (!successful)
    172             QuasiElasticScattering( successful, pv, vecLength,
    173                                     excitationEnergyGNP, excitationEnergyDTA,
    174                                     incidentParticle, targetParticle,
    175                                     atomicWeight, atomicNumber);
    176       }
    177     if (!successful)
    178       {
    179             ElasticScattering( successful, pv, vecLength,
    180                                incidentParticle,   
    181                                atomicWeight, atomicNumber);
    182       }
    183 
    184     if (!successful)
    185       {
    186         G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles" << G4endl;
    187       }
    188       FillParticleChange(pv,  vecLength);
    189       delete [] pv;
    190       theParticleChange.SetStatusChange(stopAndKill);
    191       return & theParticleChange;
    192   }
     121  FirstIntInCasXiZero(inElastic, availableEnergy, pv, vecLength,
     122                      incidentParticle, targetParticle, atomicWeight);
     123
     124  if (verboseLevel > 1)
     125    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl;
     126
     127  if ((vecLength > 0) && (availableEnergy > 1.))
     128    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     129                                  pv, vecLength,
     130                                  incidentParticle, targetParticle);
     131
     132  HighEnergyCascading(successful, pv, vecLength,
     133                      excitationEnergyGNP, excitationEnergyDTA,
     134                      incidentParticle, targetParticle,
     135                      atomicWeight, atomicNumber);
     136  if (!successful)
     137    HighEnergyClusterProduction(successful, pv, vecLength,
     138                                excitationEnergyGNP, excitationEnergyDTA,
     139                                incidentParticle, targetParticle,
     140                                atomicWeight, atomicNumber);
     141  if (!successful)
     142    MediumEnergyCascading(successful, pv, vecLength,
     143                          excitationEnergyGNP, excitationEnergyDTA,
     144                          incidentParticle, targetParticle,
     145                          atomicWeight, atomicNumber);
     146
     147  if (!successful)
     148    MediumEnergyClusterProduction(successful, pv, vecLength,
     149                                  excitationEnergyGNP, excitationEnergyDTA,       
     150                                  incidentParticle, targetParticle,
     151                                  atomicWeight, atomicNumber);
     152  if (!successful)
     153    QuasiElasticScattering(successful, pv, vecLength,
     154                           excitationEnergyGNP, excitationEnergyDTA,
     155                           incidentParticle, targetParticle,
     156                           atomicWeight, atomicNumber);
     157  if (!successful)
     158    ElasticScattering(successful, pv, vecLength,
     159                      incidentParticle,   
     160                      atomicWeight, atomicNumber);
     161
     162  if (!successful)
     163    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     164           << G4endl;
     165
     166  FillParticleChange(pv, vecLength);
     167  delete [] pv;
     168  theParticleChange.SetStatusChange(stopAndKill);
     169  return &theParticleChange;
     170}
     171
    193172
    194173void
    195 G4HEXiZeroInelastic::FirstIntInCasXiZero( G4bool &inElastic,
    196                                           const G4double availableEnergy,
    197                                           G4HEVector pv[],
    198                                           G4int &vecLen,
    199                                           G4HEVector incidentParticle,
    200                                           G4HEVector targetParticle,
    201                                           const G4double atomicWeight)
     174G4HEXiZeroInelastic::FirstIntInCasXiZero(G4bool& inElastic,
     175                                         const G4double availableEnergy,
     176                                         G4HEVector pv[],
     177                                         G4int& vecLen,
     178                                         const G4HEVector& incidentParticle,
     179                                         const G4HEVector& targetParticle,
     180                                         const G4double atomicWeight)
    202181
    203182// Xi0 undergoes interaction with nucleon within a nucleus.  Check if it is
     
    208187// protons/neutrons by kaons or strange baryons according to the average
    209188// multiplicity per inelastic reaction.
    210 
    211  {
    212    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    213    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    214 
    215    static const G4double protb = 0.7;
    216    static const G4double neutb = 0.7;             
    217    static const G4double     c = 1.25;
    218 
    219    static const G4int   numMul = 1200;
    220    static const G4int   numSec = 60;
    221 
    222 //   G4int              neutronCode = Neutron.getCode();
    223    G4int              protonCode  = Proton.getCode();
    224 
    225    G4int               targetCode = targetParticle.getCode();
    226 //   G4double          incidentMass = incidentParticle.getMass();
    227 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    228    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    229 
    230    static G4bool first = true;
    231    static G4double protmul[numMul], protnorm[numSec];  // proton constants
    232    static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
    233 
    234                               //  misc. local variables
    235                               //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
    236 
    237    G4int i, counter, nt, np, nm, nz;
     189{
     190  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     191  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     192
     193  static const G4double protb = 0.7;
     194  static const G4double neutb = 0.7;             
     195  static const G4double     c = 1.25;
     196
     197  static const G4int numMul = 1200;
     198  static const G4int numSec = 60;
     199
     200  G4int protonCode = Proton.getCode();
     201
     202  G4int targetCode = targetParticle.getCode();
     203  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     204
     205  static G4bool first = true;
     206  static G4double protmul[numMul], protnorm[numSec];  // proton constants
     207  static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
     208
     209  //  misc. local variables
     210  //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
     211
     212  G4int i, counter, nt, np, nm, nz;
    238213
    239214   if( first )
    240      {                         // compute normalization constants, this will only be done once
     215     {     // compute normalization constants, this will only be done once
    241216       first = false;
    242217       for( i=0; i<numMul; i++ )protmul[i]  = 0.0;
  • trunk/source/processes/hadronic/models/incl/GNUmakefile

    r1340 r1347  
    1 # $Id: GNUmakefile,v 1.11 2010/10/26 02:47:58 kaitanie Exp $
     1# $Id: GNUmakefile,v 1.13 2010/11/13 00:08:36 kaitanie Exp $
    22# -----------------------------------------------------------
    33# GNUmakefile for hadronic library.  Gabriele Cosmo, 18/9/96.
     
    3636            -I$(G4BASE)/processes/hadronic/models/management/include \
    3737            -I$(G4BASE)/processes/hadronic/models/util/include \
     38            -I$(G4BASE)/processes/hadronic/models/de_excitation/util/include \
    3839            -I$(G4BASE)/processes/hadronic/models/de_excitation/evaporation/include \
    3940            -I$(G4BASE)/processes/hadronic/models/de_excitation/fermi_breakup/include \
     41            -I$(G4BASE)/processes/hadronic/models/de_excitation/photon_evaporation/include \
     42            -I$(G4BASE)/processes/hadronic/models/de_excitation/multifragmentation/include \
     43            -I$(G4BASE)/processes/hadronic/models/de_excitation/handler/include \
     44            -I$(G4BASE)/processes/hadronic/models/de_excitation/management/include \
     45            -I$(G4BASE)/processes/hadronic/models/pre_equilibrium/exciton_model/include/ \
    4046            -I$(G4BASE)/particles/management/include \
    4147            -I$(G4BASE)/particles/leptons/include \
  • trunk/source/processes/hadronic/models/incl/History

    r1340 r1347  
    44     Geant4 - an Object-Oriented Toolkit for Physics Simulation
    55     ==========================================================
    6 $Id: History,v 1.32 2010/10/29 06:54:23 gunter Exp $
     6$Id: History,v 1.37 2010/11/17 20:19:09 kaitanie Exp $
    77---------------------------------------------------------------------
    88
     
    1717   ---------------------------------------------------------------
    1818
     1917 November 2010 - Pekka Kaitaniemi (hadr-incl-V09-03-10)
     20---------------------------------------------------------
     21- Fixed several issues reported by Coverity:
     22  o Fix: Fragment vector and Fermi break-up related emory leaks in
     23  INCL/ABLA interfaces
     24  o Initialize INCL internal variables properly
     25  o Check array boundaries in datafile reader
     26
     2716 November 2010 - Gabriele Cosmo (hadr-incl-V09-03-09)
     28-------------------------------------------------------
     29- More minor fixes from Coverity reports...
     30
     3112 November 2010 - Pekka Kaitaniemi (hadr-incl-V09-03-08)
     32---------------------------------------------------------
     33- Fixed several minor variable initialization issues reported by Coverity
     34
     3511 November 2010 - Pekka Kaitaniemi (hadr-incl-V09-03-07)
     36---------------------------------------------------------
     37- Fixed some minor variable initialization issues reported by Coverity
     38- Updated interfaces:
     39  o INCL + built-in ABLA de-excitation: G4InclAblaCascadeInterface and
     40  G4InclAblaLightIonInterface
     41  o INCL + PreCompound model: G4InclCascadeInterface and
     42  G4InclLightIonInterface
     43
     4403 November 2010 - Pekka Kaitaniemi (hadr-incl-V09-03-06)
     45---------------------------------------------------------
     46- Fixed insufficient array index safeguard in ABLA
     47- Silenced debugging output printed by G4InclAblaCascadeInterface
     48
    194929 October 2010 - Gunter Folger (hadr-incl-V09-03-05)
     50-----------------------------------------------------
    2051- Fixed several more compilation warnings for conversion of double to int
    2152   in  G4Incl.cc, G4InclAblaCascadeInterface.cc, and G4InclAblaLightIonInterface.cc.
  • trunk/source/processes/hadronic/models/incl/include/G4Abla.hh

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4Abla.hh,v 1.13 2010/10/26 02:47:59 kaitanie Exp $
     26// $Id: G4Abla.hh,v 1.14 2010/11/17 20:19:09 kaitanie Exp $
    2727// Translation of INCL4.2/ABLA V3
    2828// Pekka Kaitaniemi, HIP (translation)
     
    5050public:
    5151  /**
    52    * Basic constructor.
    53    */
    54   G4Abla();
    55 
    56   /**
    5752   * This constructor is used by standalone test driver and the Geant4 interface.
    5853   *
     
    6257   */
    6358  G4Abla(G4Hazard *aHazard, G4Volant *aVolant, G4VarNtp *aVarntp);
    64 
    65   /**
    66    * Constructor that is to be used only for testing purposes.
    67    * @param aHazard random seeds
    68    * @param aVolant data structure for ABLA output   
    69    */
    70   G4Abla(G4Hazard *hazard, G4Volant *volant);
    7159
    7260  /**
     
    167155              G4double *probp_par, G4double *probn_par, G4double *proba_par,
    168156              G4double *probf_par, G4double *ptotl_par, G4double *sn_par, G4double *sbp_par, G4double *sba_par, G4double *ecn_par,
    169               G4double *ecp_par,G4double *eca_par, G4double *bp_par, G4double *ba_par, G4int inttype, G4int inum, G4int itest);
     157              G4double *ecp_par,G4double *eca_par, G4double *bp_par, G4double *ba_par, G4int, G4int inum, G4int itest);
    170158
    171159  /**
  • trunk/source/processes/hadronic/models/incl/include/G4AblaDataDefs.hh

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4AblaDataDefs.hh,v 1.11 2010/10/26 02:47:59 kaitanie Exp $
     26// $Id: G4AblaDataDefs.hh,v 1.13 2010/11/13 00:08:36 kaitanie Exp $
    2727// Translation of INCL4.2/ABLA V3
    2828// Pekka Kaitaniemi, HIP (translation)
     
    9595   *
    9696   */
    97   G4Ald() {};
     97  G4Ald()
     98    :av(0.0), as(0.0), ak(0.0), optafan(0.0)
     99  {};
    98100  ~G4Ald() {};
    99101 
     
    141143
    142144public:
    143   G4Fiss() {};
     145  G4Fiss()
     146    :akap(0.0), bet(0.0), homega(0.0), koeff(0.0), ifis(0.0),
     147     optshp(0), optxfis(0), optles(0), optcol(0)
     148  {};
    144149  ~G4Fiss() {};
    145150 
     
    171176
    172177public:
    173   G4Opt() {};
     178  G4Opt()
     179    :optemd(0), optcha(0), eefac(0.0)
     180  {};
    174181  ~G4Opt() {};
    175182 
     
    182189class G4Eenuc {
    183190public:
    184   G4Eenuc() {};
     191  G4Eenuc() {
     192    for(G4int i = 0; i < EENUCSIZE; ++i) {
     193      she[i] = 0.0;
     194    }
     195    for(G4int i = 0; i < XHESIZE; ++i) {
     196      for(G4int j = 0; j < EENUCSIZE; ++j) {
     197        xhe[i][j] = 0.0;
     198      }
     199    }
     200  };
    185201  ~G4Eenuc() {};
    186202 
  • trunk/source/processes/hadronic/models/incl/include/G4Incl.hh

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4Incl.hh,v 1.18 2010/10/26 02:47:59 kaitanie Exp $
     26// $Id: G4Incl.hh,v 1.19 2010/11/13 00:08:36 kaitanie Exp $
    2727// Translation of INCL4.2/ABLA V3
    2828// Pekka Kaitaniemi, HIP (translation)
     
    688688   private:
    689689
     690  /*
     691   * (Re)Initialize INCL internal variables
     692   */
     693  void clearState();
     694
    690695  /**
    691696   * Random seeds for INCL4 internal random number generators.
  • trunk/source/processes/hadronic/models/incl/include/G4InclAblaCascadeInterface.hh

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4InclAblaCascadeInterface.hh,v 1.9 2010/10/26 02:47:59 kaitanie Exp $
     26// $Id: G4InclAblaCascadeInterface.hh,v 1.11 2010/11/13 00:08:36 kaitanie Exp $
    2727// Translation of INCL4.2/ABLA V3
    2828// Pekka Kaitaniemi, HIP (translation)
     
    9191 *
    9292 * @see G4InclAblaLightIonInterface
     93 * @see G4InclCascadeInterface
    9394 */
    9495
  • trunk/source/processes/hadronic/models/incl/include/G4InclAblaDataFile.hh

    r1337 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4InclAblaDataFile.hh,v 1.3 2010/06/14 16:10:01 gcosmo Exp $
     26// $Id: G4InclAblaDataFile.hh,v 1.4 2010/11/17 20:19:09 kaitanie Exp $
    2727// Translation of INCL4.2/ABLA V3
    2828// Pekka Kaitaniemi, HIP (translation)
     
    5252private:
    5353  G4int verboseLevel;
    54  
    55   G4String *dataPath;
    5654};
    5755
  • trunk/source/processes/hadronic/models/incl/include/G4InclCascadeInterface.hh

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4InclCascadeInterface.hh,v 1.6 2010/10/26 02:47:59 kaitanie Exp $
     26// $Id: G4InclCascadeInterface.hh,v 1.8 2010/11/13 00:08:36 kaitanie Exp $
    2727// Translation of INCL4.2/ABLA V3
    2828// Pekka Kaitaniemi, HIP (translation)
     
    5959#include "G4AblaDataDefs.hh"
    6060#include "G4Incl.hh"
    61 #include "G4InclInput.hh"
     61
     62// Geant4 de-excitation
     63#include "G4ExcitationHandler.hh"
     64#include "G4PreCompoundModel.hh"
    6265
    6366#include <fstream>
     
    6770
    6871/**
     72 * <h1>INCL intra-nuclear cascade with Geant4 PreCompound for de-excitation</h1>
     73 *
    6974 * Interface for INCL. This interface handles basic hadron
    7075 * bullet particles (protons, neutrons, pions).
    71  * @see G4InclAblaLightIonInterface
     76 *
     77 * Example usage in case of protons:
     78 * @code
     79 * G4InclCascadeInterface* inclModel = new G4InclCascadeInterface;
     80 * inclModel -> SetMinEnergy(0.0 * MeV); // Set the energy limits
     81 * inclModel -> SetMaxEnergy(3.0 * GeV);
     82 *
     83 * G4ProtonInelasticProcess* protonInelasticProcess = new G4ProtonInelasticProcess();
     84 * G4ProtonInelasticCrossSection* protonInelasticCrossSection =  new G4ProtonInelasticCrossSection();
     85 *
     86 * protonInelasticProcess -> RegisterMe(inclModel);
     87 * protonInelasticProcess -> AddDataSet(protonInelasticCrossSection);
     88 *
     89 * particle = G4Proton::Proton();
     90 * processManager = particle -> GetProcessManager();
     91 * processManager -> AddDiscreteProcess(protonInelasticProcess);
     92 * @endcode
     93 * The same setup procedure is needed for neutron and pion inelastic processes
     94 * as well.
     95 *
     96 * @see G4InclLightIonInterface
    7297 */
    7398
     
    78103   * Basic constructor.
    79104   */
    80   G4InclCascadeInterface();
     105  G4InclCascadeInterface(const G4String& name = "INCL Cascade with Geant4 PreCompound");
    81106
    82107 
     
    94119
    95120  /**
    96    * Main method to apply the INCL/ABLA physics model.
     121   * Main method to apply the INCL physics model.
    97122   * @param aTrack the projectile particle
    98123   * @param theNucleus target nucleus
    99    * @return the output of the INCL/ABLA physics model
     124   * @return the output of the INCL physics model
    100125   */
    101126  G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,  G4Nucleus& theNucleus);
     
    108133  G4Hazard *hazard; // The random seeds used by INCL.
    109134  G4VarNtp *varntp;
    110   G4InclInput *inclInput;
     135  G4InclInput *calincl;
    111136  G4Ws *ws;
    112137  G4Mat *mat;
    113138  G4Incl *incl;
    114  
     139
    115140  G4HadFinalState theResult; 
    116141  ofstream diagdata;
     
    119144  G4double previousTargetA;
    120145  G4double previousTargetZ;
     146
     147  G4ExcitationHandler *theExcitationHandler;
     148  G4PreCompoundModel *thePrecoModel;
    121149};
    122150
    123 #endif // G4INCLCASCADEINTERFACE_H
     151#endif // G4INCLABLACASCADEINTERFACE_H
  • trunk/source/processes/hadronic/models/incl/include/G4InclDataDefs.hh

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4InclDataDefs.hh,v 1.10 2010/10/28 15:35:50 gcosmo Exp $
     26// $Id: G4InclDataDefs.hh,v 1.12 2010/11/17 20:19:09 kaitanie Exp $
    2727// Translation of INCL4.2/ABLA V3
    2828// Pekka Kaitaniemi, HIP (translation)
     
    6363class G4QuadvectProjo {
    6464public:
    65   G4QuadvectProjo() {};
     65  G4QuadvectProjo() {
     66    for(G4int i = 0; i < max_a_proj; ++i) {
     67      eps_c[i] = 0.0;
     68      t_c[i] = 0.0;
     69      p3_c[i] = 0.0;
     70      p1_s[i] = 0.0;
     71      p2_s[i] = 0.0;
     72      p3_s[i] = 0.0;
     73    }
     74  };
     75
    6676  ~G4QuadvectProjo() {};
    6777
     
    7383class G4VBe {
    7484public:
    75   G4VBe() {};
     85  G4VBe()
     86    :ia_be(0), iz_be(0),
     87     rms_be(0.0), pms_be(0.0), bind_be(0.0)
     88  { };
     89
    7690  ~G4VBe() {};
    7791
     
    87101  G4InclProjSpect() {
    88102    //    G4cout <<"Projectile spectator data structure created!" << G4endl;
     103    clear();
    89104  };
    90105  ~G4InclProjSpect() {};
     
    95110    a_projspec = 0;
    96111    z_projspec = 0;
    97     m_projspec = 0.0;
     112    t_projspec = 0.0;
    98113    ex_projspec = 0.0;
    99114    p1_projspec = 0.0;
    100115    p2_projspec = 0.0;
    101116    p3_projspec = 0.0;
     117    m_projspec = 0.0;
    102118  };
    103119
     
    108124};
    109125
    110 #define FSIZE 15
    111 /**
    112  * Initial values of a hadronic cascade problem.
    113  */
    114 class G4Calincl {
    115 public:
    116   G4Calincl() {
    117     isExtendedProjectile = false;
    118   };
    119 
    120   G4Calincl(const G4HadProjectile &aTrack, const G4Nucleus &theNucleus, G4bool inverseKinematics = false) {
    121     for(int i = 0; i < 15; i++) {
    122       f[i] = 0.0; // Initialize INCL input data
    123     }
    124 
    125     usingInverseKinematics = inverseKinematics;
    126 
    127     f[0] = theNucleus.GetA_asInt(); // Target mass number
    128     f[1] = theNucleus.GetZ_asInt(); // Target charge number
    129     f[6] = getBulletType(aTrack.GetDefinition()); // Projectile type (INCL particle code)
    130     f[2] = aTrack.GetKineticEnergy() / MeV; // Projectile energy (total, in MeV)
    131     f[5] = 1.0; // Time scaling
    132     f[4] = 45.0; // Nuclear potential
    133     setExtendedProjectileInfo(aTrack.GetDefinition());
    134     //    G4cout <<"Projectile type = " << f[6] << G4endl;
    135     //    G4cout <<"Energy = " << f[2] << G4endl;
    136     //    G4cout <<"Target A = " << f[0] << " Z = " << f[1] << G4endl;
    137   };
    138 
    139   ~G4Calincl() {};
    140  
    141   static void printProjectileTargetInfo(const G4HadProjectile &aTrack, const G4Nucleus &theNucleus) {
    142     G4cout <<"Projectile = " << aTrack.GetDefinition()->GetParticleName() << G4endl;
    143     G4cout <<"    four-momentum: " << aTrack.Get4Momentum() << G4endl;
    144     G4cout <<"Energy = " << aTrack.GetKineticEnergy() / MeV << G4endl;
    145     G4cout <<"Target A = " << theNucleus.GetA_asInt() << " Z = " << theNucleus.GetZ_asInt() << G4endl;
    146   }
    147 
    148   static G4bool canUseInverseKinematics(const G4HadProjectile &aTrack, const G4Nucleus &theNucleus) {
    149     G4int targetA = theNucleus.GetA_asInt();
    150     const G4ParticleDefinition *projectileDef = aTrack.GetDefinition();
    151     G4int projectileA = projectileDef->GetAtomicMass();
    152     //    G4int projectileZ = projectileDef->GetAtomicNumber();
    153     if(targetA > 0 && targetA < 18 && (projectileDef != G4Proton::Proton() &&
    154                                        projectileDef != G4Neutron::Neutron() &&
    155                                        projectileDef != G4PionPlus::PionPlus() &&
    156                                        projectileDef != G4PionZero::PionZero() &&
    157                                        projectileDef != G4PionMinus::PionMinus()) &&
    158        projectileA > 1) {
    159       return true;
    160     } else {
    161       return false;
    162     }
    163   }
    164 
    165   G4double bulletE() {
    166     return f[2];
    167   }
    168 
    169   G4int getBulletType() {
    170     return G4int(f[6]);
    171   };
    172 
    173   void setExtendedProjectileInfo(const G4ParticleDefinition *pd) {
    174     if(getBulletType(pd) == -666) {
    175       extendedProjectileA = pd->GetAtomicMass();
    176       extendedProjectileZ = pd->GetAtomicNumber();
    177       isExtendedProjectile = true;
    178     } else {
    179       isExtendedProjectile = false;
    180     }
    181   };
    182 
    183   G4int getBulletType(const G4ParticleDefinition *pd) {
    184     G4ParticleTable *pt = G4ParticleTable::GetParticleTable();
    185 
    186     if(pd == G4Proton::Proton()) {
    187       return 1;
    188     } else if(pd == G4Neutron::Neutron()) {
    189       return 2;
    190     } else if(pd == G4PionPlus::PionPlus()) {
    191       return 3;
    192     } else if(pd == G4PionMinus::PionMinus()) {
    193       return 5;
    194     } else if(pd == G4PionZero::PionZero()) {
    195       return 4;
    196     } else if(pd == G4Deuteron::Deuteron()) {
    197       return 6;
    198     } else if(pd == G4Triton::Triton()) {
    199       return 7;
    200     } else if(pd == G4He3::He3()) {
    201       return 8;
    202     } else if(pd == G4Alpha::Alpha()) {
    203       return 9;
    204     } else if(pd == pt->GetIon(6, 12, 0.0)) { // C12 special case. This should be phased-out in favor of "extended projectile"
    205       return -12;
    206     } else { // Is this extended projectile?
    207       G4int A = pd->GetAtomicMass();
    208       G4int Z = pd->GetAtomicNumber();
    209       if(A > 4 && A <= 16 && Z > 2 && Z <= 8) { // Ions from Lithium to Oxygen
    210         return -666; // Code of an extended projectile
    211       }
    212     }
    213     G4cout <<"Error! Projectile " << pd->GetParticleName() << " not defined!" << G4endl;
    214     return 0;
    215   };
    216 
    217   G4bool isInverseKinematics() {
    218     return usingInverseKinematics;
    219   };
    220 
    221   G4double targetA() { return f[0]; };
    222   G4double targetZ() { return f[1]; };
    223 
    224   G4int extendedProjectileA;
    225   G4int extendedProjectileZ;
    226   G4bool isExtendedProjectile;
    227 
    228   /**
    229    * Here f is an array containing the following initial values:
    230    * - f[0] : target mass number
    231    * - f[1] : target charge number
    232    * - f[2] : bullet energy
    233    * - f[3] : minimum proton energy to leave the target (default: 0.0)
    234    * - f[4] : nuclear potential (default: 45.0 MeV)
    235    * - f[5] : time scale (default: 1.0)
    236    * - f[6] : bullet type (1: proton, 2: neutron, 3: pi+, 4: pi0 5: pi-, 6:H2, 7: H3, 8: He3, 9: He4
    237    * - f[7] : minimum neutron energy to leave the target (default: 0.0)
    238    * - f[8] : target material identifier (G4Mat)
    239    * - f[9] : not used
    240    * - f[10] : not used
    241    * - f[11] : not used
    242    * - f[12] : not used
    243    * - f[13] : not used
    244    * - f[14] : not used
    245    */
    246   G4double f[FSIZE];
    247 
    248   /**
    249    * Number of events to be processed.
    250    */
    251   G4int icoup;
    252 
    253   G4bool usingInverseKinematics;
    254 };
    255 
    256126#define IGRAINESIZE 19
    257127/**
     
    262132class G4Hazard{
    263133public:
    264   G4Hazard() {};
     134  G4Hazard() {
     135    ial = 0;
     136    for(G4int i = 0; i < IGRAINESIZE; ++i) {
     137      igraine[i] = 0;
     138    }
     139  };
     140
    265141  ~G4Hazard() {};
    266142
     
    283159class G4Mat {
    284160public:
    285   G4Mat() { };
     161  G4Mat() {
     162    nbmat = 0;
     163
     164    for(G4int i = 0; i < MATSIZE; ++i) {
     165      zmat[i] = 0;
     166      amat[i] = 0;
     167    }
     168
     169    for(G4int i = 0; i < MATGEOSIZE; ++i) {
     170      for(G4int j = 0; j < MATSIZE; ++j) {
     171        bmax_geo[i][j] = 0;
     172      }
     173    }
     174};
     175
    286176  ~G4Mat() { };
    287177
     
    313203class G4LightGausNuc {
    314204public:
    315   G4LightGausNuc() {};
     205  G4LightGausNuc() {
     206    for(G4int i = 0; i < LGNSIZE; ++i) {
     207      rms1t[i] = 0.0;
     208      pf1t[i] = 0.0;
     209      pfln[i] = 0.0;
     210      tfln[i] = 0.0;
     211      vnuc[i] = 0.0;
     212    }
     213  };
     214
    316215  ~G4LightGausNuc() {};
    317216 
     
    329228class G4LightNuc {
    330229public:
    331   G4LightNuc() {};
     230  G4LightNuc() {
     231    for(G4int i = 0; i < LNSIZE; ++i) {
     232      r[i] = 0.0;
     233      a[i] = 0.0;
     234    }
     235  };
     236
    332237  ~G4LightNuc() {};
    333238
     
    350255class G4Saxw {
    351256public:
    352   G4Saxw() {};
     257  G4Saxw() {
     258    for(G4int i = 0; i < SAXWROWS; ++i) {
     259      for(G4int j = 0; j < SAXWCOLS; ++j) {
     260        x[i][j] = 0.0;
     261        y[i][j] = 0.0;
     262        s[i][j] = 0.0;
     263      }
     264    }
     265    imat = 0; n = 0; k = 0;
     266  };
     267
    353268  ~G4Saxw() {};
    354269 
     
    391306  G4Ws() {
    392307    fneck = 0.0;
    393   };
     308    r0 = 0.0;
     309    adif = 0.0;
     310    rmaxws = 0.0;
     311    drws = 0.0;
     312    nosurf = 0.0;
     313    xfoisa = 0.0;
     314    bmax = 0.0;
     315    npaulstr = 0.0;
     316  };
     317
    394318  ~G4Ws() {};
    395319 
     
    453377class G4Dton {
    454378public:
    455   G4Dton() {};
     379  G4Dton() {
     380    fn = 0.0;
     381    for(G4int i = 0; i < DTONSIZE; ++i) {
     382      c[i] = 0.0;
     383      d[i] = 0.0;
     384    }
     385  };
     386
    456387  ~G4Dton() {};
    457388 
     
    469400class G4Spl2 {
    470401public:
    471   G4Spl2() {};
     402  G4Spl2() {
     403    for(G4int i = 0; i < SPL2SIZE; ++i) {
     404      x[i] = 0.0; y[i] = 0.0;
     405      a[i] = 0.0; b[i] = 0.0; c[i] = 0.0;
     406    }
     407    n = 0;
     408  };
     409
    472410  ~G4Spl2() {};
    473411 
     
    491429class G4Bl1 {
    492430public:
    493   G4Bl1() {};
     431  G4Bl1() {
     432    ta = 0.0;
     433    for(G4int i = 0; i < BL1SIZE; ++i) {
     434      p1[i] = 0.0; p2[i] = 0.0; p3[i] = 0.0; eps[i] = 0.0;
     435      ind1[i] = 0; ind2[i] = 0;
     436    }
     437  };
     438
    494439  ~G4Bl1() {};
    495440 
     
    510455};
    511456
    512 #define BL2CROISSIZE 19900
    513 #define BL2INDSIZE 19900
     457#define BL2SIZE 19900
    514458/**
    515459 *
     
    517461class G4Bl2 {
    518462public:
    519   G4Bl2() {};
     463  G4Bl2() {
     464    k = 0;
     465    for(G4int i = 0; i < BL2SIZE; ++i) {
     466      crois[i] = 0.0;
     467      ind[i] = 0;
     468      jnd[i] = 0;
     469    }   
     470  };
     471
    520472  ~G4Bl2() {};
    521473 
     
    533485   *
    534486   */
    535   G4double crois[BL2CROISSIZE];
     487  G4double crois[BL2SIZE];
    536488
    537489  /**
     
    543495   *
    544496   */
    545   G4int ind[BL2INDSIZE];
    546 
    547   /**
    548    *
    549    */
    550   G4int jnd[BL2INDSIZE];
     497  G4int ind[BL2SIZE];
     498
     499  /**
     500   *
     501   */
     502  G4int jnd[BL2SIZE];
    551503};
    552504
     
    558510class G4Bl3 {
    559511public:
    560   G4Bl3() {};
     512  G4Bl3() {
     513    r1 = 0.0; r2 = 0.0;
     514    ia1 = 0; ia2 = 0;
     515    rab2 = 0.0;
     516
     517    for(G4int i = 0; i < BL3SIZE; ++i) {
     518      x1[i] = 0.0; x2[i] = 0.0; x3[i] = 0.0;
     519    }
     520  };
     521
    561522  ~G4Bl3() {};
    562523 
     
    599560class G4Bl4 {
    600561public:
    601   G4Bl4() {};
     562  G4Bl4()
     563    :tmax5(0.0)
     564  {};
     565
    602566  ~G4Bl4() {};
    603567
     
    615579class G4Bl5 {
    616580public:
    617   G4Bl5() {};
     581  G4Bl5() {
     582    for(G4int i = 0; i < BL5SIZE; ++i) {
     583      tlg[i] = 0.0;
     584      nesc[i] = 0;
     585    }
     586  };
     587
    618588  ~G4Bl5() {};
    619589 
     
    634604class G4Bl6 {
    635605public:
    636   G4Bl6() {};
     606  G4Bl6()
     607    :xx10(0.0), isa(0.0)
     608  {};
     609
    637610  ~G4Bl6() {};
    638611 
     
    653626class G4Bl8 {
    654627public:
    655   G4Bl8() {};
     628  G4Bl8()
     629    :rathr(0.0), ramass(0.0)
     630  {};
     631
    656632  ~G4Bl8() {};
    657633
     
    677653    l1 = 0;
    678654    l2 = 0;
     655    for(G4int i = 0; i < BL9SIZE; ++i) {
     656      hel[i] = 0.0;
     657    }
    679658  };
    680659  ~G4Bl9() {};
     
    696675class G4Bl10 {
    697676public:
    698   G4Bl10() {};
     677  G4Bl10()
     678    :ri4(0.0), rs4(0.0), r2i(0.0), r2s(0.0), pdummy(0.0), pf(0.0)
     679  {};
    699680  ~G4Bl10() {};
    700681
     
    710691class G4Kind {
    711692public:
    712   G4Kind() {};
     693  G4Kind()
     694    :kindf7(0)
     695  {};
    713696  ~G4Kind() {};
    714697
     
    770753class G4VarAvat {
    771754public:
    772   G4VarAvat() {};
     755  G4VarAvat() {
     756    kveux = 0;
     757    bavat = 0.0;
     758    nopartavat = 0; ncolavat = 0;
     759    nb_avat = 0;
     760
     761    for(G4int i = 0; i < VARSIZE; ++i) {
     762      r1_in[i] = 0.0;
     763      r1_first_avat[i] = 0.0;
     764    }
     765
     766    for(G4int i = 0; i < VAEPSSIZE; ++i) {
     767      epsd[i] = 0.0;
     768      eps2[i] = 0.0;
     769      eps4[i] = 0.0;
     770      eps6[i] = 0.0;
     771      epsf[i] = 0.0;
     772    }
     773
     774    for(G4int i = 0; i < VAAVM; ++i) {
     775      timeavat[i] = 0.0;
     776      l1avat[i] = 0.0;
     777      l2avat[i] = 0.0;
     778      jpartl1[i] = 0.0;
     779      jpartl2[i] = 0.0;
     780      del1avat[i] = 0.0;
     781      del2avat[i] = 0.0;
     782      energyavat[i] = 0.0;
     783      bloc_paul[i] = 0.0;
     784      bloc_cdpp[i] = 0.0;
     785      go_out[i] = 0.0;
     786    }
     787  };
     788
    773789  ~G4VarAvat() {};
    774790
     
    822838class G4VarNtp {
    823839public:
    824   G4VarNtp() {};
     840  G4VarNtp() {
     841    clear();
     842  };
     843
    825844  ~G4VarNtp() {};
    826845
     
    834853    targetA = 0;
    835854    targetZ = 0;
    836     masp = 0.0; mzsp = 0.0; exsp = 0.0;
     855    masp = 0.0; mzsp = 0.0; exsp = 0.0; mrem = 0.0;
    837856    // To be deleted?
    838857    spectatorA = 0;
     
    11901209class G4Paul {
    11911210public:
    1192   G4Paul() {};
     1211  G4Paul()
     1212    :ct0(0.0), ct1(0.0), ct2(0.0), ct3(0.0), ct4(0.0), ct5(0.0), ct6(0.0),
     1213     pr(0.0), pr2(0.0), xrr(0.0), xrr2(0.0),
     1214     cp0(0.0), cp1(0.0), cp2(0.0), cp3(0.0), cp4(0.0), cp5(0.0), cp6(0.0)
     1215  {};
     1216
    11931217  ~G4Paul() {};
    11941218 
  • trunk/source/processes/hadronic/models/incl/include/G4InclLightIonInterface.hh

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4InclLightIonInterface.hh,v 1.6 2010/10/26 02:47:59 kaitanie Exp $
     26// $Id: G4InclLightIonInterface.hh,v 1.8 2010/11/13 00:08:36 kaitanie Exp $
    2727// Translation of INCL4.2/ABLA V3
    2828// Pekka Kaitaniemi, HIP (translation)
     
    4646#define G4INCLLIGHTIONINTERFACE_H 1
    4747
    48 #include "G4Nucleon.hh"
    49 #include "G4Nucleus.hh"
    50 #include "G4HadronicInteraction.hh"
    5148#include "G4VIntraNuclearTransportModel.hh"
    5249#include "G4KineticTrackVector.hh"
     
    6158#include "G4Incl.hh"
    6259
     60// Geant4 de-excitation
     61#include "G4ExcitationHandler.hh"
     62#include "G4PreCompoundModel.hh"
     63
    6364#include <fstream>
    6465#include <iostream>
     
    6768
    6869/**
    69  * Interface for INCL. This interface handles basic light ion
    70  * bullet particles (deuterons, tritons, he3 and alphas).
    71  * @see G4InclAblaLightIonInterface
     70 * Interface for INCL with Geant4 PreCompound de-excitation. This
     71 * interface handles basic light ion bullet particles from deuterons
     72 * up to carbon-12. @see G4InclAblaLightIonInterface
    7273 */
    7374
     
    9495
    9596  /**
    96    * Main method to apply the INCL/ABLA physics model.
     97   * Main method to apply the INCL physics model.
    9798   * @param aTrack the projectile particle
    9899   * @param theNucleus target nucleus
    99    * @return the output of the INCL/ABLA physics model
     100   * @return the output of the INCL physics model
    100101   */
    101102  G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,  G4Nucleus& theNucleus);
     
    119120  G4double previousTargetA;
    120121  G4double previousTargetZ;
     122  G4bool useProjectileSpectator;
     123  G4bool useFermiBreakup;
     124
     125  G4ExcitationHandler *theExcitationHandler;
     126  G4PreCompoundModel *thePrecoModel;
    121127};
    122128
    123 #endif // G4INCLLIGHTIONINTERFACE_H
     129#endif // G4INCLABLALIGHTIONINTERFACE_H
  • trunk/source/processes/hadronic/models/incl/include/G4InclRandomNumbers.hh

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4InclRandomNumbers.hh,v 1.6 2010/10/26 02:47:59 kaitanie Exp $
     26// $Id: G4InclRandomNumbers.hh,v 1.8 2010/11/13 00:08:36 kaitanie Exp $
    2727// Translation of INCL4.2/ABLA V3
    2828// Pekka Kaitaniemi, HIP (translation)
     
    4343
    4444public:
    45   G4InclRandomInterface() { }
     45  G4InclRandomInterface() {
     46    this->seed = 1337; // Default seed, this is never actually used.
     47  }
    4648  G4InclRandomInterface(G4long seed) {
    4749    this->seed = seed;
  • trunk/source/processes/hadronic/models/incl/src/G4Abla.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4Abla.cc,v 1.22 2010/10/26 02:47:59 kaitanie Exp $
     26// $Id: G4Abla.cc,v 1.27 2010/11/17 20:19:09 kaitanie Exp $
    2727// Translation of INCL4.2/ABLA V3
    2828// Pekka Kaitaniemi, HIP (translation)
     
    4040#include "G4AblaFissionSimfis18.hh"
    4141#include "G4AblaFission.hh"
    42 
    43 G4Abla::G4Abla()
    44 {
    45   verboseLevel = 0;
    46   ilast = 0;
    47 }
    48 
    49 G4Abla::G4Abla(G4Hazard *hazard, G4Volant *volant)
    50 {
    51   verboseLevel = 0;
    52   ilast = 0;
    53   volant = volant; // ABLA internal particle data
    54   volant->iv = 0;
    55   hazard = hazard; // Random seeds
    56 
    57   randomGenerator = new G4InclGeant4Random();
    58   //randomGenerator = new G4Ranecu();
    59   varntp = new G4VarNtp();
    60   pace = new G4Pace();
    61   ald = new G4Ald();
    62   eenuc = new G4Eenuc();
    63   ec2sub = new G4Ec2sub();
    64   ecld = new G4Ecld();
    65   fb = new G4Fb();
    66   fiss = new G4Fiss();
    67   opt = new G4Opt();
    68 }
    6942
    7043G4Abla::G4Abla(G4Hazard *aHazard, G4Volant *aVolant, G4VarNtp *aVarntp)
     
    10982G4Abla::~G4Abla()
    11083{
     84  delete fissionModel;
    11185  delete randomGenerator;
    11286  delete pace;
     
    483457      //               G4double *pleva_par, G4double *pxeva_par, G4double *pyeva_par,
    484458      //               G4double *ff_par, G4int *inttype_par, G4int *inum_par);
    485       G4double zf1, af1, malpha1, ffpleva1, ffpxeva1, ffpyeva1;
    486       G4int ff1, ftype1;
     459      G4double zf1 = 0.0, af1 = 0.0, malpha1 = 0.0, ffpleva1 = 0.0, ffpxeva1 = 0.0, ffpyeva1 = 0.0;
     460      G4int ff1 = 0, ftype1 = 0;
    487461      evapora(zff1, aff1, epf1_out, 0.0, &zf1, &af1, &malpha1, &ffpleva1,
    488462              &ffpxeva1, &ffpyeva1, &ff1, &ftype1, &inum);
     
    560534      //               G4double *pleva_par, G4double *pxeva_par, G4double *pyeva_par,
    561535      //               G4double *ff_par, G4int *inttype_par, G4int *inum_par);
    562       G4double zf2, af2, malpha2, ffpleva2, ffpxeva2, ffpyeva2;
    563       G4int ff2, ftype2;
     536      G4double zf2 = 0.0, af2 = 0.0, malpha2 = 0.0, ffpleva2 = 0.0, ffpxeva2 = 0.0, ffpyeva2 = 0.0;
     537      G4int ff2 = 0, ftype2 = 0;
    564538      evapora(zff2,aff2,epf2_out,0.0,&zf2,&af2,&malpha2,&ffpleva2,
    565539              &ffpxeva2,&ffpyeva2,&ff2,&ftype2,&inum);
     
    16081582                    G4double *sbp_par, G4double *sba_par, G4double *ecn_par,
    16091583                    G4double *ecp_par,G4double *eca_par, G4double *bp_par,
    1610                     G4double *ba_par, G4int inttype, G4int inum, G4int itest)
     1584                    G4double *ba_par, G4int, G4int inum, G4int itest)
    16111585{
    16121586  G4int dummy0 = 0;
     
    17581732
    17591733  imaxwell = 1;
    1760   inttype = 0;
    17611734 
    17621735  // limiting of excitation energy where fission occurs                   
     
    28422815  i = idint(y/(2.0e-02)) + 1;
    28432816   
    2844   if(i >= bsbkSize) {
     2817  if((i + 1) >= bsbkSize) {
    28452818    if(verboseLevel > 2) {
    2846       G4cout <<"G4Abla error: index i = " << i << " is greater than array size permits." << G4endl;
     2819      G4cout <<"G4Abla error: index " << i + 1 << " is greater than array size permits." << G4endl;
    28472820    }
    28482821    bipolResult = 0.0;
     
    37043677// own class
    37053678
    3706 void G4Abla::standardRandom(G4double *rndm, G4long *seed)
    3707 {
    3708   (*seed) = (*seed); // Avoid warning during compilation.
     3679void G4Abla::standardRandom(G4double *rndm, G4long*)
     3680{
    37093681  // Use Geant4 G4UniformRand
    37103682  (*rndm) = randomGenerator->getRandom();
  • trunk/source/processes/hadronic/models/incl/src/G4AblaFission.cc

    r968 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4AblaFission.cc,v 1.3 2008/11/06 08:42:00 gcosmo Exp $
     26// $Id: G4AblaFission.cc,v 1.5 2010/11/17 20:19:09 kaitanie Exp $
    2727// Translation of INCL4.2/ABLA V3
    2828// Pekka Kaitaniemi, HIP (translation)
     
    3636G4AblaFission::G4AblaFission()
    3737{
     38  hazard = 0;
     39  randomGenerator = 0;
    3840}
    3941
     
    10861088}
    10871089
    1088 void G4AblaFission::standardRandom(G4double *rndm, G4long *seed)
    1089 {
    1090   (*seed) = (*seed); // Avoid warning during compilation.
     1090void G4AblaFission::standardRandom(G4double *rndm, G4long*)
     1091{
    10911092  // Use Geant4 G4UniformRand
    10921093  (*rndm) = randomGenerator->getRandom();
  • trunk/source/processes/hadronic/models/incl/src/G4AblaFissionSimfis18.cc

    r968 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4AblaFissionSimfis18.cc,v 1.3 2008/11/06 08:42:00 gcosmo Exp $
     26// $Id: G4AblaFissionSimfis18.cc,v 1.5 2010/11/17 20:19:09 kaitanie Exp $
    2727// Translation of INCL4.2/ABLA V3
    2828// Pekka Kaitaniemi, HIP (translation)
     
    3636G4AblaFissionSimfis18::G4AblaFissionSimfis18()
    3737{
     38  hazard = 0;
     39  randomGenerator = 0;
    3840}
    3941
     
    14121414}
    14131415
    1414 void G4AblaFissionSimfis18::standardRandom(G4double *rndm, G4long *seed)
    1415 {
    1416   (*seed) = (*seed); // Avoid warning during compilation.
     1416void G4AblaFissionSimfis18::standardRandom(G4double *rndm, G4long*)
     1417{
    14171418  // Use Geant4 G4UniformRand
    14181419  (*rndm) = randomGenerator->getRandom();
  • trunk/source/processes/hadronic/models/incl/src/G4Incl.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4Incl.cc,v 1.33 2010/10/29 06:48:43 gunter Exp $
     26// $Id: G4Incl.cc,v 1.37 2010/12/15 07:41:31 gunter Exp $
    2727// Translation of INCL4.2/ABLA V3
    2828// Pekka Kaitaniemi, HIP (translation)
     
    5757  randomGenerator = new G4InclGeant4Random();
    5858  //  randomGenerator = new G4Ranecu();
     59  clearState();
    5960}
    6061
     
    8586  //  randomGenerator = new G4Ranecu();
    8687  randomGenerator = new G4InclGeant4Random();
     88  clearState();
    8789}
    8890
     
    149151
    150152  theLogger = 0;
     153  clearState();
    151154}
    152155
    153156G4Incl::~G4Incl()
    154157{
     158  delete be;
     159  delete ps;
     160  delete fermi;
     161  delete qvp;
     162
    155163  delete randomGenerator;
    156164  delete light_gaus_nuc;
     
    385393void G4Incl::processEventIncl(G4InclInput *input)
    386394{
     395  //G4cout <<"Starting event " << eventnumber << G4endl;
    387396  if(input == 0) {
    388397    G4cerr <<"G4Incl fatal error: NULL pointer passed as input!" << G4endl;
     
    393402  const G4double uma = 931.4942;
    394403  const G4double melec = 0.511;
    395 
    396   G4double   pcorem = 0.0;
    397   G4double   pxrem = 0.0;
    398   G4double   pyrem = 0.0;
    399   G4double   pzrem = 0.0;
     404  const G4double fmp = 938.2796;
     405
     406  G4double pcorem = 0.0;
     407  G4double pxrem = 0.0;
     408  G4double pyrem = 0.0;
     409  G4double pzrem = 0.0;
    400410
    401411  G4double ap = 0.0, zp = 0.0, mprojo = 0.0, pbeam = 0.0;
    402412
    403413  varntp->clear();
    404   if(calincl->bulletType() == 3) { // pi+
     414
     415  if(calincl->bulletType() == -12) {
     416    be->ia_be = std::abs(calincl->bulletType());
     417    be->iz_be = 6;
     418  } else if(calincl->bulletType() == -666) {
     419    be->iz_be = calincl->extendedProjectileZ();
     420    be->ia_be = calincl->extendedProjectileA();
     421  }
     422
     423  if(calincl->isExtendedProjectile() == false && calincl->bulletType() < -max_a_proj) {
     424  //  if(calincl->bulletType() < -max_a_proj) {
     425    G4cout <<"max a of composite projectile is: " << max_a_proj << G4endl;
     426    exit(0);
     427  }
     428  if(calincl->bulletType() < 0) {
     429    //    calincl->bulletType() = std::floor(calincl->bulletType() + 0.1); WTF???
     430    be->pms_be=100.;
     431    G4int i_tabled=0;
     432    if(be->iz_be == 3 && be->ia_be == 6) {
     433      be->rms_be=2.56;
     434      be->bind_be=32.0;
     435      i_tabled=1;
     436    } else if(be->iz_be == 3 && be->ia_be == 7) { // TODO: Check the values!
     437      be->rms_be=2.56;
     438      be->bind_be=32.0;
     439      i_tabled=1;
     440    } else if(be->iz_be == 3 && be->ia_be == 8) {
     441      be->rms_be=2.40;
     442      be->bind_be=39.25;
     443      i_tabled=1;
     444    } else if(be->iz_be == 4 && be->ia_be == 7) {
     445      be->rms_be=2.51;
     446      be->bind_be=58.17;
     447      i_tabled=1;
     448    } else if(be->iz_be == 4 && be->ia_be == 9) {
     449      be->rms_be=2.51;
     450      be->bind_be=58.17;
     451      i_tabled=1;
     452    } else if(be->iz_be == 4 && be->ia_be == 10) {
     453      be->rms_be=2.45;
     454      be->bind_be=64.75;
     455      i_tabled=1;
     456    } else if(be->iz_be == 5 && be->ia_be == 10) {
     457      be->rms_be=2.45;
     458      be->bind_be=64.75;
     459      i_tabled=1;
     460    } else if(be->iz_be == 5 && be->ia_be == 11) {
     461      be->rms_be=2.40;
     462      be->bind_be=76.21;
     463      i_tabled=1;
     464    } else if(be->iz_be == 6 && be->ia_be == 9) { // TODO: Check the values!
     465      be->rms_be=2.44;
     466      be->bind_be=92.17;
     467      i_tabled=1;
     468    } else if(be->iz_be == 6 && be->ia_be == 10) { // TODO: Check the values!
     469      be->rms_be=2.44;
     470      be->bind_be=92.17;
     471      i_tabled=1;
     472    } else if(be->iz_be == 6 && be->ia_be == 11) { // TODO: Check the values!
     473      be->rms_be=2.44;
     474      be->bind_be=92.17;
     475      i_tabled=1;
     476    } else if(be->iz_be == 6 && calincl->bulletType() == -12) { // Special Carbon case
     477      G4cout <<"Carbon 12 (special) selected." << G4endl;
     478      be->rms_be=2.44;
     479      be->bind_be=92.17;
     480      i_tabled=1;
     481    } else if(be->iz_be == 6 && be->ia_be == 12) {
     482      be->rms_be=2.44;
     483      be->bind_be=92.17;
     484      i_tabled=1;
     485    } else if(be->iz_be == 7 && be->ia_be == 16) {
     486      be->rms_be=2.73;
     487      be->bind_be=127.62;
     488      i_tabled=1;
     489    } else {
     490      G4cout <<"Warning: No rms and binding for projectile ion A = " << be->ia_be << " Z = " << be->iz_be << G4endl;
     491      be->rms_be=2.44;
     492      be->bind_be=92.17;
     493      G4cout <<"Warning: Using probably bad values rms = " << be->rms_be << " binding = " << be->bind_be << G4endl;
     494      i_tabled=1;     
     495    }
     496     
     497    if(i_tabled == 0) {
     498      G4cout <<"This heavy ion (a,z)= " << be->ia_be << " " << be->iz_be << " is not defined as beam in INCL" << G4endl;
     499      exit(0);
     500    }
     501     
     502    //    G4cout <<"z projectile, rms_r, rms_p (gaussian model)" << be->iz_be << " " << be->rms_be << " " << be->pms_be << G4endl;
     503    //    G4cout <<"binding energy (mev):" << be->bind_be << G4endl;
     504    //    G4cout <<"fermi-breakup dresner below a=" << calincl->f[11] << G4endl;
     505  }     
     506  //  G4cout <<"Target Mass and Charge: " << calincl->targetA() << " " << calincl->targetZ() << G4endl;
     507  //  calincl->f[10] = 0; // No clusters
     508
     509  if(calincl->bulletType() == -12) {  // C12 special case
     510    mprojo=fmp*std::abs(calincl->bulletType()) - be->bind_be;
     511    pbeam=std::sqrt(calincl->bulletE()*(calincl->bulletE()+2.*mprojo));
     512    ap=std::abs(calincl->bulletType());
     513    zp=be->iz_be;
     514  } else if(calincl->bulletType() == -666) { // Generic extended projectile
     515    mprojo=fmp*be->ia_be - be->bind_be;
     516    pbeam=std::sqrt(calincl->bulletE()*(calincl->bulletE()+2.*mprojo));
     517    ap=be->ia_be;
     518    zp=be->iz_be;
     519  }
     520  // pi+
     521  if(calincl->bulletType() == 3) {
    405522    mprojo = 139.56995;
    406523    ap = 0.0;
     
    408525  }
    409526
    410   if(calincl->bulletType() == 4) { // pi0
     527  // pi0
     528  if(calincl->bulletType() == 4) {
    411529    mprojo = 134.9764;
    412530    ap = 0.0;
     
    414532  }
    415533
    416   if(calincl->bulletType() == 5) { // pi-
     534  // pi-
     535  if(calincl->bulletType() == 5) {
    417536    mprojo = 139.56995;
    418537    ap = 0.0;
     
    420539  }
    421540
    422   // Coulomb en entree seulement pour les particules ci-dessous.
    423   if(calincl->bulletType() == 1) { // proton
     541  // coulomb en entree seulement pour les particules ci-dessous
     542
     543  // proton
     544  if(calincl->bulletType() == 1) {
    424545    mprojo = 938.27231;
    425546    ap = 1.0;
    426547    zp = 1.0;
    427548  }
    428  
    429   if(calincl->bulletType() == 2) { // neutron 
     549
     550  // neutron 
     551  if(calincl->bulletType() == 2) {
    430552    mprojo = 939.56563;
    431553    ap = 1.0;
    432554    zp = 0.0;
    433555  }
    434  
    435   if(calincl->bulletType() == 6) { // deuteron
     556
     557  // deuteron
     558  if(calincl->bulletType() == 6) {
    436559    mprojo = 1875.61276;
    437560    ap = 2.0;
    438561    zp = 1.0;
    439562  }
    440  
    441   if(calincl->bulletType() == 7) { // triton
     563
     564  // triton
     565  if(calincl->bulletType() == 7) {
    442566    mprojo = 2808.95;
    443567    ap = 3.0;
    444568    zp = 1.0;
    445569  }
    446  
    447   if(calincl->bulletType() == 8) { // He3
     570
     571  // He3
     572  if(calincl->bulletType() == 8) {
    448573    mprojo = 2808.42;
    449574    ap = 3.0;
     
    451576  }
    452577
    453   if(calincl->bulletType() == 9) { // Alpha
     578  // Alpha
     579  if(calincl->bulletType() == 9) {
    454580    mprojo = 3727.42;
    455581    ap = 4.0;
     
    457583  }
    458584
    459   if(calincl->bulletType() == -12) { // Carbon
    460     mprojo = 12.0 * 938.27231;
     585  // Carbon
     586  if(calincl->bulletType() == -12) {
     587    mprojo = 6.0*938.27231 + 6.0*939.56563;
    461588    ap = 12.0;
    462589    zp = 6.0;
    463   } else if(calincl->bulletType() == -666) { // Generic extended ion projectile
    464     mprojo = calincl->extendedProjectileA() * 938.27231;
    465     ap = calincl->extendedProjectileA();
    466     zp = calincl->extendedProjectileZ();
    467590  }
    468591
     
    482605  G4double bimpac = 0.0;
    483606  G4int jrem = 0;
     607  G4double xjrem = 0.0, yjrem = 0.0, zjrem = 0.0;
    484608  G4double alrem = 0.0;
    485609
    486   /**
    487    * Coulomb barrier treatment.
    488    */
     610  // Coulomb barrier
     611 
    489612  G4double probaTrans = 0.0;
    490613  G4double rndm = 0.0;
    491614
    492615  if((calincl->bulletType() == 1) || (calincl->bulletType() >= 6)) {
     616    //    probaTrans = coulombTransm(calincl->bulletE(),apro,zpro,calincl->targetA(),calincl->targetZ());
    493617    probaTrans = coulombTransm(calincl->bulletE(),ap,zp,calincl->targetA(),calincl->targetZ());
    494618    standardRandom(&rndm, &(hazard->ial));
     
    499623  }
    500624
    501   /**
    502    * Call the actual INCL routine.
    503    */
    504 
     625  //  G4cout <<"Before PNU:" << G4endl;
    505626  //  randomGenerator->printSeeds();
    506   G4double jremx, jremy, jremz;
    507   pnu(&ibert, &nopart,&izrem,&iarem,&esrem,&erecrem,&alrem,&berem,&garem,&bimpac,&jrem,
    508       &jremx, &jremy, &jremz);
     627  // Call the actual INCL routine:
     628  pnu(&ibert, &nopart,&izrem,&iarem,&esrem,&erecrem,&alrem,&berem,&garem,&bimpac,
     629      &jrem, &xjrem, &yjrem, &zjrem);
     630  //  G4cout <<"After PNU:" << G4endl;
     631  //  randomGenerator->printSeeds();
     632  G4double mrem = int(zjrem/197.328); // CHECK
     633  if (mrem > jrem) mrem=jrem;
     634  if (mrem < -jrem) mrem=-jrem;
     635
     636//   nopart=1;
     637//   kind[0]=1;
     638//   ep[0]=799.835;
     639//   alpha[0]=0.08716;
     640//   beta[0]=0.;
     641//   gam[0]=0.99619;
     642//   izrem=82;
     643//   iarem=208;
     644//   esrem=200.;
     645//   erecrem=0.18870;
     646//   alrem=-0.47101;
     647//   berem=0.;
     648//   garem=0.88213;
     649//   bimpac=2.;
    509650  forceAbsor(&nopart, &iarem, &izrem, &esrem, &erecrem, &alrem, &berem, &garem, &jrem);
    510   G4double aprf = double(iarem); // mass number of the prefragment
    511   G4double jprf = 0.0;           // angular momentum of the prefragment
    512 
    513   // Mean angular momentum of prefragment.                                 
    514   jprf = 0.165 * std::pow(at,(2.0/3.0)) * aprf * (at - aprf) / (at - 1.0);                               
     651  G4double aprf = double(iarem);    // mass number of the prefragment
     652  G4double jprf = 0.0;                // angular momentum of the prefragment
     653
     654  // Mean angular momentum of prefragment                                 
     655  jprf = 0.165 * std::pow(at,(2.0/3.0)) * aprf*(at - aprf)/(at - 1.0);                               
    515656  if (jprf < 0) {
    516657    jprf = 0.0;
    517658  }
    518659
    519   // Reference M. de Jong, Ignatyuk, Schmidt Nuc. Phys A 613, p442, 7th line
     660  // check m.de jong, ignatyuk, schmidt nuc.phys a 613, pg442, 7th line
    520661  jprf = std::sqrt(2*jprf);
     662
    521663  jprf = jrem;
    522   varntp->jremn = jrem; // Copy jrem to output tuple.
    523 
    524   G4double numpi = 0;  // Number  of pions.
    525   G4double multn = 0;  // Number (multiplicity) of neutrons.
    526   G4double multp = 0;  // Number (multiplicity) of protons.
    527 
    528   // Ecriture dans le ntuple des particules de cascade (sauf remnant).     
    529   varntp->ntrack = nopart; // Nombre de particules pour ce tir.
     664  varntp->jremn = jrem;      // jrem copie dans le ntuple
     665
     666  G4double numpi = 0;  // compteurs de pions, neutrons protons
     667  G4double multn = 0;
     668  G4double multp = 0;
     669
     670  // ecriture dans le ntuple des particules de cascade (sauf remnant)     
     671  varntp->ntrack = nopart;          // nombre de particules pour ce tir
     672  if(varntp->ntrack >= VARNTPSIZE) {
     673    if(verboseLevel > 2) {
     674      G4cout <<"G4Incl error: Output data structure not big enough." << G4endl;
     675    }
     676  }
    530677  varntp->massini = iarem;
    531678  varntp->mzini = izrem;
     
    533680  varntp->bimpact = bimpac;
    534681 
    535   /**
    536    * Three ways to compute the mass of the remnant:
    537    * -from the output of the cascade and the canonic mass
    538    * -from energy balance (input - all emitted energies)
    539    * -following the approximations of the cugnon code (esrem...)
    540    */
    541   G4double f0 = calincl->targetA();
    542   G4double f1 = calincl->targetZ();
    543   G4double f2 = calincl->bulletE();
    544   G4double mcorem = mprojo + f2 + abla->pace2(f0, f1) + f0 * uma - f1 * melec;
     682  //  three ways to compute the mass of the remnant:
     683  //                -from the output of the cascade and the canonic mass
     684  //                -from energy balance (input - all emitted energies)
     685  //                -following the approximations of the cugnon code (esrem...)
     686  G4double mcorem = mprojo + calincl->bulletE() + abla->pace2(double(calincl->targetA()),double(calincl->targetZ()))
     687    + calincl->targetA()*uma - calincl->targetZ()*melec;
    545688
    546689  G4double pxbil = 0.0;
     
    549692
    550693  if(nopart > -1) {
    551     for(G4int j = 0; j < nopart; j++) {
    552       varntp->itypcasc[j] = 1;
     694    // Fill the projectile spectator variables
     695    varntp->masp = ps->a_projspec;
     696    varntp->mzsp = ps->z_projspec;
     697    varntp->exsp = ps->ex_projspec;
     698    varntp->spectatorP1 = ps->p1_projspec;
     699    varntp->spectatorP2 = ps->p2_projspec;
     700    varntp->spectatorP3 = ps->p3_projspec;
     701    varntp->spectatorT = ps->t_projspec;
     702    for(G4int j = 0; j <= nopart; j++) {
     703      if(ep[j] < 0.0) { // Workaround to avoid negative energies (and taking std::sqrt of a negative number).
     704        G4cout <<"G4Incl: Not registering particle with energy: " << ep[j] << G4endl;
     705        continue;
     706      }
     707      if(kind[j] == 0) continue; // Empty particle rows are sometimes produced by lurking indexing problems. We can simply skip those "bad" entries...
     708      if(gam[j] > CLHEP::pi) {
     709        if(verboseLevel > 2) {
     710          G4cout <<"G4Incl: Just avoided floating point exception by using an ugly hack..." << G4endl;
     711        }
     712        continue; // Avoid floating point exception
     713      }
     714
     715      varntp->itypcasc[j] = 1; // Particle was produced by the cascade
     716      // Spectators of composite projectiles (7/2006, AB)
     717      // (kind is negative in that case)
     718      if(kind[j] <= 0) { // Particle is a projectile spectator that comes directly from the cascade
     719        kind[j] *= -1;
     720        varntp->itypcasc[j]=-1;
     721        //      G4cout <<"Spectator registered!" << G4endl;
     722        //      continue;
     723      }
     724       
    553725      // kind(): 1=proton, 2=neutron, 3=pi+, 4=pi0, 5=pi -     
    554726      if(kind[j] == 1) {
    555727        varntp->avv[j] = 1;
    556728        varntp->zvv[j] = 1;
    557         varntp->plab[j] = std::sqrt(ep[j] * (ep[j] + 1876.5592)); // cugnon
     729        varntp->plab[j] = std::sqrt(ep[j]*(ep[j]+1876.5592)); // cugnon
    558730        multp = multp + 1;
    559731        mcorem = mcorem - ep[j] - 938.27231;
     
    568740        varntp->zvv[j] = 0;
    569741        varntp->plab[j] = std::sqrt(ep[j]*(ep[j]+1876.5592)); // cugnon
    570         //varntp->plab[j] = std::sqrt(ep[j] * (ep[j] + 1879.13126)); // PK mass check
    571742        multn = multn + 1;
    572743        mcorem = mcorem - ep[j] - 939.56563;
     
    576747        }
    577748      }
    578 
     749     
    579750      if(kind[j] == 3) {
    580751        varntp->avv[j] = -1;
     
    656827        mcorem = mcorem - ep[j] - 3724.818;
    657828        if(verboseLevel > 3) {
    658           G4cout <<"G4Incl: He4 produced! " << G4endl;
     829          G4cout <<"G4Incl: He3 produced! " << G4endl;
    659830          G4cout <<"G4Incl: Momentum: "<< varntp->plab[j] << G4endl;
    660831        }
     
    669840
    670841      if(verboseLevel > 3) {
    671         G4cout <<"Momentum: " << varntp->plab[j] << G4endl;
    672         G4cout <<"Theta: " << varntp->tetlab[j] << G4endl;
    673         G4cout <<"Phi: " << varntp->philab[j] << G4endl;
     842        G4cout <<"Momentum: " << varntp->plab[j]   << G4endl;
     843        G4cout <<"Theta: "    << varntp->tetlab[j] << G4endl;
     844        G4cout <<"Phi: "      << varntp->philab[j] << G4endl;
    674845      }
    675846    }
    676847
    677848    // calcul de la masse (impulsion) du remnant coherente avec la conservation d'energie:
    678     pcorem=std::sqrt(erecrem*(erecrem +2.*938.2796*iarem));   // cugnon
    679     mcorem = 938.2796*iarem;                               // cugnon
    680                
     849    pcorem = std::sqrt(erecrem*(erecrem + 2.0 * 938.2796 * iarem));   // cugnon
     850    mcorem = 938.2796 * iarem;                               // cugnon
     851    varntp->pcorem = pcorem;
     852    varntp->mcorem = mcorem;
    681853    // Note: Il faut negliger l'energie d'excitation (ESREM) pour que le bilan
    682854    // d'impulsion soit correct a la sortie de la cascade.....et prendre la
    683855    // masse MCOREM comme ci-dessus (fausse de ~1GeV par rapport aux tables...)       
    684     pxrem=pcorem*alrem;
    685     pyrem=pcorem*berem;
    686     pzrem=pcorem*garem;
    687        
    688     pxbil=pxbil+pxrem;
    689     pybil=pybil+pyrem;
    690     pzbil=pzbil+pzrem;
    691 
    692     if((std::fabs(pzbil-pbeam) > 5.0) || (std::sqrt(std::pow(pxbil,2)+std::pow(pybil,2)) >= 3.0)) {
     856    pxrem = pcorem * alrem;
     857    pyrem = pcorem * berem;
     858    pzrem = pcorem * garem;
     859    varntp->pxrem = pxrem;
     860    varntp->pyrem = pyrem;
     861    varntp->pzrem = pzrem;
     862    pxbil = pxbil + pxrem;
     863    pybil = pybil + pyrem;
     864    pzbil = pzbil + pzrem;
     865
     866    // If on purpose, add here the spectator nuclei:   
     867    if(calincl->bulletType() < 0 && ps->a_projspec != 0) {
     868      pxbil=pxbil+ps->p1_projspec;
     869      pybil=pybil+ps->p2_projspec;
     870      pzbil=pzbil+ps->p3_projspec;
     871    }
     872
     873    if((std::fabs(pzbil - pbeam) > 5.0) || (std::sqrt(std::pow(pxbil,2) + std::pow(pybil,2)) >= 3.0)) {
    693874      if(verboseLevel > 3) {
    694875        G4cout <<"Bad momentum conservation after INCL:" << G4endl;
     
    704885    varntp->iafis = 0;
    705886
    706     //  varntp->ntrack = varntp->ntrack + 1;  // on recopie le remnant dans le ntuple
     887    // on recopie le remnant dans le ntuple
     888    varntp->ntrack = varntp->ntrack + 1;
    707889    varntp->massini = iarem;
    708890    varntp->mzini = izrem;
    709891    varntp->exini = esrem;
    710     varntp->itypcasc[varntp->ntrack] = 1;
    711     varntp->avv[varntp->ntrack] = iarem;
    712     varntp->zvv[varntp->ntrack]= izrem;
    713     varntp->plab[varntp->ntrack] = pcorem;
    714     varntp->enerj[varntp->ntrack] = std::sqrt(std::pow(pcorem,2) + std::pow(mcorem,2)) - mcorem;
    715     varntp->tetlab[varntp->ntrack] = 180.0*std::acos(garem)/3.141592654;
    716     varntp->philab[varntp->ntrack] = 180.0*std::atan2(berem,alrem)/3.141592654;
    717     varntp->ntrack++;
    718     varntp->mulncasc = varntp->ntrack;
    719     varntp->mulnevap = 0;
    720     varntp->mulntot = varntp->mulncasc + varntp->mulnevap;
    721     if(verboseLevel > 3) {
    722       G4cout <<"G4Incl: Returning nucleus fragment. " << G4endl;
    723       G4cout <<"G4Incl: Fragment A = " << varntp->avv[varntp->ntrack] << " Z = " << varntp->zvv[varntp->ntrack] << G4endl;
    724       G4cout <<"Energy: " << varntp->enerj[varntp->ntrack] << G4endl;
    725       G4cout <<"Momentum: " << varntp->plab[varntp->ntrack] << G4endl;
    726       G4cout <<"Theta: " << varntp->tetlab[varntp->ntrack] << G4endl;
    727       G4cout <<"Phi: " << varntp->philab[varntp->ntrack] << G4endl;
    728     }
    729   }
    730   else {
    731     if(nopart == -2) {
    732       varntp->ntrack = -2; //FIX: Error flag to remove events containing unphysical events (Ekin > Ebullet).
    733     }
    734     else {
    735       varntp->ntrack = -1;
    736     }
     892    varntp->pxrem = pxrem;
     893    varntp->pyrem = pyrem;
     894    varntp->pzrem = pzrem;
     895    varntp->mcorem = mcorem;
     896    varntp->erecrem = pcorem;
     897    varntp->erecrem = erecrem;
     898
     899#ifdef G4INCLDEBUG
     900    theLogger->fillHistogram1D("bimpact", varntp->bimpact);
     901#endif
     902
     903#ifdef G4INCLDEBUG
     904    theLogger->fillHistogram1D("mzini", varntp->mzini);
     905#endif
     906  }
     907  if(nopart == -2) {
     908    varntp->ntrack = -2; //FIX: Error flag to remove events containing unphysical events (Ekin > Ebullet).
     909    evaporationResult->ntrack = -2; //FIX: Error flag to remove events containing unphysical events (Ekin > Ebullet).
     910  }
     911  else if(nopart == -1) {
     912    varntp->ntrack = -1;
     913    evaporationResult->ntrack = -1;
     914  }
     915  if(verboseLevel > 2) {
     916    G4cout << __FILE__ << ":" << __LINE__ << "Dump varntp after combining: " << G4endl;
     917    varntp->dump();
    737918  }
    738919}
     
    81508331}
    81518332
    8152 void G4Incl::standardRandom(G4double *rndm, G4long *seed)
    8153 {
    8154   (*seed) = (*seed); // Avoid warning during compilation.
     8333void G4Incl::standardRandom(G4double *rndm, G4long*)
     8334{
    81558335  // Use Geant4 G4UniformRand
    81568336  //  (*rndm) = G4UniformRand();
     
    85508730    } // enddo
    85518731    G4double p_spec2=std::pow(p1_spec,2)+std::pow(p2_spec,2)+std::pow(p3_spec,2);
    8552     G4double s_spec = sqrt(std::pow(e_spec,2)-p_spec2);
     8732    G4double s_spec = std::sqrt(std::pow(e_spec,2)-p_spec2);
    85538733
    85548734    // no projectile spectator if a>=4 and a=z or a=n (no dresner breakup)
     
    88449024}
    88459025
     9026// Initialization helper
     9027void G4Incl::clearState() {
     9028  G4int epSize = 300;
     9029  for(G4int i = 0; i < epSize; ++i) {
     9030    kind[i] = 0;
     9031    ep[i] = 0.0;
     9032    alpha[i] = 0.0;
     9033    beta[i] = 0.0;
     9034    gam[i] = 0.0;
     9035  }
     9036  inside_step = 0;
     9037}
     9038
    88469039// C------------------------------------------------------------------------
    88479040// C Logging
     
    89239116//       COMMON/BL2/CROIS(19900),K,IND(20000),JND(20000)
    89249117//       COMMON/BL3/R1,R2,X1(300),X2(300),X3(300),IA1,IA2,RAB2             P-N22270
     9118
     9119  if(index < 0) {
     9120    G4cout <<";; Error! index < 0! index = " << index << G4endl;
     9121    return;
     9122  }
    89259123
    89269124  G4int i_ind1 = bl1->ind1[bl2->ind[index]];
  • trunk/source/processes/hadronic/models/incl/src/G4InclAblaCascadeInterface.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4InclAblaCascadeInterface.cc,v 1.16 2010/10/29 06:48:43 gunter Exp $
     26// $Id: G4InclAblaCascadeInterface.cc,v 1.20 2010/11/17 20:19:09 kaitanie Exp $
    2727// Translation of INCL4.2/ABLA V3
    2828// Pekka Kaitaniemi, HIP (translation)
     
    116116  incl->setInput(calincl);
    117117
    118   G4InclInput::printProjectileTargetInfo(aTrack, theNucleus);
    119   calincl->printInfo();
     118  //  G4InclInput::printProjectileTargetInfo(aTrack, theNucleus);
     119  //  calincl->printInfo();
    120120
    121121#ifdef DEBUGINCL
     
    439439        }
    440440      }
     441      delete theFermiBreakupResult;
     442      theFermiBreakupResult = 0;
     443
    441444      if(std::abs(fourMomentumBalance.mag() / MeV) > 0.1 * MeV) {
    442445        G4cout <<"Four-momentum balance after remnant nucleus Fermi break-up:" << G4endl;
  • trunk/source/processes/hadronic/models/incl/src/G4InclAblaDataFile.cc

    r1337 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4InclAblaDataFile.cc,v 1.9 2010/06/14 16:10:01 gcosmo Exp $
     26// $Id: G4InclAblaDataFile.cc,v 1.10 2010/11/17 20:19:09 kaitanie Exp $
    2727// Translation of INCL4.2/ABLA V3
    2828// Pekka Kaitaniemi, HIP (translation)
     
    116116  vgsldin.close();
    117117
    118   int A = 0, Zbegin = 0, Zend = 0;
    119118  G4String str1, str2, str3;
    120119  for(int i = 0; i < 500; i++) {
     
    124123  }
    125124 
     125  int A = 0, Zbegin = 0, Zend = 0;
    126126  for(int i = 0; i < massnumbers; i++) {
    127127    pace2in >> str1 >> A >> str2 >> Zbegin >> str3 >> Zend;
    128     for(int j = Zbegin; j <= Zend; j++) {
    129       pace2in >> pace2;
    130       setPace2(A, j, pace2);
     128    if(Zbegin >= 0 && Zbegin < getPaceCols() &&
     129       A >= 0 && A < getPaceRows()) {
     130      for(int j = Zbegin; j <= Zend; j++) {
     131        pace2in >> pace2;
     132        setPace2(A, j, pace2);
     133      }
    131134    }
    132135  }
  • trunk/source/processes/hadronic/models/incl/src/G4InclAblaLightIonInterface.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4InclAblaLightIonInterface.cc,v 1.14 2010/10/29 06:48:43 gunter Exp $
     26// $Id: G4InclAblaLightIonInterface.cc,v 1.16 2010/11/17 20:19:09 kaitanie Exp $
    2727// Translation of INCL4.2/ABLA V3
    2828// Pekka Kaitaniemi, HIP (translation)
     
    103103  }
    104104
    105   if(verboseLevel > 1) {
    106     G4Calincl::printProjectileTargetInfo(aTrack, theNucleus);
    107   }
    108 
    109105  // Inverse kinematics for targets with Z = 1 and A = 1
    110106  //  if(false) {
    111107  G4LorentzRotation toBreit = aTrack.Get4Momentum().boostVector();
    112108
    113   if(theNucleus.GetZ_asInt() == 1 && theNucleus.GetA_asInt() == 1 && G4Calincl::canUseInverseKinematics(aTrack, theNucleus)) {
     109  if(theNucleus.GetZ_asInt() == 1 && theNucleus.GetA_asInt() == 1 && G4InclInput::canUseInverseKinematics(aTrack, theNucleus)) {
    114110    G4ParticleDefinition *oldTargetDef = theTableOfParticles->GetIon(theNucleus.GetA_asInt(), theNucleus.GetZ_asInt(), 0.0);
    115111    const G4ParticleDefinition *oldProjectileDef = aTrack.GetDefinition();
    116112
     113    if(oldProjectileDef != 0 && oldTargetDef != 0) {
    117114    G4int oldTargetA = oldTargetDef->GetAtomicMass();
    118115    G4int newTargetA = oldProjectileDef->GetAtomicMass();
    119116    G4int newTargetZ = oldProjectileDef->GetAtomicNumber();
    120117
    121     if(newTargetA > 0 && newTargetZ > 0 && oldTargetDef != 0 && oldProjectileDef != 0) {
     118    if(newTargetA > 0 && newTargetZ > 0) {
    122119      G4Nucleus swappedTarget(oldProjectileDef->GetAtomicMass(), oldProjectileDef->GetAtomicNumber());
    123120
     
    137134      G4cout <<"Badly defined target after swapping. Falling back to normal (non-swapped) mode." << G4endl;
    138135      calincl = new G4InclInput(aTrack, theNucleus, false);
     136    }
    139137    }
    140138  } else {
     
    489487        }
    490488      }
     489      delete theSpectatorFermiBreakupResult;
     490      theSpectatorFermiBreakupResult = 0;
     491
    491492      if(std::abs(fourMomentumBalance.mag() / MeV) > 0.1 * MeV) {
    492493        G4cout <<"Four-momentum balance after spectator nucleus Fermi break-up:" << G4endl;
     
    588589        }
    589590      }
     591      delete theFermiBreakupResult;
     592      theFermiBreakupResult = 0;
     593
    590594      if(std::abs(fourMomentumBalance.mag() / MeV) > 0.1 * MeV) {
    591595        G4cout <<"Four-momentum balance after remnant nucleus Fermi break-up:" << G4endl;
     
    697701  }
    698702
     703  delete fermiBreakUp;
    699704  delete calincl;
    700705  calincl = 0;
  • trunk/source/processes/hadronic/models/incl/src/G4InclCascadeInterface.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4InclCascadeInterface.cc,v 1.12 2010/10/26 02:47:59 kaitanie Exp $
     26// $Id: G4InclCascadeInterface.cc,v 1.15 2010/11/17 20:19:09 kaitanie Exp $
    2727// Translation of INCL4.2/ABLA V3
    2828// Pekka Kaitaniemi, HIP (translation)
     
    3434
    3535#include "G4InclCascadeInterface.hh"
     36#include "G4FermiBreakUp.hh"
    3637#include "math.h"
    3738#include "G4GenericIon.hh"
    3839#include "CLHEP/Random/Random.h"
    3940
    40 G4InclCascadeInterface::G4InclCascadeInterface()
     41G4InclCascadeInterface::G4InclCascadeInterface(const G4String& nam)
     42  :G4VIntraNuclearTransportModel(nam)
    4143{
    4244  hazard = new G4Hazard();
     
    4547
    4648  varntp = new G4VarNtp();
    47   inclInput = 0;
     49  calincl = 0;
    4850  ws = new G4Ws();
    4951  mat = new G4Mat();
    50   incl = new G4Incl(hazard, inclInput, ws, mat, varntp);
     52  incl = new G4Incl(hazard, calincl, ws, mat, varntp);
     53
     54  theExcitationHandler = new G4ExcitationHandler;
     55  thePrecoModel = new G4PreCompoundModel(theExcitationHandler);
     56
     57  if(!getenv("G4INCLABLANOFERMIBREAKUP")) { // Use Fermi Break-up by default if it is NOT explicitly disabled
     58    incl->setUseFermiBreakUp(true);
     59  }
    5160
    5261  verboseLevel = 0;
     
    5564G4InclCascadeInterface::~G4InclCascadeInterface()
    5665{
     66  delete thePrecoModel;
     67  delete theExcitationHandler;
     68
    5769  delete hazard;
    5870  delete varntp;
    59   delete inclInput;
    6071  delete ws;
    6172  delete mat;
     
    6879
    6980  G4int particleI;
     81  G4int bulletType = 0;
    7082
    7183  // Print diagnostic messages: 0 = silent, 1 and 2 = verbose
     
    91103  G4DynamicParticle *cascadeParticle = 0;
    92104  G4ParticleDefinition *aParticleDefinition = 0;
     105 
     106  G4ReactionProductVector *thePrecoResult = 0;
     107  G4ParticleTable *theTableOfParticles = G4ParticleTable::GetParticleTable();
    93108
    94109  // INCL assumes the projectile particle is going in the direction of
     
    102117  G4LorentzRotation toLabFrame = toZ.inverse();
    103118
    104   inclInput = new G4InclInput(aTrack, theNucleus, false);
    105 
    106119  theResult.Clear(); // Make sure the output data structure is clean.
     120
     121  calincl = new G4InclInput(aTrack, theNucleus, false);
     122  incl->setInput(calincl);
     123
     124  //  G4InclInput::printProjectileTargetInfo(aTrack, theNucleus);
     125  //  calincl->printInfo();
    107126
    108127#ifdef DEBUGINCL
     
    117136  G4double eKinSum = bulletE;
    118137  G4LorentzVector labv = G4LorentzVector(0.0, 0.0, std::sqrt(bulletE*(bulletE + 2.*mass)), bulletE + mass + amass);
     138  G4LorentzVector labvA = G4LorentzVector(0.0, 0.0, 0.0, 0.0);
    119139  G4cout <<"Energy in the beginning = " << labv.e() / MeV << G4endl;
    120140#endif
    121141
    122142  // Check wheter the input is acceptable.
    123   if((inclInput->bulletType() != 0) && ((inclInput->targetA() != 1) && (inclInput->targetZ() != 1))) {
     143  if((calincl->bulletType() != 0) && ((calincl->targetA() != 1) && (calincl->targetZ() != 1))) {
    124144    ws->nosurf = -2;  // Nucleus surface, -2 = Woods-Saxon
    125145    ws->xfoisa = 8;
     
    130150
    131151    mat->nbmat = 1;
    132     mat->amat[0] = int(inclInput->targetA());
    133     mat->zmat[0] = int(inclInput->targetZ());
     152    mat->amat[0] = int(calincl->targetA());
     153    mat->zmat[0] = int(calincl->targetZ());
    134154
    135155    incl->initIncl(true);
     
    140160        G4cout <<"G4InclCascadeInterface: Try number = " << nTries << G4endl;
    141161      }
    142       incl->processEventIncl(inclInput);
     162      incl->processEventIncl(calincl);
    143163
    144164      if(verboseLevel > 1) {
     
    151171       * Diagnostic output
    152172       */
    153       G4cout <<"G4InclCascadeInterface: Bullet type: " << inclInput->bulletType() << G4endl;
    154       G4cout <<"G4Incl4AblaCascadeInterface: Bullet energy: " << inclInput->bulletE() << " MeV" << G4endl;
    155 
    156       G4cout <<"G4InclCascadeInterface: Target A:  " << inclInput->targetA() << G4endl;
    157       G4cout <<"G4InclCascadeInterface: Target Z:  " << inclInput->targetZ() << G4endl;
     173      G4cout <<"G4InclCascadeInterface: Bullet type: " << calincl->bulletType() << G4endl;
     174      G4cout <<"G4Incl4AblaCascadeInterface: Bullet energy: " << calincl->bulletE() << " MeV" << G4endl;
     175
     176      G4cout <<"G4InclCascadeInterface: Target A:  " << calincl->targetA() << G4endl;
     177      G4cout <<"G4InclCascadeInterface: Target Z:  " << calincl->targetZ() << G4endl;
    158178
    159179      if(verboseLevel > 3) {
    160         diagdata <<"G4InclCascadeInterface: Bullet type: " << inclInput->bulletType() << G4endl;
    161         diagdata <<"G4InclCascadeInterface: Bullet energy: " << inclInput->bulletE() << " MeV" << G4endl;
     180        diagdata <<"G4InclCascadeInterface: Bullet type: " << calincl->bulletType() << G4endl;
     181        diagdata <<"G4InclCascadeInterface: Bullet energy: " << calincl->bulletE() << " MeV" << G4endl;
    162182       
    163         diagdata <<"G4InclCascadeInterface: Target A:  " << inclInput->targetA() << G4endl;
    164         diagdata <<"G4InclCascadeInterface: Target Z:  " << inclInput->targetZ() << G4endl;
    165       }
    166 
    167       // for(particleI = 0; particleI < varntp->ntrack; particleI++) {
    168       //   G4cout << n                       << " " << inclInput->f[6]             << " " << inclInput->f[2] << " ";
    169       //   G4cout << varntp->massini         << " " << varntp->mzini             << " ";
    170       //   G4cout << varntp->exini           << " " << varntp->mulncasc          << " " << varntp->mulnevap          << " " << varntp->mulntot << " ";
    171       //   G4cout << varntp->bimpact         << " " << varntp->jremn             << " " << varntp->kfis              << " " << varntp->estfis << " ";
    172       //   G4cout << varntp->izfis           << " " << varntp->iafis             << " " << varntp->ntrack            << " " << varntp->itypcasc[particleI] << " ";
    173       //   G4cout << varntp->avv[particleI]  << " " << varntp->zvv[particleI]    << " " << varntp->enerj[particleI]  << " ";
    174       //   G4cout << varntp->plab[particleI] << " " << varntp->tetlab[particleI] << " " << varntp->philab[particleI] << G4endl;
    175       //   // For diagnostic output
    176       //   if(verboseLevel > 3) {
    177       //     diagdata << n                       << " " << inclInput->f[6]             << " " << inclInput->f[2] << " ";
    178       //     diagdata << varntp->massini         << " " << varntp->mzini             << " ";
    179       //     diagdata << varntp->exini           << " " << varntp->mulncasc          << " " << varntp->mulnevap          << " " << varntp->mulntot << " ";
    180       //     diagdata << varntp->bimpact         << " " << varntp->jremn             << " " << varntp->kfis              << " " << varntp->estfis << " ";
    181       //     diagdata << varntp->izfis           << " " << varntp->iafis             << " " << varntp->ntrack            << " ";
    182       //          diagdata                                                                       << varntp->itypcasc[particleI] << " ";
    183       //     diagdata << varntp->avv[particleI]  << " " << varntp->zvv[particleI]    << " " << varntp->enerj[particleI]  << " ";
    184       //     diagdata << varntp->plab[particleI] << " " << varntp->tetlab[particleI] << " " << varntp->philab[particleI] << G4endl;
    185       //   }
    186       // }
     183        diagdata <<"G4InclCascadeInterface: Target A:  " << calincl->targetA() << G4endl;
     184        diagdata <<"G4InclCascadeInterface: Target Z:  " << calincl->targetZ() << G4endl;
     185      }
     186
    187187    }
    188188
     
    196196
    197197      theResult.SetStatusChange(stopAndKill);
    198       aParticleDefinition = G4InclInput::getParticleDefinition(inclInput->bulletType());
    199 
    200       cascadeParticle = new G4DynamicParticle();
    201       cascadeParticle->SetDefinition(aParticleDefinition);
    202       cascadeParticle->Set4Momentum(aTrack.Get4Momentum());
    203       theResult.AddSecondary(cascadeParticle);
     198     
     199      G4int bulletType = calincl->bulletType();
     200      aParticleDefinition = G4InclInput::getParticleDefinition(bulletType);
     201
     202      if(aParticleDefinition != 0) {
     203        cascadeParticle = new G4DynamicParticle();
     204        cascadeParticle->SetDefinition(aParticleDefinition);
     205        cascadeParticle->Set4Momentum(aTrack.Get4Momentum());
     206        theResult.AddSecondary(cascadeParticle);
     207      }
    204208    }
    205209
     
    209213
    210214#ifdef DEBUGINCL
    211     G4cout << "E [MeV]" << std::setw(12) << " Ekin [MeV]" << std::setw(12) << " E* [MeV]" << std::setw(12) << "Px [MeV]" << std::setw(12) << " Py [MeV]" << std::setw(12) << "Pz [MeV]" << std::setw(12) << "Pt [MeV]" << std::setw(12) << "A" << std::setw(12) << "Z" << G4endl; 
     215    G4cout << "E [MeV]" << std::setw(12)
     216           << " Ekin [MeV]" << std::setw(12)
     217           << "Px [MeV]" << std::setw(12)
     218           << " Py [MeV]" << std::setw(12)
     219           << "Pz [MeV]" << std::setw(12)
     220           << "Pt [MeV]" << std::setw(12)
     221           << "A" << std::setw(12)
     222           << "Z" << G4endl;
    212223#endif
    213224
     
    276287      if((varntp->avv[particleI] > 1) && (varntp->zvv[particleI] >= 1)) { // Nucleus fragment
    277288        G4ParticleDefinition * aIonDef = 0;
    278         G4ParticleTable *theTableOfParticles = G4ParticleTable::GetParticleTable();
    279289
    280290        G4int A = G4int(varntp->avv[particleI]);
     
    315325        G4double p = mom.mag();
    316326        labv -= fm;
    317         G4double px = mom.x() * MeV;
    318         G4double py = mom.y() * MeV;
    319         G4double pz = mom.z() * MeV;
     327        if(varntp->avv[particleI] > 1) {
     328          labvA += fm;
     329        }
     330        G4double px = mom.x() * MeV;
     331        G4double py = mom.y() * MeV;
     332        G4double pz = mom.z() * MeV;
    320333        G4double pt = std::sqrt(px*px+py*py);
    321334        G4double e  = fm.e();
     
    330343        G4cout << fm.e() / MeV
    331344               << std::setw(12) << cascadeParticle->GetKineticEnergy() / MeV
    332                << std::setw(12) << exE / MeV
    333345               << std::setw(12) << mom.x() / MeV
    334346               << std::setw(12) << mom.y() / MeV
     
    351363      }
    352364    }
     365
     366      G4double nuclearMass = G4NucleiProperties::GetNuclearMass(G4int(varntp->massini), G4int(varntp->mzini)) + varntp->exini * MeV;
     367      G4LorentzVector fragmentMomentum(varntp->pxrem * MeV, varntp->pyrem * MeV, varntp->pzrem * MeV,
     368                                       varntp->erecrem * MeV + nuclearMass);
     369      G4double momentumScaling = G4InclUtils::calculate4MomentumScaling(G4int(varntp->massini), G4int(varntp->mzini),
     370                                                                        varntp->exini,
     371                                                                        varntp->erecrem,
     372                                                                        varntp->pxrem,
     373                                                                        varntp->pyrem,
     374                                                                        varntp->pzrem);
     375      G4LorentzVector p4(momentumScaling * varntp->pxrem * MeV, momentumScaling * varntp->pyrem * MeV,
     376                         momentumScaling * varntp->pzrem * MeV,
     377                         varntp->erecrem + nuclearMass);
     378
     379      // For four-momentum, baryon number and charge conservation check:
     380      G4LorentzVector fourMomentumBalance = p4;
     381      G4int baryonNumberBalance = G4int(varntp->massini);
     382      G4int chargeBalance = G4int(varntp->mzini);
     383
     384      G4LorentzRotation toFragmentZ;
     385      toFragmentZ.rotateZ(-p4.theta());
     386      toFragmentZ.rotateY(-p4.phi());
     387      G4LorentzRotation toFragmentLab = toFragmentZ.inverse();
     388      p4 *= toFragmentZ;
     389
     390      G4LorentzVector p4rest = p4;
     391      p4rest.boost(-p4.boostVector());
     392      if(verboseLevel > 0) {
     393        G4cout <<"Cascade remnant nucleus:" << G4endl;
     394        G4cout <<"p4: " << G4endl;
     395        G4cout <<" px: " << p4.px() <<" py: " << p4.py() <<" pz: " << p4.pz() << G4endl;
     396        G4cout <<" E = " << p4.e() << G4endl;
     397
     398        G4cout <<"p4rest: " << G4endl;
     399        G4cout <<" px: " << p4rest.px() <<" py: " << p4rest.py() <<" pz: " << p4rest.pz() << G4endl;
     400        G4cout <<" E = " << p4rest.e() << G4endl;
     401      }
     402
     403      G4Fragment theCascadeRemnant(G4int(varntp->massini), G4int(varntp->mzini), p4rest);
     404      thePrecoResult = thePrecoModel->DeExcite(theCascadeRemnant);
     405      if(thePrecoResult != 0) {
     406      G4ReactionProductVector::iterator fragment;
     407      for(fragment = thePrecoResult->begin(); fragment != thePrecoResult->end(); fragment++) {
     408        G4ParticleDefinition *theFragmentDefinition = (*fragment)->GetDefinition();
     409
     410        if(theFragmentDefinition != 0) {
     411          G4DynamicParticle *theFragment = new G4DynamicParticle(theFragmentDefinition, (*fragment)->GetMomentum());
     412          G4LorentzVector labMomentum = theFragment->Get4Momentum();
     413          labMomentum.boost(p4.boostVector());
     414          labMomentum *= toFragmentLab;
     415          labMomentum *= toLabFrame;
     416          theFragment->Set4Momentum(labMomentum);
     417          fourMomentumBalance -= theFragment->Get4Momentum();
     418          baryonNumberBalance -= theFragmentDefinition->GetAtomicMass();
     419          chargeBalance -= theFragmentDefinition->GetAtomicNumber();
     420          if(verboseLevel > 0) {
     421            G4cout <<"Resulting fragment: " << G4endl;
     422            G4cout <<" kinetic energy = " << theFragment->GetKineticEnergy() / MeV << " MeV" << G4endl;
     423            G4cout <<" momentum = " << theFragment->GetMomentum().mag() / MeV << " MeV" << G4endl;
     424          }
     425          theResult.AddSecondary(theFragment);
     426        } else {
     427          G4cout <<"G4InclCascadeInterface: Error. Fragment produced by Fermi break-up does not exist." << G4endl;
     428          G4cout <<"Resulting fragment: " << G4endl;
     429          G4cout <<" momentum = " << (*fragment)->GetMomentum().mag() / MeV << " MeV" << G4endl;
     430        }
     431      }
     432      delete thePrecoResult;
     433      thePrecoResult = 0;
     434
     435      if(verboseLevel > 1 && std::abs(fourMomentumBalance.mag() / MeV) > 0.1 * MeV) {
     436        G4cout <<"Four-momentum balance after remnant nucleus Fermi break-up:" << G4endl;
     437        G4cout <<"Magnitude: " << fourMomentumBalance.mag() / MeV << " MeV" << G4endl;
     438        G4cout <<"Vector components (px, py, pz, E) = ("
     439               << fourMomentumBalance.px() << ", "
     440               << fourMomentumBalance.py() << ", "
     441               << fourMomentumBalance.pz() << ", "
     442               << fourMomentumBalance.e() << ")" << G4endl;
     443      }
     444      if(baryonNumberBalance != 0 && verboseLevel > 1) {
     445        G4cout <<"Baryon number balance after remnant nucleus Fermi break-up: " << baryonNumberBalance << G4endl;
     446      }
     447      if(chargeBalance != 0 && verboseLevel > 1) {
     448        G4cout <<"Charge balance after remnant nucleus Fermi break-up: " << chargeBalance << G4endl;
     449      }
     450      }
     451      //    } // if(needsFermiBreakUp)
     452
    353453#ifdef DEBUGINCL
    354454    G4cout <<"--------------------------------------------------------------------------------" << G4endl;
    355455    G4double pt = std::sqrt(std::pow(labv.x(), 2) + std::pow(labv.y(), 2));
    356     G4cout << labv.e() / MeV << std::setw(12) << eKinSum / MeV << std::setw(12) << labv.x() << std::setw(12) << labv.y() << std::setw(12) << labv.z() << std::setw(12) <<  pt / MeV << std::setw(12) << baryonNumber << std::setw(12) << chargeNumber << " totals" << G4endl;
     456    G4double ptA = std::sqrt(std::pow(labvA.x(), 2) + std::pow(labvA.y(), 2));
     457    G4cout << labv.e() / MeV << std::setw(12)
     458           << eKinSum  / MeV << std::setw(12)
     459           << labv.x() / MeV << std::setw(12)
     460           << labv.y() / MeV << std::setw(12)
     461           << labv.z() / MeV << std::setw(12)
     462           << pt       / MeV << std::setw(12)
     463           << baryonNumber << std::setw(12)
     464           << chargeNumber << " totals" << G4endl;
     465    G4cout << " - " << std::setw(12)
     466           << " - " << std::setw(12)
     467           << labvA.x() / MeV << std::setw(12)
     468           << labvA.y() / MeV << std::setw(12)
     469           << labvA.z() / MeV << std::setw(12)
     470           << ptA       / MeV << std::setw(12)
     471           << " - " << std::setw(12) << " - " << " totals ABLA" << G4endl;
    357472    G4cout << G4endl;
    358 
     473 
    359474    if(verboseLevel > 3) {
    360475      if(baryonNumber != 0) {
     
    369484    }
    370485#endif
    371     
     486   
    372487    varntp->ntrack = 0; // Clean up the number of generated particles in the event.
    373488  }
     
    379494    theResult.SetStatusChange(stopAndKill);
    380495
    381     G4ParticleTable *theTableOfParticles = G4ParticleTable::GetParticleTable();
    382496    cascadeParticle = new G4DynamicParticle(theTableOfParticles->FindParticle(aTrack.GetDefinition()), aTrack.Get4Momentum());
    383497
     
    388502    }
    389503    if(verboseLevel > 3) {
    390       diagdata <<"ERROR G4InclCascadeInterface: Processing event number (internal) failed " << eventNumber << G4endl;
    391     }
    392 
    393     if(inclInput->bulletType() == 0) {
     504      diagdata <<"ERROR G4InclCascadeInterface: Error processing event number (internal) failed " << eventNumber << G4endl;
     505    }
     506
     507    if(bulletType == 0) {
    394508      if(verboseLevel > 1) {
    395509        G4cout <<"G4InclCascadeInterface: Unknown bullet type" << G4endl;     
     
    402516    }
    403517
    404     if((inclInput->targetA() == 1) && (inclInput->targetZ() == 1)) { // Unsupported target
     518    if((calincl->targetA() == 1) && (calincl->targetZ() == 1)) { // Unsupported target
    405519      if(verboseLevel > 1) {
    406520        G4cout <<"Unsupported target: " << G4endl;
    407         G4cout <<"Target A: " << inclInput->targetA() << G4endl;
    408         G4cout <<"TargetZ: " << inclInput->targetZ() << G4endl;
     521        G4cout <<"Target A: " << calincl->targetA() << G4endl;
     522        G4cout <<"TargetZ: " << calincl->targetZ() << G4endl;
    409523      }
    410524      if(verboseLevel > 3) {
    411525        diagdata <<"Unsupported target: " << G4endl;
    412         diagdata <<"Target A: " << inclInput->targetA() << G4endl;
    413         diagdata <<"TargetZ: " << inclInput->targetZ() << G4endl;
    414       }
    415     }
    416 
    417     if(inclInput->bulletE() < 100) { // INCL does not support E < 100 MeV.
     526        diagdata <<"Target A: " << calincl->targetA() << G4endl;
     527        diagdata <<"TargetZ: " << calincl->targetZ() << G4endl;
     528      }
     529    }
     530
     531    if(calincl->bulletE() < 100) { // INCL does not support E < 100 MeV.
    418532      if(verboseLevel > 1) {
    419         G4cout <<"Unsupported bullet energy: " << inclInput->bulletE() << " MeV. (Lower limit is 100 MeV)." << G4endl;
     533        G4cout <<"Unsupported bullet energy: " << calincl->bulletE() << " MeV. (Lower limit is 100 MeV)." << G4endl;
    420534        G4cout <<"WARNING: Returning the original bullet with original energy back to Geant4." << G4endl;
    421535      }
    422536      if(verboseLevel > 3) {
    423         diagdata <<"Unsupported bullet energy: " << inclInput->bulletE() << " MeV. (Lower limit is 100 MeV)." << G4endl;
     537        diagdata <<"Unsupported bullet energy: " << calincl->bulletE() << " MeV. (Lower limit is 100 MeV)." << G4endl;
    424538      }
    425539    }
     
    430544  }
    431545
     546  delete calincl;
     547  calincl = 0;
    432548  return &theResult;
    433549}
  • trunk/source/processes/hadronic/models/incl/src/G4InclLightIonInterface.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4InclLightIonInterface.cc,v 1.12 2010/10/26 02:47:59 kaitanie Exp $
     26// $Id: G4InclLightIonInterface.cc,v 1.15 2010/11/17 20:19:09 kaitanie Exp $
    2727// Translation of INCL4.2/ABLA V3
    2828// Pekka Kaitaniemi, HIP (translation)
     
    3131// Aatos Heikkinen, HIP (project coordination)
    3232
     33#include <vector>
     34
    3335#include "G4InclLightIonInterface.hh"
     36#include "G4FermiBreakUp.hh"
    3437#include "math.h"
    3538#include "G4GenericIon.hh"
     
    3942{
    4043  hazard = new G4Hazard();
     44
    4145  const G4long* table_entry = CLHEP::HepRandom::getTheSeeds(); // Get random seed from CLHEP.
    4246  hazard->ial = (*table_entry);
     47
     48  theExcitationHandler = new G4ExcitationHandler;
     49  thePrecoModel = new G4PreCompoundModel(theExcitationHandler);
    4350
    4451  varntp = new G4VarNtp();
     
    4754  mat = new G4Mat();
    4855  incl = new G4Incl(hazard, calincl, ws, mat, varntp);
    49 
     56  useProjectileSpectator = true;
     57  useFermiBreakup = true;
     58  incl->setUseProjectileSpectators(useProjectileSpectator);
     59  if(!getenv("G4INCLABLANOFERMIBREAKUP")) { // Use Fermi Break-up by default if it is NOT explicitly disabled
     60    incl->setUseFermiBreakUp(true);
     61    useFermiBreakup = true;
     62  }
    5063  verboseLevel = 0;
     64  if(getenv("G4INCLVERBOSE")) {
     65    verboseLevel = 1;
     66  }
    5167}
    5268
    5369G4InclLightIonInterface::~G4InclLightIonInterface()
    5470{
     71  delete thePrecoModel;
     72  delete theExcitationHandler;
     73
    5574  delete hazard;
    5675  delete varntp;
     
    6382G4HadFinalState* G4InclLightIonInterface::ApplyYourself(const G4HadProjectile& aTrack, G4Nucleus& theNucleus)
    6483{
     84  //  const G4bool useFermiBreakup = false;
    6585  G4int maxTries = 200;
    6686
    67   G4int bulletType = 0;
    6887  G4int particleI;
    6988
    70   // Print diagnostic messages: 0 = silent, 1 and 2 = verbose
    71   verboseLevel = 0;
     89  G4int baryonNumberBalanceInINCL = 0;
     90  G4int chargeNumberBalanceInINCL = 0;
     91
     92  G4ParticleTable *theTableOfParticles = G4ParticleTable::GetParticleTable();
    7293
    7394  // Increase the event number:
    7495  eventNumber++;
    7596
     97  // Clean up the INCL input
     98  if(calincl != 0) {
     99    delete calincl;
     100    calincl = 0;
     101  }
     102
    76103  if (verboseLevel > 1) {
    77104    G4cout << " >>> G4InclLightIonInterface::ApplyYourself called" << G4endl;
     
    82109  }
    83110
    84   // INCL4 needs the energy in units MeV
    85   G4double bulletE = aTrack.GetKineticEnergy() / MeV;
    86 
    87   G4int targetA = theNucleus.GetA_asInt();
    88   G4int targetZ = theNucleus.GetZ_asInt();
     111  // Inverse kinematics for targets with Z = 1 and A = 1
     112  //  if(false) {
     113  G4LorentzRotation toBreit = aTrack.Get4Momentum().boostVector();
     114
     115  if(theNucleus.GetZ_asInt() == 1 && theNucleus.GetA_asInt() == 1 && G4InclInput::canUseInverseKinematics(aTrack, theNucleus)) {
     116    G4ParticleDefinition *oldTargetDef = theTableOfParticles->GetIon(theNucleus.GetA_asInt(), theNucleus.GetZ_asInt(), 0.0);
     117    const G4ParticleDefinition *oldProjectileDef = aTrack.GetDefinition();
     118
     119    if(oldTargetDef != 0 && oldProjectileDef != 0) {
     120    G4int oldTargetA = oldTargetDef->GetAtomicMass();
     121    G4int newTargetA = oldProjectileDef->GetAtomicMass();
     122    G4int newTargetZ = oldProjectileDef->GetAtomicNumber();
     123
     124    if(newTargetA > 0 && newTargetZ > 0) {
     125      G4Nucleus swappedTarget(oldProjectileDef->GetAtomicMass(), oldProjectileDef->GetAtomicNumber());
     126
     127      //      G4cout <<"Original projectile kinE = " << aTrack.GetKineticEnergy() / MeV << G4endl;
     128
     129      // We need the same energy/nucleon.
     130      G4double projectileE = ((aTrack.GetKineticEnergy() / MeV) / newTargetA) * oldTargetA * MeV;
     131
     132      //    G4cout <<"projectileE = " << projectileE << G4endl;
     133      G4DynamicParticle swappedProjectileParticle(oldTargetDef, G4ThreeVector(0.0, 0.0, 1.0), projectileE);
     134      const G4LorentzVector swapped4Momentum = (swappedProjectileParticle.Get4Momentum()*=toBreit);
     135      swappedProjectileParticle.Set4Momentum(swapped4Momentum);
     136      const G4HadProjectile swappedProjectile(swappedProjectileParticle);
     137      //  G4cout <<"New projectile kinE = " << swappedProjectile.GetKineticEnergy() / MeV << G4endl;
     138      calincl = new G4InclInput(swappedProjectile, swappedTarget, true);
     139    } else {
     140      G4cout <<"Badly defined target after swapping. Falling back to normal (non-swapped) mode." << G4endl;
     141      calincl = new G4InclInput(aTrack, theNucleus, false);
     142    }
     143    }
     144  } else {
     145    calincl = new G4InclInput(aTrack, theNucleus, false);
     146  }
    89147
    90148  G4double eKin;
     
    103161  G4LorentzRotation toLabFrame = toZ.inverse();
    104162
     163  /*
     164  G4cout <<"Projectile theta = " << projectileMomentum.theta() << " phi = " << projectileMomentum.phi() << G4endl;
     165  G4cout <<"Projectile momentum "
     166         << "(px = " << projectileMomentum.px()
     167         << ", py = " << projectileMomentum.py()
     168         << ", pz = " << projectileMomentum.pz() << ")" << G4endl;
     169  G4cout << "Projectile energy = " << bulletE << " MeV" << G4endl;
     170  */
     171
     172  G4ReactionProductVector *thePrecoResult = 0;
     173  G4ReactionProductVector *theSpectatorPrecoResult = 0;
     174
    105175  theResult.Clear(); // Make sure the output data structure is clean.
     176
     177  std::vector<G4DynamicParticle*> result; // Temporary list for the results
    106178
    107179  // Map Geant4 particle types to corresponding INCL4 types.
    108180  enum bulletParticleType {nucleus = 0, proton = 1, neutron = 2, pionPlus = 3, pionZero = 4,
    109                            pionMinus = 5, deuteron = 6, triton = 7, he3 = 8, he4 = 9};
    110 
    111   // Coding particles for use with INCL4 and ABLA
    112   if (aTrack.GetDefinition() == G4Deuteron::Deuteron()   ) bulletType = deuteron;
    113   if (aTrack.GetDefinition() == G4Triton::Triton()       ) bulletType = triton;
    114   if (aTrack.GetDefinition() == G4He3::He3()             ) bulletType = he3;
    115   if (aTrack.GetDefinition() == G4Alpha::Alpha()         ) bulletType = he4;
    116 
    117   calincl = new G4InclInput();
     181                           pionMinus = 5, deuteron = 6, triton = 7, he3 = 8, he4 = 9,
     182                           c12 = -12}; // Carbon beam support.
     183
     184  G4int bulletType = calincl->bulletType();
     185  chargeNumberBalanceInINCL = calincl->targetZ();
     186  baryonNumberBalanceInINCL = calincl->targetA();
     187
     188  //  G4cout <<"Type of the projectile (INCL projectile code): " << bulletType << G4endl;
     189
     190  if(bulletType == proton) {
     191    chargeNumberBalanceInINCL += 1;
     192    baryonNumberBalanceInINCL += 1;
     193  } else if(bulletType == neutron) {
     194    baryonNumberBalanceInINCL += 1;
     195  } else if(bulletType == pionPlus) { //Note: positive pion doesn't contribute to the baryon and charge number counters
     196    chargeNumberBalanceInINCL += 1;
     197  } else if(bulletType == pionMinus) {
     198    chargeNumberBalanceInINCL -= 1;
     199  } else if(bulletType == deuteron) {
     200    chargeNumberBalanceInINCL += 1;
     201    baryonNumberBalanceInINCL += 2;
     202  } else if(bulletType == triton) {
     203    chargeNumberBalanceInINCL += 1;
     204    baryonNumberBalanceInINCL += 3;
     205  } else if(bulletType == he3) {
     206    chargeNumberBalanceInINCL += 2;
     207    baryonNumberBalanceInINCL += 3;
     208  } else if(bulletType == he4) {
     209    chargeNumberBalanceInINCL += 2;
     210    baryonNumberBalanceInINCL += 4;
     211  } if(bulletType == c12) {
     212    chargeNumberBalanceInINCL += 6;
     213    baryonNumberBalanceInINCL += 12;
     214  } if(bulletType == -666) {
     215    chargeNumberBalanceInINCL += calincl->extendedProjectileZ();
     216    baryonNumberBalanceInINCL += calincl->extendedProjectileA();
     217  }
    118218
    119219  // Check wheter the input is acceptable.
    120   if((bulletType != 0) && ((targetA != 1) && (targetZ != 1))) {
     220  if((bulletType != 0) && ((calincl->targetA() != 1) && (calincl->targetZ() != 1))) {
    121221    ws->nosurf = -2;  // Nucleus surface, -2 = Woods-Saxon
    122222    ws->xfoisa = 8;
     
    128228    mat->nbmat = 1;
    129229    mat->amat[0] = int(calincl->targetA());
    130     mat->zmat[0] = int(calincl->targetZ());
    131 
     230    mat->zmat[0] = int(calincl->targetA());
     231
     232    incl->setInput(calincl);
    132233    incl->initIncl(true);
    133234
     
    148249       * Diagnostic output
    149250       */
    150       G4cout <<"G4InclLightIonInterface: Bullet type: " << bulletType << G4endl;
    151       G4cout <<"G4Incl4AblaCascadeInterface: Bullet energy: " << bulletE << " MeV" << G4endl;
    152 
    153       G4cout <<"G4InclLightIonInterface: Target A:  " << targetA << G4endl;
    154       G4cout <<"G4InclLightIonInterface: Target Z:  " << targetZ << G4endl;
     251      G4cout <<"G4InclLightIonInterface: Bullet type: " << calincl->bulletType() << G4endl;
     252      G4cout <<"G4Incl4AblaCascadeInterface: Bullet energy: " << calincl->bulletE() << " MeV" << G4endl;
     253      if(bulletType == -666) {
     254        G4cout <<"   Extended projectile: A = " << calincl->extendedProjectileA()
     255               <<" Z = " << calincl->extendedProjectileZ() << G4endl;
     256      }
     257
     258      G4cout <<"G4InclLightIonInterface: Target A:  " << calincl->targetA() << G4endl;
     259      G4cout <<"G4InclLightIonInterface: Target Z:  " << calincl->targetZ() << G4endl;
    155260
    156261      if(verboseLevel > 3) {
    157         diagdata <<"G4InclLightIonInterface: Bullet type: " << bulletType << G4endl;
    158         diagdata <<"G4InclLightIonInterface: Bullet energy: " << bulletE << " MeV" << G4endl;
     262        diagdata <<"G4InclLightIonInterface: Bullet type: " << calincl->bulletType() << G4endl;
     263        diagdata <<"G4InclLightIonInterface: Bullet energy: " << calincl->bulletE() << " MeV" << G4endl;
    159264       
    160         diagdata <<"G4InclLightIonInterface: Target A:  " << targetA << G4endl;
    161         diagdata <<"G4InclLightIonInterface: Target Z:  " << targetZ << G4endl;
     265        diagdata <<"G4InclLightIonInterface: Target A:  " << calincl->targetA() << G4endl;
     266        diagdata <<"G4InclLightIonInterface: Target Z:  " << calincl->targetZ() << G4endl;
    162267      }
    163268    }
     
    175280      if(bulletType == proton) {
    176281        aParticleDefinition = G4Proton::ProtonDefinition();
    177       }
    178       if(bulletType == neutron) {
     282      } else if(bulletType == neutron) {
    179283        aParticleDefinition = G4Neutron::NeutronDefinition();
    180       }
    181       if(bulletType == pionPlus) {
     284      } else if(bulletType == pionPlus) {
    182285        aParticleDefinition = G4PionPlus::PionPlusDefinition();
    183       }
    184       if(bulletType == pionZero) {
     286      } else if(bulletType == pionZero) {
    185287        aParticleDefinition = G4PionZero::PionZeroDefinition();
    186       }
    187       if(bulletType == pionMinus) {
     288      } else if(bulletType == pionMinus) {
    188289        aParticleDefinition = G4PionMinus::PionMinusDefinition();
    189       }
    190 
    191       cascadeParticle = new G4DynamicParticle();
    192       cascadeParticle->SetDefinition(aParticleDefinition);
    193       cascadeParticle->Set4Momentum(aTrack.Get4Momentum());
    194       theResult.AddSecondary(cascadeParticle);
     290      } else if(bulletType == deuteron) {
     291        aParticleDefinition = G4Deuteron::DeuteronDefinition();
     292      } else if(bulletType == triton) {
     293        aParticleDefinition = G4Triton::TritonDefinition();
     294      } else if(bulletType == he3) {
     295        aParticleDefinition = G4He3::He3Definition();
     296      } else if(bulletType == he4) {
     297        aParticleDefinition = G4Alpha::AlphaDefinition();
     298      } else { // Particle was not recognized. Probably an unsupported particle was given as input
     299        aParticleDefinition = 0;
     300      }
     301
     302      if(aParticleDefinition != 0) {
     303        cascadeParticle = new G4DynamicParticle();
     304        cascadeParticle->SetDefinition(aParticleDefinition);
     305        cascadeParticle->Set4Momentum(aTrack.Get4Momentum());
     306        result.push_back(cascadeParticle);
     307      }
    195308    }
    196309
     
    199312    theResult.SetStatusChange(stopAndKill);
    200313   
    201     for(particleI = 0; particleI < varntp->ntrack; particleI++) { // Loop through the INCL4+ABLA output.
     314    for(particleI = 0; particleI <= varntp->ntrack; particleI++) { // Loop through the INCL4+ABLA output.
    202315      // Get energy/momentum and construct momentum vector in INCL4 coordinates.
     316      //      if(varntp->itypcasc[particleI] == -1) continue; // Avoid nucleons that are part of the spectator
     317      if(varntp->avv[particleI] == 0 && varntp->zvv[particleI] == 0) continue;
    203318      momx = varntp->plab[particleI]*std::sin(varntp->tetlab[particleI]*CLHEP::pi/180.0)*std::cos(varntp->philab[particleI]*CLHEP::pi/180.0)*MeV;
    204319      momy = varntp->plab[particleI]*std::sin(varntp->tetlab[particleI]*CLHEP::pi/180.0)*std::sin(varntp->philab[particleI]*CLHEP::pi/180.0)*MeV;
     
    222337          new G4DynamicParticle(G4Proton::ProtonDefinition(), momDirection, eKin);
    223338        particleIdentified++;
     339        baryonNumberBalanceInINCL -= 1;
     340        chargeNumberBalanceInINCL -= 1;
    224341      }
    225342
     
    228345          new G4DynamicParticle(G4Neutron::NeutronDefinition(), momDirection, eKin);
    229346        particleIdentified++;
     347        baryonNumberBalanceInINCL -= 1;
    230348      }
    231349
     
    234352          new G4DynamicParticle(G4PionPlus::PionPlusDefinition(), momDirection, eKin);
    235353        particleIdentified++;
     354        chargeNumberBalanceInINCL -= 1;
    236355      }
    237356
     
    240359          new G4DynamicParticle(G4PionZero::PionZeroDefinition(), momDirection, eKin);
    241360        particleIdentified++;
     361        chargeNumberBalanceInINCL -= 0;
    242362      }
    243363
     
    246366          new G4DynamicParticle(G4PionMinus::PionMinusDefinition(), momDirection, eKin);
    247367        particleIdentified++;
     368        chargeNumberBalanceInINCL -= -1;
    248369      }
    249370
    250371      if((varntp->avv[particleI] > 1) && (varntp->zvv[particleI] >= 1)) { // Nucleus fragment
    251         G4ParticleDefinition * aIonDef = 0;
    252         G4ParticleTable *theTableOfParticles = G4ParticleTable::GetParticleTable();
     372        G4ParticleDefinition * aIonDef = 0;
    253373
    254374        G4int A = G4int(varntp->avv[particleI]);
     
    273393            new G4DynamicParticle(aIonDef, momDirection, eKin);
    274394          particleIdentified++;
     395          baryonNumberBalanceInINCL -= A;
     396          chargeNumberBalanceInINCL -= Z;
    275397        }
    276398      }
    277399       
    278400      if(particleIdentified == 1) { // Particle identified properly.
    279         cascadeParticle->Set4Momentum(cascadeParticle->Get4Momentum()*=toLabFrame);
    280         theResult.AddSecondary(cascadeParticle); // Put data into G4HadFinalState.
     401        cascadeParticle->Set4Momentum(cascadeParticle->Get4Momentum()*=toLabFrame);
     402        result.push_back(cascadeParticle);
    281403      }
    282404      else { // Particle identification failed.
     
    292414    }
    293415
     416    // Spectator nucleus Fermi break-up
     417    if(useFermiBreakup && useProjectileSpectator && varntp->masp > 1) {
     418      baryonNumberBalanceInINCL -= G4int(varntp->masp);
     419      G4double nuclearMass = G4NucleiProperties::GetNuclearMass(G4int(varntp->masp), G4int(varntp->mzsp)) + varntp->exsp * MeV;
     420      // Use momentum scaling to compensate for different masses in G4 and INCL:
     421      G4double momentumScaling = G4InclUtils::calculate4MomentumScaling(G4int(varntp->masp),
     422                                                                        G4int(varntp->mzsp),
     423                                                                        varntp->exsp,
     424                                                                        varntp->spectatorT,
     425                                                                        varntp->spectatorP1,
     426                                                                        varntp->spectatorP2,
     427                                                                        varntp->spectatorP3);
     428      G4LorentzVector p4(momentumScaling * varntp->spectatorP1 * MeV, momentumScaling * varntp->spectatorP2 * MeV,
     429                         momentumScaling * varntp->spectatorP3 * MeV,
     430                         varntp->spectatorT * MeV + nuclearMass);
     431      // Four-momentum, baryon number and charge balance:
     432      G4LorentzVector fourMomentumBalance = p4;
     433      G4int baryonNumberBalance = G4int(varntp->masp);
     434      chargeNumberBalanceInINCL -= G4int(varntp->mzsp);
     435      G4int chargeBalance = G4int(varntp->mzsp);
     436
     437      G4LorentzRotation toFragmentZ;
     438      // Assume that Fermi breakup uses Z as the direction of the projectile
     439      toFragmentZ.rotateZ(-p4.theta());
     440      toFragmentZ.rotateY(-p4.phi());
     441      G4LorentzRotation toFragmentLab = toFragmentZ.inverse();
     442      p4 *= toFragmentZ;
     443     
     444      G4LorentzVector p4rest = p4;
     445      p4rest.boost(-p4.boostVector());
     446      if(verboseLevel > 0) {
     447        G4cout <<"Spectator nucleus:" << G4endl;
     448        G4cout <<"p4: " << G4endl;
     449        G4cout <<" px: " << p4.px() <<" py: " << p4.py() <<" pz: " << p4.pz() << G4endl;
     450        G4cout <<" E = " << p4.e() << G4endl;
     451        G4cout <<"p4rest: " << G4endl;
     452        G4cout <<" px: " << p4rest.px() <<" py: " << p4rest.py() <<" pz: " << p4rest.pz() << G4endl;
     453        G4cout <<" E = " << p4rest.e() << G4endl;
     454      }
     455      G4Fragment theSpectatorNucleus(G4int(varntp->masp), G4int(varntp->mzsp), p4rest);
     456      theSpectatorPrecoResult = thePrecoModel->DeExcite(theSpectatorNucleus);
     457      if(theSpectatorPrecoResult != 0) {
     458      G4ReactionProductVector::iterator fragment;
     459      for(fragment = theSpectatorPrecoResult->begin(); fragment != theSpectatorPrecoResult->end(); fragment++) {
     460        G4ParticleDefinition *theFragmentDefinition = (*fragment)->GetDefinition();
     461
     462        if(theFragmentDefinition != 0) {
     463          G4DynamicParticle *theFragment = new G4DynamicParticle(theFragmentDefinition, (*fragment)->GetMomentum());
     464          G4LorentzVector labMomentum = theFragment->Get4Momentum();
     465          labMomentum.boost(p4.boostVector());
     466          labMomentum *= toFragmentLab;
     467          labMomentum *= toLabFrame;
     468          theFragment->Set4Momentum(labMomentum);
     469          fourMomentumBalance -= theFragment->Get4Momentum();
     470          baryonNumberBalance -= theFragmentDefinition->GetAtomicMass();
     471          chargeBalance -= theFragmentDefinition->GetAtomicNumber();
     472          if(verboseLevel > 0) {
     473            G4cout <<"Resulting fragment: " << G4endl;
     474            G4cout <<" kinetic energy = " << theFragment->GetKineticEnergy() / MeV << " MeV" << G4endl;
     475            G4cout <<" momentum = " << theFragment->GetMomentum().mag() / MeV << " MeV" << G4endl;
     476          }
     477          theResult.AddSecondary(theFragment);
     478        } else {
     479          G4cout <<"G4InclCascadeInterface: Error. Fragment produced by Fermi break-up does not exist." << G4endl;
     480          G4cout <<"Resulting fragment: " << G4endl;
     481          G4cout <<" momentum = " << (*fragment)->GetMomentum().mag() / MeV << " MeV" << G4endl;
     482        }
     483      }
     484      delete theSpectatorPrecoResult;
     485      theSpectatorPrecoResult = 0;
     486
     487      if(verboseLevel > 1 && std::abs(fourMomentumBalance.mag() / MeV) > 0.1 * MeV) {
     488        G4cout <<"Four-momentum balance after remnant nucleus Fermi break-up:" << G4endl;
     489        G4cout <<"Magnitude: " << fourMomentumBalance.mag() / MeV << " MeV" << G4endl;
     490        G4cout <<"Vector components (px, py, pz, E) = ("
     491               << fourMomentumBalance.px() << ", "
     492               << fourMomentumBalance.py() << ", "
     493               << fourMomentumBalance.pz() << ", "
     494               << fourMomentumBalance.e() << ")" << G4endl;
     495      }
     496      if(baryonNumberBalance != 0 && verboseLevel > 1) {
     497        G4cout <<"Baryon number balance after remnant nucleus Fermi break-up: " << baryonNumberBalance << G4endl;
     498      }
     499      if(chargeBalance != 0 && verboseLevel > 1) {
     500        G4cout <<"Charge balance after remnant nucleus Fermi break-up: " << chargeBalance << G4endl;
     501      }
     502      }
     503    }
     504
     505    // Finally do Fermi break-up if needed
     506    if(varntp->massini > 0) {
     507      baryonNumberBalanceInINCL -= G4int(varntp->massini);
     508      chargeNumberBalanceInINCL -= G4int(varntp->mzini);
     509      // Call Fermi Break-up
     510      G4double nuclearMass = G4NucleiProperties::GetNuclearMass(G4int(varntp->massini), G4int(varntp->mzini)) + varntp->exini * MeV;
     511      G4LorentzVector fragmentMomentum(varntp->pxrem * MeV, varntp->pyrem * MeV, varntp->pzrem * MeV,
     512                                       varntp->erecrem * MeV + nuclearMass);
     513      G4double momentumScaling = G4InclUtils::calculate4MomentumScaling(G4int(varntp->massini), G4int(varntp->mzini),
     514                                                                        varntp->exini,
     515                                                                        varntp->erecrem,
     516                                                                        varntp->pxrem,
     517                                                                        varntp->pyrem,
     518                                                                        varntp->pzrem);
     519      G4LorentzVector p4(momentumScaling * varntp->pxrem * MeV, momentumScaling * varntp->pyrem * MeV,
     520                         momentumScaling * varntp->pzrem * MeV,
     521                         varntp->erecrem + nuclearMass);
     522
     523      // For four-momentum, baryon number and charge conservation check:
     524      G4LorentzVector fourMomentumBalance = p4;
     525      G4int baryonNumberBalance = G4int(varntp->massini);
     526      G4int chargeBalance = G4int(varntp->mzini);
     527
     528      G4LorentzRotation toFragmentZ;
     529      toFragmentZ.rotateZ(-p4.theta());
     530      toFragmentZ.rotateY(-p4.phi());
     531      G4LorentzRotation toFragmentLab = toFragmentZ.inverse();
     532      p4 *= toFragmentZ;
     533
     534      G4LorentzVector p4rest = p4;
     535      p4rest.boost(-p4.boostVector());
     536      if(verboseLevel > 0) {
     537        G4cout <<"Cascade remnant nucleus:" << G4endl;
     538        G4cout <<"p4: " << G4endl;
     539        G4cout <<" px: " << p4.px() <<" py: " << p4.py() <<" pz: " << p4.pz() << G4endl;
     540        G4cout <<" E = " << p4.e() << G4endl;
     541
     542        G4cout <<"p4rest: " << G4endl;
     543        G4cout <<" px: " << p4rest.px() <<" py: " << p4rest.py() <<" pz: " << p4rest.pz() << G4endl;
     544        G4cout <<" E = " << p4rest.e() << G4endl;
     545      }
     546
     547      G4Fragment theCascadeRemnant(G4int(varntp->massini), G4int(varntp->mzini), p4rest);
     548      thePrecoResult = thePrecoModel->DeExcite(theCascadeRemnant);
     549      if(thePrecoResult != 0) {
     550      G4ReactionProductVector::iterator fragment;
     551      for(fragment = thePrecoResult->begin(); fragment != thePrecoResult->end(); fragment++) {
     552        G4ParticleDefinition *theFragmentDefinition = (*fragment)->GetDefinition();
     553
     554        if(theFragmentDefinition != 0) {
     555          G4DynamicParticle *theFragment = new G4DynamicParticle(theFragmentDefinition, (*fragment)->GetMomentum());
     556          G4LorentzVector labMomentum = theFragment->Get4Momentum();
     557          labMomentum.boost(p4.boostVector());
     558          labMomentum *= toFragmentLab;
     559          labMomentum *= toLabFrame;
     560          theFragment->Set4Momentum(labMomentum);
     561          fourMomentumBalance -= theFragment->Get4Momentum();
     562          baryonNumberBalance -= theFragmentDefinition->GetAtomicMass();
     563          chargeBalance -= theFragmentDefinition->GetAtomicNumber();
     564          if(verboseLevel > 0) {
     565            G4cout <<"Resulting fragment: " << G4endl;
     566            G4cout <<" kinetic energy = " << theFragment->GetKineticEnergy() / MeV << " MeV" << G4endl;
     567            G4cout <<" momentum = " << theFragment->GetMomentum().mag() / MeV << " MeV" << G4endl;
     568          }
     569          theResult.AddSecondary(theFragment);
     570        } else {
     571          G4cout <<"G4InclCascadeInterface: Error. Fragment produced by Fermi break-up does not exist." << G4endl;
     572          G4cout <<"Resulting fragment: " << G4endl;
     573          G4cout <<" momentum = " << (*fragment)->GetMomentum().mag() / MeV << " MeV" << G4endl;
     574        }
     575      }
     576      delete thePrecoResult;
     577      thePrecoResult = 0;
     578
     579      if(verboseLevel > 1 && std::abs(fourMomentumBalance.mag() / MeV) > 0.1 * MeV) {
     580        G4cout <<"Four-momentum balance after remnant nucleus Fermi break-up:" << G4endl;
     581        G4cout <<"Magnitude: " << fourMomentumBalance.mag() / MeV << " MeV" << G4endl;
     582        G4cout <<"Vector components (px, py, pz, E) = ("
     583               << fourMomentumBalance.px() << ", "
     584               << fourMomentumBalance.py() << ", "
     585               << fourMomentumBalance.pz() << ", "
     586               << fourMomentumBalance.e() << ")" << G4endl;
     587      }
     588      if(baryonNumberBalance != 0 && verboseLevel > 1) {
     589        G4cout <<"Baryon number balance after remnant nucleus Fermi break-up: " << baryonNumberBalance << G4endl;
     590      }
     591      if(chargeBalance != 0 && verboseLevel > 1) {
     592        G4cout <<"Charge balance after remnant nucleus Fermi break-up: " << chargeBalance << G4endl;
     593      }
     594      }
     595    }
     596
    294597    varntp->ntrack = 0; // Clean up the number of generated particles in the event.
     598
     599    if(baryonNumberBalanceInINCL != 0 && verboseLevel > 1) {
     600      G4cout <<"Event " << eventNumber <<": G4InclLightIonInterface: Baryon number conservation problem in INCL detected!" << G4endl;
     601      G4cout <<"Baryon number balance: " << baryonNumberBalanceInINCL << G4endl;
     602      if(baryonNumberBalanceInINCL < 0) {
     603        G4cout <<"Event " << eventNumber <<": Too many outcoming baryons!" << G4endl;
     604      } else if(baryonNumberBalanceInINCL > 0) {
     605        G4cout <<"Event " << eventNumber <<": Too few outcoming baryons!" << G4endl;
     606      }
     607    }
     608
     609    if(chargeNumberBalanceInINCL != 0 && verboseLevel > 1) {
     610      G4cout <<"Event " << eventNumber <<": G4InclLightIonInterface: Charge number conservation problem in INCL detected!" << G4endl;
     611      G4cout <<"Event " << eventNumber <<": Charge number balance: " << chargeNumberBalanceInINCL << G4endl;
     612    }
    295613  }
    296614  /**
     
    304622    cascadeParticle = new G4DynamicParticle(theTableOfParticles->FindParticle(aTrack.GetDefinition()), aTrack.Get4Momentum());
    305623
    306     theResult.AddSecondary(cascadeParticle);
     624    result.push_back(cascadeParticle);
    307625
    308626    if(verboseLevel > 1) {
     
    317635        G4cout <<"G4InclLightIonInterface: Unknown bullet type" << G4endl;     
    318636        G4cout <<"Bullet particle name: " << cascadeParticle->GetDefinition()->GetParticleName() << G4endl;
    319       }     
     637      }
    320638      if(verboseLevel > 3) {
    321639        diagdata <<"G4InclLightIonInterface: Unknown bullet type" << G4endl;     
     
    324642    }
    325643
    326     if((targetA == 1) && (targetZ == 1)) { // Unsupported target
     644    if((calincl->targetA() == 1) && (calincl->targetZ() == 1)) { // Unsupported target
    327645      if(verboseLevel > 1) {
    328646        G4cout <<"Unsupported target: " << G4endl;
    329         G4cout <<"Target A: " << targetA << G4endl;
    330         G4cout <<"TargetZ: " << targetZ << G4endl;
     647        G4cout <<"Target A: " << calincl->targetA() << G4endl;
     648        G4cout <<"TargetZ: " << calincl->targetZ() << G4endl;
    331649      }
    332650      if(verboseLevel > 3) {
    333651        diagdata <<"Unsupported target: " << G4endl;
    334         diagdata <<"Target A: " << targetA << G4endl;
    335        diagdata <<"TargetZ: " << targetZ << G4endl;
    336       }
    337     }
    338 
    339     if(bulletE < 100) { // INCL does not support E < 100 MeV.
     652        diagdata <<"Target A: " << calincl->targetA() << G4endl;
     653        diagdata <<"TargetZ: " << calincl->targetZ() << G4endl;
     654      }
     655    }
     656
     657    if(calincl->bulletE() < 100) { // INCL does not support E < 100 MeV.
    340658      if(verboseLevel > 1) {
    341         G4cout <<"Unsupported bullet energy: " << bulletE << " MeV. (Lower limit is 100 MeV)." << G4endl;
     659        G4cout <<"Unsupported bullet energy: " << calincl->bulletE() << " MeV. (Lower limit is 100 MeV)." << G4endl;
    342660        G4cout <<"WARNING: Returning the original bullet with original energy back to Geant4." << G4endl;
    343661      }
    344662      if(verboseLevel > 3) {
    345         diagdata <<"Unsupported bullet energy: " << bulletE << " MeV. (Lower limit is 100 MeV)." << G4endl;
    346       }
    347     }
     663        diagdata <<"Unsupported bullet energy: " << calincl->bulletE() << " MeV. (Lower limit is 100 MeV)." << G4endl;
     664      }
     665    }
     666
    348667    if(verboseLevel > 3) {
    349668      diagdata <<"WARNING: returning the original bullet with original energy back to Geant4." << G4endl;
     
    351670  }
    352671
     672  // Finally copy the accumulated secondaries into the result collection:
     673  G4ThreeVector boostVector = aTrack.Get4Momentum().boostVector();
     674  G4LorentzRotation boostBack = toBreit.inverse();
     675
     676  for(std::vector<G4DynamicParticle*>::iterator i = result.begin(); i != result.end(); ++i) {
     677    // If the calculation was performed in inverse kinematics we have to
     678    // convert the result back...
     679    if(calincl->isInverseKinematics()) {
     680      G4LorentzVector mom = (*i)->Get4Momentum();
     681      mom.setPz(-1.0 * mom.pz()); // Reverse the z-component of the momentum vector
     682      mom *= boostBack;
     683      (*i)->Set4Momentum(mom);
     684    }
     685    theResult.AddSecondary((*i));
     686  }
     687
     688  delete calincl;
     689  calincl = 0;
    353690  return &theResult;
    354691}
  • trunk/source/processes/hadronic/models/management/History

    r1340 r1347  
    1414     * Please list in reverse chronological order (last date on top)
    1515     ---------------------------------------------------------------
     16
     173 November 2010  - G.Folger   (hadr-modman-V09-03-05)
     18- G4VNuclearDensity: coverity warning: init data member in ctor
    1619
    17208 September 2010 - G.Folger   (hadr-modman-V09-03-04)
  • trunk/source/processes/hadronic/models/neutron_hp/History

    r1340 r1347  
    1515     ---------------------------------------------------------------
    1616
     173 December 2010  Tatsumi Koi (hadr-hpn-V09-03-12)
     18-Bug fix Bugzilla/Geant4 Problem 1155
     19        G4NeutronHPCaptureFS.cc
     20
     212 December 2010  Tatsumi Koi (hadr-hpn-V09-03-11)
     22-Delete Unnecessary warnings
     23        G4NeutronHPInelasticBaseFS.cc
     24
     2511 November 2010  Tatsumi Koi (hadr-hpn-V09-03-10)
     26-Change warning message for "repFlag == 2 && isoFlag != 1" case
     27        G4NeutronHPPhotonDist.cc
     28
     2911 November 2010  Tatsumi Koi (hadr-hpn-V09-03-09)
     30-Add Special treatment in Be9(n,2n)Be8(2a) case
     31        G4NeutronHPInelasticBaseFS.cc
     32-Add Safty for _nat_ data
     33        G4NeutronHPInelasticCompFS.cc
     34
     3510 November 2010  Tatsumi Koi (hadr-hpn-V09-03-08)
     36-Set lower limit for gamma energy
     37        G4NeutronHPFinalState.cc
     38
     3910 November 2010  Tatsumi Koi (hadr-hpn-V09-03-07)
     40-Bug fix in MF=6, LAW=2 case; contribution from E. Mendoza, D. Cano-Ott (CIEMAT)
     41        G4NeutronHPDiscreteTwoBody.cc
    1742
    18439 September 2010  Tatsumi Koi (hadr-hpn-V09-03-06)
  • trunk/source/processes/hadronic/models/neutron_hp/src/G4NeutronHPCaptureFS.cc

    r962 r1347  
    3131// 26-January-07 Add G4NEUTRONHP_USE_ONLY_PHOTONEVAPORATION flag
    3232// 081024 G4NucleiPropertiesTable:: to G4NucleiProperties::
     33// 101203 Bugzilla/Geant4 Problem 1155 Lack of residual in some case
    3334//
    3435#include "G4NeutronHPCaptureFS.hh"
     
    4344  G4HadFinalState * G4NeutronHPCaptureFS::ApplyYourself(const G4HadProjectile & theTrack)
    4445  {
     46
    4547    G4int i;
    4648    theResult.Clear();
     
    108110    }
    109111
     112
     113
    110114// add them to the final state
    111115
     
    114118    G4int nParticles = nPhotons;
    115119    if(1==nPhotons) nParticles = 2;
     120
     121
     122//Make at least one photon 
     123//101203 TK
     124    if ( nPhotons == 0 )
     125    {
     126       G4ReactionProduct * theOne = new G4ReactionProduct;
     127       theOne->SetDefinition( G4Gamma::Gamma() );
     128       G4double theta = pi*G4UniformRand();
     129       G4double phi = twopi*G4UniformRand();
     130       G4double sinth = std::sin(theta);
     131       G4ThreeVector direction( sinth*std::cos(phi), sinth*std::sin(phi), std::cos(theta) );
     132       theOne->SetMomentum( direction ) ;
     133       thePhotons->push_back(theOne);
     134       nPhotons++; // 0 -> 1
     135    }
     136//One photon case: energy set to Q-value
     137//101203 TK
     138    if ( nPhotons == 1 )
     139    {
     140       G4ThreeVector direction = thePhotons->operator[](0)->GetMomentum().unit();
     141       G4double Q = G4ParticleTable::GetParticleTable()->FindIon(static_cast<G4int>(theBaseZ), static_cast<G4int>(theBaseA), 0, static_cast<G4int>(theBaseZ))->GetPDGMass() + G4Neutron::Neutron()->GetPDGMass()
     142         - G4ParticleTable::GetParticleTable()->FindIon(static_cast<G4int>(theBaseZ), static_cast<G4int>(theBaseA+1), 0, static_cast<G4int>(theBaseZ))->GetPDGMass();
     143       thePhotons->operator[](0)->SetMomentum( Q*direction );
     144    }
     145//
    116146
    117147    // back to lab system
     
    156186    }
    157187    delete thePhotons;
     188
     189//101203TK
     190    G4bool residual = false;
     191    G4ParticleDefinition * aRecoil = G4ParticleTable::GetParticleTable()
     192                                   ->FindIon(static_cast<G4int>(theBaseZ), static_cast<G4int>(theBaseA+1), 0, static_cast<G4int>(theBaseZ));
     193    for ( G4int i = 0 ; i != theResult.GetNumberOfSecondaries() ; i++ )
     194    {
     195       if ( theResult.GetSecondary(i)->GetParticle()->GetDefinition() == aRecoil ) residual = true;
     196    }
     197
     198    if ( residual == false )
     199    {
     200       G4ParticleDefinition * aRecoil = G4ParticleTable::GetParticleTable()
     201                                        ->FindIon(static_cast<G4int>(theBaseZ), static_cast<G4int>(theBaseA+1), 0, static_cast<G4int>(theBaseZ));
     202       G4int nNonZero = 0;
     203       G4LorentzVector p_photons(0,0,0,0);
     204       for ( G4int i = 0 ; i != theResult.GetNumberOfSecondaries() ; i++ )
     205       {
     206          p_photons += theResult.GetSecondary(i)->GetParticle()->Get4Momentum();
     207          // To many 0 momentum photons -> Check PhotonDist
     208          if ( theResult.GetSecondary(i)->GetParticle()->Get4Momentum() > 0 ) nNonZero++;
     209       }
     210
     211       // Can we include kinetic energy here?
     212       G4double deltaE = ( theTrack.Get4Momentum().e() + theTarget.GetTotalEnergy() )
     213                       - ( p_photons.e() + aRecoil->GetPDGMass() );
     214
     215//Add photons
     216       if ( nPhotons - nNonZero > 0 )
     217       {
     218              //G4cout << "TKDB G4NeutronHPCaptureFS::ApplyYourself we will create additional " << nPhotons - nNonZero << " photons" << G4endl;
     219          std::vector<G4double> vRand;
     220          vRand.push_back( 0.0 );
     221          for ( G4int i = 0 ; i != nPhotons - nNonZero - 1 ; i++ )
     222          {
     223             vRand.push_back( G4UniformRand() );
     224          }
     225          vRand.push_back( 1.0 );
     226          std::sort( vRand.begin(), vRand.end() );
     227
     228          std::vector<G4double> vEPhoton;
     229          for ( G4int i = 0 ; i < (G4int)vRand.size() - 1 ; i++ )
     230          {
     231             vEPhoton.push_back( deltaE * ( vRand[i+1] - vRand[i] ) );
     232          }
     233          std::sort( vEPhoton.begin(), vEPhoton.end() );
     234
     235          for ( G4int i = 0 ; i < nPhotons - nNonZero - 1 ; i++ )
     236          {
     237             //Isotopic in LAB OK?
     238             G4double theta = pi*G4UniformRand();
     239             G4double phi = twopi*G4UniformRand();
     240             G4double sinth = std::sin(theta);
     241             G4double en = vEPhoton[i];
     242             G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
     243             
     244             p_photons += G4LorentzVector ( tempVector, tempVector.mag() );
     245             G4DynamicParticle * theOne = new G4DynamicParticle;
     246             theOne->SetDefinition( G4Gamma::Gamma() );
     247             theOne->SetMomentum( tempVector );
     248             theResult.AddSecondary(theOne);
     249          }
     250
     251//        Add last photon
     252          G4DynamicParticle * theOne = new G4DynamicParticle;
     253          theOne->SetDefinition( G4Gamma::Gamma() );
     254//        For better momentum conservation
     255          G4ThreeVector lastPhoton = -p_photons.vect().unit()*vEPhoton.back();
     256          p_photons += G4LorentzVector( lastPhoton , lastPhoton.mag() );
     257          theOne->SetMomentum( lastPhoton );
     258          theResult.AddSecondary(theOne);
     259       }
     260
     261//Add residual
     262       G4DynamicParticle * theOne = new G4DynamicParticle;
     263       G4ThreeVector aMomentum = theTrack.Get4Momentum().vect() + theTarget.GetMomentum()
     264                               - p_photons.vect();
     265       theOne->SetDefinition(aRecoil);
     266       theOne->SetMomentum( aMomentum );
     267       theResult.AddSecondary(theOne);
     268
     269    }
     270//101203TK END
     271
    158272// clean up the primary neutron
    159273    theResult.SetStatusChange(stopAndKill);
  • trunk/source/processes/hadronic/models/neutron_hp/src/G4NeutronHPDiscreteTwoBody.cc

    r962 r1347  
    3030//080612 Bug fix contribution from Benoit Pirard and Laurent Desorgher (Univ. Bern) #2,3
    3131//080709 Bug fix Sampling Legendre expansion by T. Koi   
     32//101110 Bug fix in MF=6, LAW=2 case; contribution from E. Mendoza, D. Cano-Ott (CIEMAT)
    3233//
    3334#include "G4NeutronHPDiscreteTwoBody.hh"
     
    111112       for(i=0;i<theCoeff[it].GetNumberOfPoly(); i++)
    112113       {
    113          theStore.SetX(i, theCoeff[it].GetCoeff(i));
    114          theStore.SetY(i, theCoeff[it].GetCoeff(i));
     114         //101110
     115         //theStore.SetX(i, theCoeff[it].GetCoeff(i));
     116         //theStore.SetY(i, theCoeff[it].GetCoeff(i));
     117         theStore.SetX(i/2, theCoeff[it].GetCoeff(i));
     118         theStore.SetY(i/2, theCoeff[it].GetCoeff(i+1));
    115119         i++;
    116120       }
     
    125129       for(i=0;i<theCoeff[it].GetNumberOfPoly(); i++)
    126130       {
    127          theStore.SetX(i, theCoeff[it].GetCoeff(i));
    128          theStore.SetY(i, theCoeff[it].GetCoeff(i));
     131         //101110
     132         //theStore.SetX(i, theCoeff[it].GetCoeff(i));
     133         //theStore.SetY(i, theCoeff[it].GetCoeff(i));
     134         theStore.SetX(i/2, theCoeff[it].GetCoeff(i));
     135         theStore.SetY(i/2, theCoeff[it].GetCoeff(i+1));
    129136         i++;
    130137       }
     
    161168         for(i=0;i<theCoeff[it-1].GetNumberOfPoly(); i++)
    162169         {
    163            theBuff1.SetX(i, theCoeff[it-1].GetCoeff(i));
    164            theBuff1.SetY(i, theCoeff[it-1].GetCoeff(i));
     170           //101110
     171           //theBuff1.SetX(i, theCoeff[it-1].GetCoeff(i));
     172           //theBuff1.SetY(i, theCoeff[it-1].GetCoeff(i));
     173           theBuff1.SetX(i/2, theCoeff[it-1].GetCoeff(i));
     174           theBuff1.SetY(i/2, theCoeff[it-1].GetCoeff(i+1));
    165175           i++;
    166176         }
     
    171181         for(i=0;i<theCoeff[it].GetNumberOfPoly(); i++)
    172182         {
     183           //theBuff2.SetX(i, theCoeff[it].GetCoeff(i));
     184           //theBuff2.SetY(i, theCoeff[it].GetCoeff(i));
    173185           theBuff2.SetX(i, theCoeff[it].GetCoeff(i));
    174            theBuff2.SetY(i, theCoeff[it].GetCoeff(i));
     186           theBuff2.SetY(i, theCoeff[it].GetCoeff(i+1));
    175187           i++;
    176188         }
     
    215227         for(i=0;i<theCoeff[it-1].GetNumberOfPoly(); i++)
    216228         {
    217            theBuff1.SetX(i, theCoeff[it-1].GetCoeff(i));
    218            theBuff1.SetY(i, theCoeff[it-1].GetCoeff(i));
     229           //101110
     230           //theBuff1.SetX(i, theCoeff[it-1].GetCoeff(i));
     231           //theBuff1.SetY(i, theCoeff[it-1].GetCoeff(i));
     232           theBuff1.SetX(i/2, theCoeff[it-1].GetCoeff(i));
     233           theBuff1.SetY(i/2, theCoeff[it-1].GetCoeff(i+1));
    219234           i++;
    220235         }
     
    226241         for(i=0;i<theCoeff[it].GetNumberOfPoly(); i++)
    227242         {
    228            theBuff2.SetX(i, theCoeff[it].GetCoeff(i));
    229            theBuff2.SetY(i, theCoeff[it].GetCoeff(i));
     243           //101110
     244           //theBuff2.SetX(i, theCoeff[it].GetCoeff(i));
     245           //theBuff2.SetY(i, theCoeff[it].GetCoeff(i));
     246           theBuff2.SetX(i/2, theCoeff[it].GetCoeff(i));
     247           theBuff2.SetY(i/2, theCoeff[it].GetCoeff(i+1));
    230248           i++;
    231249         }
  • trunk/source/processes/hadronic/models/neutron_hp/src/G4NeutronHPFinalState.cc

    r968 r1347  
    2727//080721 Create adjust_final_state method by T. Koi
    2828//080801 Residual reconstruction with theNDLDataA,Z (A, Z, and momentum are adjusted) by T. Koi
     29//101110 Set lower limit for gamma energy(1keV) by T. Koi
    2930
    3031#include "G4NeutronHPFinalState.hh"
     
    3738void G4NeutronHPFinalState::adjust_final_state ( G4LorentzVector init_4p_lab )
    3839{
     40
     41   G4double minimum_energy = 1*keV;
    3942
    4043   if ( adjustResult != true ) return;
     
    175178
    176179      // Adjust p
    177       if ( dif_4p.v().mag() < 1*MeV )
     180      //if ( dif_4p.v().mag() < 1*MeV )
     181      if ( minimum_energy < dif_4p.v().mag() && dif_4p.v().mag() < 1*MeV )
    178182      {
    179183
     
    184188      else
    185189      {
    186          //G4cout << "HP_DB Difference in dif_p is too large (>1MeV) to adjust, so that give up tuning" << G4endl;
     190         //G4cout << "HP_DB Difference in dif_p is too large (>1MeV) or too small(<1keV) to adjust, so that give up tuning" << G4endl;
    187191      }
    188192
     
    213217      nSecondaries += 2;
    214218      G4double e1 = ( dif_4p.e() -dif_4p.v().mag() ) / 2;
    215       G4double costh = 2.*G4UniformRand()-1.;
    216       G4double phi = twopi*G4UniformRand();
    217       G4ThreeVector dir( std::sin(std::acos(costh))*std::cos(phi),
    218                          std::sin(std::acos(costh))*std::sin(phi),
    219                          costh);
    220       theResult.AddSecondary ( new G4DynamicParticle ( G4Gamma::Gamma() , e1*dir ) );   
    221       theResult.AddSecondary ( new G4DynamicParticle ( G4Gamma::Gamma() , -e1*dir ) );   
     219     
     220      if ( minimum_energy < e1 ) 
     221      {
     222         G4double costh = 2.*G4UniformRand()-1.;
     223         G4double phi = twopi*G4UniformRand();
     224         G4ThreeVector dir( std::sin(std::acos(costh))*std::cos(phi),
     225                            std::sin(std::acos(costh))*std::sin(phi),
     226                            costh);
     227         theResult.AddSecondary ( new G4DynamicParticle ( G4Gamma::Gamma() , e1*dir ) );   
     228         theResult.AddSecondary ( new G4DynamicParticle ( G4Gamma::Gamma() , -e1*dir ) );   
     229      }
     230      else
     231      {
     232         //G4cout << "HP_DB Difference is too small(<1keV) to adjust, so that neglect it" << G4endl;
     233      }
    222234
    223235   }
  • trunk/source/processes/hadronic/models/neutron_hp/src/G4NeutronHPInelasticBaseFS.cc

    r962 r1347  
    3131//        Introduce theNDLDataA,Z which has A and Z of NDL data by T. Koi
    3232// 081024 G4NucleiPropertiesTable:: to G4NucleiProperties::
     33// 101111 Add Special treatment for Be9(n,2n)Be8(2a) case by T. Koi
    3334//
    3435#include "G4NeutronHPInelasticBaseFS.hh"
     
    360361  else if(theEnergyAngData!=0)
    361362  {
     363
    362364    G4double theGammaEnergy = theEnergyAngData->GetTotalMeanEnergy();
    363365    G4double anEnergy = boosted.GetKineticEnergy();
     
    371373    G4double eBindHe3 = G4NucleiProperties::GetBindingEnergy(3,2);
    372374    G4double eBindA = G4NucleiProperties::GetBindingEnergy(4,2);
     375    G4int ia=0;
    373376    for(i=0; i<tmpHadrons->size(); i++)
    374377    {
     
    396399      {
    397400        eBindProducts+=eBindA;
    398       }
    399     }
     401        ia++;
     402      }
     403    }
     404
    400405    theGammaEnergy += eBindProducts;
     406
     407//101111
     408//Special treatment for Be9 + n -> 2n + Be8 -> 2n + a + a
     409if ( (G4int)(theBaseZ+eps) == 4 && (G4int)(theBaseA+eps) == 9 )
     410{
     411   // This only valid for G4NDL3.13,,,
     412   if ( std::abs( theNuclearMassDifference -   
     413        ( G4NucleiProperties::GetBindingEnergy( 8 , 4 ) -
     414        G4NucleiProperties::GetBindingEnergy( 9 , 4 ) ) ) < 1*keV
     415      && ia == 2 )
     416   {
     417      theGammaEnergy -= (2*eBindA);
     418   }
     419}
    401420   
    402421    G4ReactionProductVector * theOtherPhotons = 0;
  • trunk/source/processes/hadronic/models/neutron_hp/src/G4NeutronHPInelasticCompFS.cc

    r1340 r1347  
    4141//        add two_body_reaction
    4242// 100909 add safty
     43// 101111 add safty for _nat_ data case in Binary reaction, but break conservation 
    4344//
    4445#include "G4NeutronHPInelasticCompFS.hh"
     
    681682   G4double AA = hadron->GetDefinition()->GetPDGMass() / proj->GetDefinition()->GetPDGMass();
    682683   G4double E1 = proj->GetKineticEnergy();
    683    G4double beta = std::sqrt ( A*(A+1-AA)/AA*(1+(1+A)/A*Q/E1) );
     684
     685// 101111
     686// In _nat_ data (Q+E1) could become negative value, following line is safty for this case.
     687   //if ( (Q+E1) < 0 )
     688   if ( ( 1 + (1+A)/A*Q/E1 ) < 0 )
     689   {
     690// 1.0e-6 eV is additional safty for numeric precision
     691      Q = -( A/(1+A)*E1 ) + 1.0e-6*eV;
     692   }
     693
     694   G4double beta = std::sqrt ( A*(A+1-AA)/AA*( 1 + (1+A)/A*Q/E1 ) );
    684695   G4double gamma = AA/(A+1-AA)*beta;
    685696   G4double E3 = AA/std::pow((1+A),2)*(beta*beta+1+2*beta*mu)*E1;
  • trunk/source/processes/hadronic/models/neutron_hp/src/G4NeutronHPPhotonDist.cc

    r1055 r1347  
    3939//        Contribution from Chao Zhang (Chao.Zhang@usd.edu) and Dongming Mei(Dongming.Mei@usd.edu)
    4040//        But it looks like never cause real effect in G4NDL3.13 (at least Natural elements) TK
     41// 101111 Change warning message for "repFlag == 2 && isoFlag != 1" case
    4142//
    4243// there is a lot of unused (and undebugged) code in this file. Kept for the moment just in case. @@
     
    124125  if (isoFlag != 1)
    125126  {
    126 if ( repFlag == 2 ) G4cout << "TKDB repFlag == 2 && isoFlag !=1  " << G4endl;
     127if ( repFlag == 2 ) G4cout << "G4NeutronHPPhotonDist: repFlag == 2 && isoFlag != 1 is unexpected! If you use G4ND3.x, then please report to Geant4 Hyper News. Thanks." << G4endl;
    127128    aDataFile >> tabulationType >> nDiscrete2 >> nIso;
    128129//080731
  • trunk/source/processes/hadronic/models/parton_string/History

    r1196 r1347  
    1414     * Please list in reverse chronological order (last date on top)
    1515     ---------------------------------------------------------------
     169  Dec. 2009, V. Uzhinsky         (hadr-prtn-V09-03-00)
     17   Crush found by Alberto with AveragePt2=0 is erased in FTF.
     18--------------------------------------------------------
     196  December 2009, V. Uzhinsky     (hadr-prtn-V09-02-10)
     20   Some correstions are made in diffr., hadronization and managment
     21   to treat kinky string fragmentation.
    1622
    172319 November 2009, Gunter Folger   (hadr-prtn-V09-02-09)
  • trunk/source/processes/hadronic/models/parton_string/diffraction/History

    r1340 r1347  
    1 $Id: History,v 1.33 2010/09/20 15:55:33 vuzhinsk Exp $
     1$Id: History,v 1.34 2010/11/15 10:10:16 vuzhinsk Exp $
    22-------------------------------------------------------------------
    33
     
    1515     * Please list in reverse chronological order (last date on top)
    1616     ---------------------------------------------------------------
     1715 Nov. 2010, V. Uzhinsky (hadr-string-diff-V09-03-04)
     18FTF with tuned parameters for pA and PiA interactions.
     19    Quark exchange is tuned.
     20    Low mass string fragmentation is improved.
     21    Reggeon cascade parameters are tuned.
     22
     23--------------------------------------------------------
    172420 Sept. 2010, V, Uzhinsky (hadr-string-diff-V09-03-03)
    1825FTF with new tuned parameters of nuclear destrustion is implemented.
  • trunk/source/processes/hadronic/models/parton_string/diffraction/include/G4DiffractiveSplitableHadron.hh

    r1340 r1347  
    2626//
    2727// $Id: G4DiffractiveSplitableHadron.hh,v 1.6 2010/09/20 15:50:46 vuzhinsk Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030
  • trunk/source/processes/hadronic/models/parton_string/diffraction/include/G4FTFModel.hh

    r1340 r1347  
    2626//
    2727// $Id: G4FTFModel.hh,v 1.11 2010/09/20 15:50:46 vuzhinsk Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// Class Description
  • trunk/source/processes/hadronic/models/parton_string/diffraction/include/G4FTFParameters.hh

    r1340 r1347  
    2727#define G4FTFParameters_h 1
    2828//
    29 // $Id: G4FTFParameters.hh,v 1.8 2010/09/20 15:50:46 vuzhinsk Exp $
    30 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     29// $Id: G4FTFParameters.hh,v 1.9 2010/11/15 10:05:19 vuzhinsk Exp $
     30// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3131//
    3232#include "G4Proton.hh"
     
    3535
    3636  public:
    37         G4FTFParameters(const G4ParticleDefinition * , G4double theA,
    38                                                        G4double theZ,
     37        G4FTFParameters(const G4ParticleDefinition * , G4int theA,
     38                                                       G4int theZ,
    3939                                                       G4double s);
     40//      G4FTFParameters(const G4ParticleDefinition * , G4double theA,
     41//                                                       G4double theZ,
     42//                                                       G4double s);
    4043
    4144        ~G4FTFParameters();
     
    6366        void SetSlopeQuarkExchange(const G4double aValue);
    6467        void SetDeltaProbAtQuarkExchange(const G4double aValue);
     68        void SetProbOfSameQuarkExchange(const G4double aValue);
    6569
    6670        void SetProjMinDiffMass(const G4double aValue);
     
    112116        G4double GetSlopeQuarkExchange();
    113117        G4double GetDeltaProbAtQuarkExchange();
     118        G4double GetProbOfSameQuarkExchange();
    114119
    115120        G4double GetProjMinDiffMass();
     
    161166        G4double SlopeQuarkExchange;
    162167        G4double DeltaProbAtQuarkExchange;
     168        G4double ProbOfSameQuarkExchange;
    163169
    164170        G4double ProjMinDiffMass;
     
    236242inline  void G4FTFParameters::SetDeltaProbAtQuarkExchange(const G4double aValue)
    237243             {DeltaProbAtQuarkExchange = aValue;}
     244inline void G4FTFParameters::SetProbOfSameQuarkExchange(const G4double aValue)
     245             {ProbOfSameQuarkExchange = aValue;}
    238246
    239247inline  void G4FTFParameters::SetProjMinDiffMass(const G4double aValue)
     
    331339inline  G4double G4FTFParameters::GetMagQuarkExchange()       {return MagQuarkExchange;}
    332340inline  G4double G4FTFParameters::GetSlopeQuarkExchange()     {return SlopeQuarkExchange;}
    333 inline  G4double G4FTFParameters::GetDeltaProbAtQuarkExchange()
    334                                                               {return DeltaProbAtQuarkExchange;}
    335 
     341inline  G4double G4FTFParameters::GetDeltaProbAtQuarkExchange(){return
     342                                                                DeltaProbAtQuarkExchange;}
     343inline  G4double G4FTFParameters::GetProbOfSameQuarkExchange(){return ProbOfSameQuarkExchange;}
    336344
    337345inline  G4double G4FTFParameters::GetProjMinDiffMass()        {return ProjMinDiffMass;}
  • trunk/source/processes/hadronic/models/parton_string/diffraction/include/G4FTFParticipants.hh

    r1340 r1347  
    2626//
    2727// $Id: G4FTFParticipants.hh,v 1.7 2010/09/20 15:50:46 vuzhinsk Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030
  • trunk/source/processes/hadronic/models/parton_string/diffraction/src/G4DiffractiveExcitation.cc

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4DiffractiveExcitation.cc,v 1.22 2010/09/20 15:50:46 vuzhinsk Exp $
     27// $Id: G4DiffractiveExcitation.cc,v 1.23 2010/11/15 10:02:38 vuzhinsk Exp $
    2828// ------------------------------------------------------------
    2929//      GEANT 4 class implemetation file
     
    163163
    164164     G4double SqrtS=std::sqrt(S);
    165            
     165//G4cout<<"SqrtS < 2300*MeV "<<SqrtS<<G4endl;           
    166166     if(absProjectilePDGcode > 1000 && (SqrtS < 2300*MeV || SqrtS < SumMasses))
    167167     {target->SetStatus(2);  return false;}  // The model cannot work for
     
    221221G4cout<<"Targ "<<M0target    <<" "<<TargetDiffStateMinMass    <<" "<<TargetNonDiffStateMinMass<<G4endl;
    222222G4cout<<"SqrtS "<<SqrtS<<G4endl;
    223 G4cout<<"Rapid "<<ProjectileRapidity<<" "<<TargetRapidity<<G4endl;
     223G4cout<<"Rapid "<<ProjectileRapidity<<G4endl; //" "<<TargetRapidity<<G4endl;
    224224*/
    225225// Charge exchange can be possible for baryons -----------------
     
    230230     G4double DeltaProbAtQuarkExchange=theParameters->GetDeltaProbAtQuarkExchange();
    231231
    232 //G4cout<<"Q exc "<<MagQuarkExchange<<" "<<SlopeQuarkExchange<<" "<<DeltaProbAtQuarkExchange<<G4endl;
    233232//     G4double NucleonMass=
    234233//              (G4ParticleTable::GetParticleTable()->FindParticle(2112))->GetPDGMass();     
     
    237236
    238237//G4cout<<MagQuarkExchange*std::exp(-SlopeQuarkExchange*(ProjectileRapidity - TargetRapidity))<<G4endl;
     238
     239//G4cout<<"Q exc Mag Slop Wdelta"<<MagQuarkExchange<<" "<<SlopeQuarkExchange<<" "<<DeltaProbAtQuarkExchange<<G4endl;
     240//G4cout<<"ProjectileRapidity "<<ProjectileRapidity<<G4endl;
    239241//G4cout<<MagQuarkExchange*std::exp(-SlopeQuarkExchange*(ProjectileRapidity))<<G4endl;
    240 //G4cout<<MagQuarkExchange*std::exp(-SlopeQuarkExchange*(ProjectileRapidity - 1.36))<<G4endl;
    241242//G4int Uzhi; G4cin>>Uzhi;
    242243// Check for possible quark exchange -----------------------------------
     
    272273      if(absProjectilePDGcode < 1000 )
    273274      {    // projectile is meson -----------------
     275
    274276       if(ProjQ1 > 0 ) // ProjQ1 is quark
    275277       { 
     
    300302         TargExchangeQ = TargQ3;  TargQ3=ProjExchangeQ; ProjQ2=TargExchangeQ;
    301303        }
    302 
    303304       } // End of if(ProjQ1 > 0 ) // ProjQ1 is quark
    304305
    305306       G4int aProjQ1=std::abs(ProjQ1);
    306307       G4int aProjQ2=std::abs(ProjQ2);
    307        if(aProjQ1 == aProjQ2)          {NewProjCode = 111;} // Pi0-meson
     308       if(aProjQ1 == aProjQ2)          {NewProjCode = 111;} // Pi0-meson 
    308309       else  // |ProjQ1| # |ProjQ2|
    309310       {
    310311        if(aProjQ1 > aProjQ2)          {NewProjCode = aProjQ1*100+aProjQ2*10+1;}
    311312        else                           {NewProjCode = aProjQ2*100+aProjQ1*10+1;}
     313        NewProjCode *=(ProjectilePDGcode/absProjectilePDGcode);
    312314       }
    313315
     316G4bool ProjExcited=false;
     317        if(G4UniformRand() < 0.5)
     318        {
     319         NewProjCode +=2; // Excited Pi0-meson
     320         ProjExcited=true;
     321        }
     322//G4cout<<G4endl<<"NewProjCode "<<NewProjCode<<G4endl;
     323
     324G4ParticleDefinition* TestParticle=0;
     325TestParticle=G4ParticleTable::GetParticleTable()->FindParticle(NewProjCode);
     326if(TestParticle)
     327{
     328 M0projectile=
     329 (G4ParticleTable::GetParticleTable()->FindParticle(NewProjCode))->GetPDGMass();
     330 M0projectile2 = M0projectile * M0projectile;
     331
     332 ProjectileDiffStateMinMass   =M0projectile+210.*MeV; //210 MeV=m_pi+70 MeV
     333 ProjectileNonDiffStateMinMass=M0projectile+210.*MeV; //210 MeV=m_pi+70 MeV
     334} else
     335{return false;}
     336
     337//G4cout<<"New TrQ "<<TargQ1<<" "<<TargQ2<<" "<<TargQ3<<G4endl;
    314338       NewTargCode = NewNucleonId(TargQ1, TargQ2, TargQ3);
     339//G4cout<<"NewTargCode "<<NewTargCode<<G4endl;
    315340
    316341       if( (TargQ1 == TargQ2) && (TargQ1 == TargQ3) &&
    317            (SqrtS > M0projectile+DeltaMass))           {NewTargCode +=2;} //Create Delta isobar
    318 
    319        else if( target->GetDefinition()->GetPDGiIsospin() == 3 )         //Delta was the target
    320        { if(G4UniformRand() > DeltaProbAtQuarkExchange){NewTargCode +=2;} //Save   Delta isobar
     342           (SqrtS > M0projectile+DeltaMass))           {NewTargCode +=2;  //Create Delta isobar
     343                                                        ProjExcited=true;}
     344       else if( target->GetDefinition()->GetPDGiIsospin() == 3 )          //Delta was the target
     345       { if(G4UniformRand() > DeltaProbAtQuarkExchange){NewTargCode +=2;  //Save   Delta isobar
     346                                                        ProjExcited=true;}
    321347         else                                          {}     // De-excite initial Delta isobar
    322348       }
    323349
    324        else if((G4UniformRand() < DeltaProbAtQuarkExchange) &&         //Nucleon was the target
     350//       else if((!CreateDelta)                               &&
     351       else if((!ProjExcited)                               &&
     352               (G4UniformRand() < DeltaProbAtQuarkExchange) &&         //Nucleon was the target
    325353               (SqrtS > M0projectile+DeltaMass))      {NewTargCode +=2;}  //Create Delta isobar
     354//       else if( CreateDelta)                          {NewTargCode +=2;}
    326355       else                                           {}                 //Save initial nucleon
     356
    327357//       target->SetDefinition(                                          // Fix 15.12.09
    328358//       G4ParticleTable::GetParticleTable()->FindParticle(NewTargCode));// Fix 15.12.09
     359
     360//G4cout<<"NewTargCode "<<NewTargCode<<G4endl;
     361//G4int Uzhi; G4cin>>Uzhi;
     362TestParticle=G4ParticleTable::GetParticleTable()->FindParticle(NewTargCode);
     363if(TestParticle)
     364{
     365 M0target=
     366 (G4ParticleTable::GetParticleTable()->FindParticle(NewTargCode))->GetPDGMass();
     367 M0target2 = M0target * M0target;
     368
     369 TargetDiffStateMinMass   =M0target+220.*MeV;         //220 MeV=m_pi+80 MeV;   
     370 TargetNonDiffStateMinMass=M0target+220.*MeV;         //220 MeV=m_pi+80 MeV;
     371} else
     372{return false;}
    329373      } else
    330374      {    // projectile is baryon ----------------
    331        G4double Same=0.; //0.3; //0.5;
     375//=========================================================================
     376       G4double Same=theParameters->GetProbOfSameQuarkExchange(); //0.3; //0.5; 0.
    332377       G4bool ProjDeltaHasCreated(false);
    333378       G4bool TargDeltaHasCreated(false);
     
    485530      } // End of if projectile is baryon ---------------------------
    486531
     532//G4cout<<"At end// NewProjCode "<<NewProjCode<<G4endl;
     533//G4cout<<"At end// NewTargCode "<<NewTargCode<<G4endl;
    487534
    488535// If we assume that final state hadrons after the charge exchange will be
    489536// in the ground states, we have to put ----------------------------------
    490 
    491 /*
    492 //      if(M0projectile <
    493 //         (G4ParticleTable::GetParticleTable()->FindParticle(NewProjCode))->GetPDGMass())
    494       if(ProjDeltaHasCreated)
    495       {
    496        M0projectile=
    497          (G4ParticleTable::GetParticleTable()->FindParticle(NewProjCode))->GetPDGMass();
    498        M0projectile2 = M0projectile * M0projectile;
    499 
    500        ProjectileDiffStateMinMass   =M0projectile+160.*MeV; //160 MeV=m_pi+20 MeV
    501        ProjectileNonDiffStateMinMass=M0projectile+160.*MeV; //160 MeV=m_pi+20 MeV
    502       }
    503 
    504 //      if(M0target <
    505 //         (G4ParticleTable::GetParticleTable()->FindParticle(NewTargCode))->GetPDGMass())
    506       if(TargDeltaHasCreated)
    507       {
    508        M0target=
    509          (G4ParticleTable::GetParticleTable()->FindParticle(NewTargCode))->GetPDGMass();
    510        M0target2 = M0target * M0target;
    511 
    512        TargetDiffStateMinMass   =M0target+160.*MeV;         //160 MeV=m_pi+20 MeV;   
    513        TargetNonDiffStateMinMass=M0target+160.*MeV;         //160 MeV=m_pi+20 MeV;
    514       }
    515 */
     537//G4cout<<"M0pr M0tr SqS "<<M0projectile<<" "<<M0target<<" "<<SqrtS<<G4endl;
     538
    516539      PZcms2=(S*S+M0projectile2*M0projectile2+M0target2*M0target2-
    517540             2*S*M0projectile2 - 2*S*M0target2 - 2*M0projectile2*M0target2)
    518541             /4./S;
    519 //G4cout<<"PZcms2 1 "<<PZcms2<<G4endl;
     542//G4cout<<"PZcms2 1 "<<PZcms2<<G4endl<<G4endl;
    520543      if(PZcms2 < 0) {return false;}  // It can be if energy is not sufficient for Delta
    521544//----------------------------------------------------------
     
    536559// ----------------------------------------------------------
    537560
    538 //      G4double Wexcit=1.-1.97*std::exp(-0.5*ProjectileRapidity);
    539       G4double Wexcit=1.-2.256*std::exp(-0.6*ProjectileRapidity);
    540 
    541 //G4cout<<ProjectileRapidity<<" "<<1.72*std::exp(-0.4*ProjectileRapidity)<<" "<<std::exp(0.4*ProjectileRapidity)<<G4endl;
    542 //G4int Uzhi;G4cin>>Uzhi;
    543 //Wexcit=0.;
    544       if(G4UniformRand() > Wexcit)
    545       {                             // Make elastic scattering
    546 //G4cout<<"Make elastic scattering"<<G4endl;
    547        Pprojectile.transform(toLab);
    548        Ptarget.transform(toLab);
    549 
    550        projectile->SetTimeOfCreation(target->GetTimeOfCreation());
    551        projectile->SetPosition(target->GetPosition());
    552 
    553        projectile->Set4Momentum(Pprojectile);
    554        target->Set4Momentum(Ptarget);
    555 
    556        G4bool Result= theElastic->ElasticScattering (projectile,target,theParameters);
    557        return Result;
    558       } // end of if(G4UniformRand() > Wexcit)
     561      if(absProjectilePDGcode < 1000)
     562      { // For projectile meson
     563       G4double Wexcit=1.-2.256*std::exp(-0.6*ProjectileRapidity);
     564       Wexcit=0.;
     565       if(G4UniformRand() > Wexcit)
     566       {                             // Make elastic scattering
     567//G4cout<<"Make elastic scattering of new hadrons"<<G4endl;
     568        Pprojectile.transform(toLab);
     569        Ptarget.transform(toLab);
     570
     571        projectile->SetTimeOfCreation(target->GetTimeOfCreation());
     572        projectile->SetPosition(target->GetPosition());
     573
     574        projectile->Set4Momentum(Pprojectile);
     575        target->Set4Momentum(Ptarget);
     576
     577        G4bool Result= theElastic->ElasticScattering (projectile,target,theParameters);
     578        return Result;
     579       } // end of if(Make elastic scattering for projectile meson?)
     580      } else
     581      { // For projectile baryon
     582       G4double Wexcit=1.-2.256*std::exp(-0.6*ProjectileRapidity);
     583       //Wexcit=0.;
     584       if(G4UniformRand() > Wexcit)
     585       {                             // Make elastic scattering
     586//G4cout<<"Make elastic scattering of new hadrons"<<G4endl;
     587        Pprojectile.transform(toLab);
     588        Ptarget.transform(toLab);
     589
     590        projectile->SetTimeOfCreation(target->GetTimeOfCreation());
     591        projectile->SetPosition(target->GetPosition());
     592
     593        projectile->Set4Momentum(Pprojectile);
     594        target->Set4Momentum(Ptarget);
     595
     596        G4bool Result= theElastic->ElasticScattering (projectile,target,theParameters);
     597        return Result;
     598       } // end of if(Make elastic scattering for projectile baryon?)
     599      }
     600//G4cout<<"Make excitation of new hadrons"<<G4endl;
    559601     }  // End of charge exchange part ------------------------------
    560602
     
    569611G4cout<<"Prob ProjDiff TargDiff "<<ProbProjectileDiffraction<<" "<<ProbTargetDiffraction<<" "<<ProbOfDiffraction<<G4endl;
    570612G4cout<<"Pr Y "<<Pprojectile.rapidity()<<" Tr Y "<<Ptarget.rapidity()<<G4endl;
    571 //G4int Uzhi; G4cin>>Uzhi;
     613G4int Uzhi; G4cin>>Uzhi;
    572614*/
    573615/*
  • trunk/source/processes/hadronic/models/parton_string/diffraction/src/G4DiffractiveSplitableHadron.cc

    r1340 r1347  
    2626//
    2727// $Id: G4DiffractiveSplitableHadron.cc,v 1.9 2010/09/20 15:50:46 vuzhinsk Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030
  • trunk/source/processes/hadronic/models/parton_string/diffraction/src/G4FTFModel.cc

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4FTFModel.cc,v 1.36 2010/09/20 15:50:46 vuzhinsk Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4FTFModel.cc,v 1.37 2010/11/15 10:02:38 vuzhinsk Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030
     
    9999{
    100100        theProjectile = aProjectile; 
     101//G4cout<<"FTF init Pro "<<theProjectile.GetMass()<<" "<<theProjectile.GetMomentum()<<G4endl;
     102//G4cout<<"FTF init A Z "<<aNucleus.GetA_asInt()<<" "<<aNucleus.GetZ_asInt()<<G4endl;
     103//G4cout<<"             "<<aNucleus.GetN()<<" "<<aNucleus.GetZ()<<G4endl;
     104//G4int Uzhi; G4cin>>Uzhi;
    101105
    102106        theParticipants.Init(aNucleus.GetA_asInt(),aNucleus.GetZ_asInt());
    103 
     107//G4cout<<"End nucl init"<<G4endl;
    104108// ----------- N-mass number Z-charge -------------------------
    105109
     
    111115      if( theParameters != 0 ) delete theParameters;
    112116      theParameters = new G4FTFParameters(theProjectile.GetDefinition(),
    113                                           aNucleus.GetN(),aNucleus.GetZ(),
     117                                          aNucleus.GetA_asInt(),aNucleus.GetZ_asInt(),
    114118                                          s);
     119//      theParameters = new G4FTFParameters(theProjectile.GetDefinition(),
     120//                                          aNucleus.GetN(),aNucleus.GetZ(),
     121//                                          s);
    115122
    116123//theParameters->SetProbabilityOfElasticScatt(0.);
     
    298305        G4int ResidualMassNumber=theNucleus->GetMassNumber();
    299306        G4int ResidualCharge    =theNucleus->GetCharge();
     307
    300308        ResidualExcitationEnergy=0.;
    301309        G4LorentzVector PnuclearResidual(0.,0.,0.,0.);
     
    340348 
    341349//      ResidualMass +=ResidualExcitationEnergy; // Will be given after checks
    342 //G4cout<<"SumMasses End ResidualMass "<<SumMasses<<" "<<ResidualMass<<G4endl;
     350//G4cout<<"SumMasses And ResidualMass "<<SumMasses<<" "<<ResidualMass<<G4endl;
    343351        SumMasses += ResidualMass;
    344352//G4cout<<"SumMasses + ResM "<<SumMasses<<G4endl;
     
    548556        Pprojectile.transform(toLab);       // The work with the projectile
    549557        primary->Set4Momentum(Pprojectile); // is finished at the moment.
     558//G4cout<<"Final proj mom "<<primary->Get4Momentum()<<G4endl;
    550559
    551560//-------------------------------------------------------------
     
    578587        }   // end of for(G4int i=0; i < NumberOfInvolvedNucleon; i++ )
    579588
     589//G4cout<<"ResidualMassNumber and Mom "<<ResidualMassNumber<<" "<<Residual3Momentum<<G4endl;
    580590        G4double Mt2Residual=sqr(ResidualMass) +
    581591                                 sqr(Residual3Momentum.x())+sqr(Residual3Momentum.y());
    582 
    583         G4double PzResidual=-WminusTarget*Residual3Momentum.z()/2. +
     592//==========================
     593//G4cout<<"WminusTarget Residual3Momentum.z() "<<WminusTarget<<" "<<Residual3Momentum.z()<<G4endl;
     594        G4double PzResidual=0.;
     595        G4double EResidual =0.;
     596        if(ResidualMassNumber != 0)
     597        {
     598         PzResidual=-WminusTarget*Residual3Momentum.z()/2. +
    584599                             Mt2Residual/(2.*WminusTarget*Residual3Momentum.z());
    585         G4double EResidual = WminusTarget*Residual3Momentum.z()/2. +
     600        EResidual = WminusTarget*Residual3Momentum.z()/2. +
    586601                             Mt2Residual/(2.*WminusTarget*Residual3Momentum.z());
    587 
     602        }
     603//==========================
    588604        Residual4Momentum.setPx(Residual3Momentum.x());
    589605        Residual4Momentum.setPy(Residual3Momentum.y());
    590606        Residual4Momentum.setPz(PzResidual);
    591607        Residual4Momentum.setE(EResidual);
    592 
     608//G4cout<<"Residual4Momentum "<<Residual4Momentum<<G4endl;
    593609        Residual4Momentum.transform(toLab);
    594610//-------------------------------------------------------------
  • trunk/source/processes/hadronic/models/parton_string/diffraction/src/G4FTFParameters.cc

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4FTFParameters.cc,v 1.14 2010/09/20 15:50:46 vuzhinsk Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4FTFParameters.cc,v 1.15 2010/11/15 10:02:38 vuzhinsk Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030
     
    4242//**********************************************************************************************
    4343
     44//G4FTFParameters::G4FTFParameters(const G4ParticleDefinition * particle,
     45//                                                   G4double   theA,
     46//                                                   G4double   theZ,
     47//                                                   G4double   s)
    4448G4FTFParameters::G4FTFParameters(const G4ParticleDefinition * particle,
    45                                                    G4double   theA,
    46                                                    G4double   theZ,
     49                                                   G4int   theA,
     50                                                   G4int   theZ,
    4751                                                   G4double   s)
    4852{
     
    6266    G4double sqrLogPlab = LogPlab * LogPlab;
    6367
    64     G4int NumberOfTargetProtons  = (G4int) theZ;
    65     G4int NumberOfTargetNeutrons = (G4int) theA- (G4int) theZ;
     68    G4int NumberOfTargetProtons  = theZ;
     69    G4int NumberOfTargetNeutrons = theA-theZ;
     70//    G4int NumberOfTargetProtons  = (G4int) theZ;
     71//    G4int NumberOfTargetNeutrons = (G4int) theA- (G4int) theZ;
    6672    G4int NumberOfTargetNucleons = NumberOfTargetProtons + NumberOfTargetNeutrons;
    6773
    6874    G4double Xtotal, Xelastic;
    6975
    70     if( absPDGcode > 1000 )                        //------Projectile is baryon --------
     76    if( PDGcode > 1000 )                        //------Projectile is baryon --------
    7177      {       
    7278       G4double XtotPP = 48.0 +  0. *std::pow(Plab, 0.  ) + 0.522*sqrLogPlab - 4.51*LogPlab;
     
    7581       G4double XelPP  = 11.9 + 26.9*std::pow(Plab,-1.21) + 0.169*sqrLogPlab - 1.85*LogPlab;
    7682       G4double XelPN  = 11.9 + 26.9*std::pow(Plab,-1.21) + 0.169*sqrLogPlab - 1.85*LogPlab;
     83
     84       Xtotal          = ( NumberOfTargetProtons  * XtotPP +
     85                           NumberOfTargetNeutrons * XtotPN  ) / NumberOfTargetNucleons;
     86       Xelastic        = ( NumberOfTargetProtons  * XelPP  +
     87                           NumberOfTargetNeutrons * XelPN   ) / NumberOfTargetNucleons;
     88      }
     89    else if( PDGcode < -1000 )                 //------Projectile is anti_baryon --------
     90      {       
     91       G4double XtotPP = 38.4 +  77.6*std::pow(Plab,-0.64) + 0.26*sqrLogPlab - 1.2*LogPlab;
     92       G4double XtotPN =  0.  + 133.6*std::pow(Plab,-0.70) + 1.22*sqrLogPlab +13.7*LogPlab;
     93
     94       G4double XelPP  = 10.2 + 52.7*std::pow(Plab,-1.16) + 0.125*sqrLogPlab - 1.28*LogPlab;
     95       G4double XelPN  = 36.5 +  0. *std::pow(Plab, 0.  ) + 0.   *sqrLogPlab -11.9 *LogPlab;
    7796
    7897       Xtotal          = ( NumberOfTargetProtons  * XtotPP +
     
    184203//      Xtotal and Xelastic in mb
    185204
     205// For Pi- P interactions only!
     206if(std::abs(Plab-1.4) < 0.05) {Xtotal=3.500599e+01; Xelastic= 1.150032e+01;}
     207if(std::abs(Plab-1.5) < 0.05) {Xtotal=3.450591e+01; Xelastic= 1.050038e+01;}
     208if(std::abs(Plab-1.6) < 0.05) {Xtotal=3.430576e+01; Xelastic= 9.800433e+00;}
     209if(std::abs(Plab-1.7) < 0.05) {Xtotal=3.455560e+01; Xelastic= 9.300436e+00;}
     210if(std::abs(Plab-1.8) < 0.05) {Xtotal=3.480545e+01; Xelastic= 8.800438e+00;}
     211if(std::abs(Plab-2.0) < 0.05) {Xtotal=3.570503e+01; Xelastic= 8.200370e+00;}
     212if(std::abs(Plab-2.2) < 0.05) {Xtotal=3.530495e+01; Xelastic= 7.800362e+00;}
     213if(std::abs(Plab-2.5) < 0.05) {Xtotal=3.410484e+01; Xelastic= 7.350320e+00;}
     214if(std::abs(Plab-2.75) < 0.05){Xtotal=3.280479e+01; Xelastic= 7.050273e+00;}
     215if(std::abs(Plab-3.0) < 0.05) {Xtotal=3.180473e+01; Xelastic= 6.800258e+00;}
     216if(std::abs(Plab-4.0) < 0.05) {Xtotal=2.910441e+01; Xelastic= 6.100229e+00;}
     217if(std::abs(Plab-5.0) < 0.05) {Xtotal=2.820372e+01; Xelastic= 5.700275e+00;}
     218if(std::abs(Plab-6.0) < 0.05) {Xtotal=2.760367e+01; Xelastic= 5.400255e+00;}
     219if(std::abs(Plab-7.0) < 0.05) {Xtotal=2.725366e+01; Xelastic= 5.150256e+00;}
     220if(std::abs(Plab-8.0) < 0.05) {Xtotal=2.690365e+01; Xelastic= 4.900258e+00;}
     221if(std::abs(Plab-10.0) < 0.05){Xtotal=2.660342e+01; Xelastic= 4.600237e+00;}
     222if(std::abs(Plab-12.0) < 0.05){Xtotal=2.632341e+01; Xelastic= 4.480229e+00;}
     223if(std::abs(Plab-14.0) < 0.05){Xtotal=2.604340e+01; Xelastic= 4.360221e+00;}
     224if(std::abs(Plab-20.0) < 0.05){Xtotal=2.520337e+01; Xelastic= 4.000197e+00;}
     225if(std::abs(Plab-30.0) < 0.05){Xtotal=2.505334e+01; Xelastic= 3.912679e+00;}
     226//
    186227//----------- Geometrical parameters ------------------------------------------------
    187228      SetTotalCrossSection(Xtotal);
     
    189230      SetInelasticCrossSection(Xtotal-Xelastic);
    190231
    191 //G4cout<<"Xtotal, Xelastic "<<Xtotal<<" "<<Xelastic<<G4endl;
     232//G4cout<<"Plab Xtotal, Xelastic Xinel "<<Plab<<" "<<Xtotal<<" "<<Xelastic<<Xtotal-Xelastic)<<G4endl;
    192233//  // Interactions with elastic and inelastic collisions
    193234      SetProbabilityOfElasticScatt(Xtotal, Xelastic);
     
    212253
    213254//----------- Parameters of excitations ---------------------------------------------
    214            if( absPDGcode > 1000 )                        //------Projectile is baryon --------
     255           if( PDGcode > 1000 )                        //------Projectile is baryon --------
    215256             {
    216257              SetMagQuarkExchange(1.84);//(3.63);
    217258              SetSlopeQuarkExchange(0.7);//(1.2);
    218259              SetDeltaProbAtQuarkExchange(0.);
     260              if(NumberOfTargetNucleons > 26) {SetProbOfSameQuarkExchange(1.);}
     261              else                            {SetProbOfSameQuarkExchange(0.);}
     262
     263              SetProjMinDiffMass(1.16);                   // GeV
     264              SetProjMinNonDiffMass(1.16);                // GeV
     265              SetProbabilityOfProjDiff(0.805*std::exp(-0.35*Ylab));// 0.5
     266
     267              SetTarMinDiffMass(1.16);                    // GeV
     268              SetTarMinNonDiffMass(1.16);                 // GeV
     269              SetProbabilityOfTarDiff(0.805*std::exp(-0.35*Ylab));// 0.5
     270
     271              SetAveragePt2(0.15);                        // 0.15 GeV^2
     272             }
     273           if( PDGcode < -1000 )                  //------Projectile is anti_baryon --------
     274             {
     275              SetMagQuarkExchange(0.);
     276              SetSlopeQuarkExchange(0.);
     277              SetDeltaProbAtQuarkExchange(0.);
     278              SetProbOfSameQuarkExchange(0.);
    219279
    220280              SetProjMinDiffMass(1.16);                   // GeV
    221281              SetProjMinNonDiffMass(1.16);                // GeV
    222              
    223 SetProbabilityOfProjDiff(0.805*std::exp(-0.35*Ylab));// 0.5
     282              SetProbabilityOfProjDiff(0.805*std::exp(-0.35*Ylab));// 0.5
    224283
    225284              SetTarMinDiffMass(1.16);                    // GeV
    226285              SetTarMinNonDiffMass(1.16);                 // GeV
    227              
    228 SetProbabilityOfTarDiff(0.805*std::exp(-0.35*Ylab));// 0.5
     286              SetProbabilityOfTarDiff(0.805*std::exp(-0.35*Ylab));// 0.5
    229287
    230288              SetAveragePt2(0.15);                        // 0.15 GeV^2
     
    232290           else if( absPDGcode == 211 || PDGcode ==  111) //------Projectile is Pion -----------
    233291             {
    234               SetMagQuarkExchange(120.); // 210.
    235               SetSlopeQuarkExchange(2.0);
    236               SetDeltaProbAtQuarkExchange(0.6);
     292              SetMagQuarkExchange(240.);
     293              SetSlopeQuarkExchange(2.);
     294              SetDeltaProbAtQuarkExchange(0.56); //(0.35);
    237295
    238296              SetProjMinDiffMass(0.5);                    // GeV
    239               SetProjMinNonDiffMass(0.3);                 // GeV
    240               SetProbabilityOfProjDiff(0.*0.62*std::pow(s/GeV/GeV,-0.51)); // 40/32 X-dif/X-inel
    241 
    242               SetTarMinDiffMass(1.1);                     // GeV
    243               SetTarMinNonDiffMass(1.1);                  // GeV
    244 
    245               SetProbabilityOfTarDiff(2.*0.62*std::pow(s/GeV/GeV,-0.51)); // 40/32 X-dif/X-inel
     297              SetProjMinNonDiffMass(0.5);                 // GeV 0.3
     298              SetProbabilityOfProjDiff(0.);//(0.*0.62*std::pow(s/GeV/GeV,-0.51)); // 40/32 X-dif/X-inel
     299
     300              SetTarMinDiffMass(1.16);                     // GeV
     301              SetTarMinNonDiffMass(1.16);                  // GeV
     302//              SetProbabilityOfTarDiff(1.);//(2.*0.62*std::pow(s/GeV/GeV,-0.51));
     303//              SetProbabilityOfTarDiff(2.6*std::exp(-0.46*Ylab));
     304              SetProbabilityOfTarDiff(0.8*std::exp(-0.6*(Ylab-3.)));
    246305
    247306              SetAveragePt2(0.3);                         // GeV^2
     
    295354      SetMaxNumberOfCollisions(1000.,1.); //(Plab,2.); //3.); ##############################
    296355
    297       SetCofNuclearDestruction(0.3); //1.0);           // for meson projectile
    298 
    299       SetDofNuclearDestruction(0.4);
    300       SetPt2ofNuclearDestruction(0.17*GeV*GeV);
    301       SetMaxPt2ofNuclearDestruction(1.0*GeV*GeV);
    302 
    303       SetExcitationEnergyPerWoundedNucleon(100*MeV);
    304     } else                                             // for baryon projectile
    305     {
    306 //      SetMaxNumberOfCollisions(Plab,0.1); //6.); // ##############################
    307       SetMaxNumberOfCollisions(Plab,4.); //6.); // ##############################
    308 
    309       SetCofNuclearDestruction(0.62*std::exp(4.*(Ylab-2.1))/(1.+std::exp(4.*(Ylab-2.1))));
    310 
     356//      SetCofNuclearDestruction(0.); //1.0);           // for meson projectile
     357//      SetCofNuclearDestruction(1.*std::exp(4.*(Ylab-2.1))/(1.+std::exp(4.*(Ylab-2.1))));
     358//G4cout<<Ylab<<" "<<0.62*std::exp(4.*(Ylab-4.5))/(1.+std::exp(4.*(Ylab-4.5)))<<G4endl;
     359//G4int Uzhi; G4cin>>Uzhi;
     360
     361//      SetMaxNumberOfCollisions(Plab,2.); //4.); // ##############################
     362
     363      SetCofNuclearDestruction(1.*std::exp(4.*(Ylab-2.1))/(1.+std::exp(4.*(Ylab-2.1)))); //0.62 1.0
     364//------------------------------------------
     365//      SetDofNuclearDestruction(0.4);
     366//      SetPt2ofNuclearDestruction(0.17*GeV*GeV);
     367//      SetMaxPt2ofNuclearDestruction(1.0*GeV*GeV);
     368
     369//      SetExcitationEnergyPerWoundedNucleon(100*MeV);
    311370      SetDofNuclearDestruction(0.4);
    312371      SetPt2ofNuclearDestruction((0.035+
     
    315374
    316375      SetExcitationEnergyPerWoundedNucleon(75.*MeV);
     376    } else                                             // for baryon projectile
     377    {
     378      SetMaxNumberOfCollisions(Plab,2.); //4.); // ##############################
     379
     380      SetCofNuclearDestruction(1.*std::exp(4.*(Ylab-2.1))/(1.+std::exp(4.*(Ylab-2.1)))); //0.62 1.0
     381//G4cout<<Ylab<<" "<<0.62*std::exp(4.*(Ylab-2.1))/(1.+std::exp(4.*(Ylab-2.1)))<<G4endl;
     382//G4int Uzhi; G4cin>>Uzhi;
     383
     384      SetDofNuclearDestruction(0.4);
     385      SetPt2ofNuclearDestruction((0.035+
     386          0.04*std::exp(4.*(Ylab-2.5))/(1.+std::exp(4.*(Ylab-2.5))))*GeV*GeV); //0.09
     387      SetMaxPt2ofNuclearDestruction(1.0*GeV*GeV);
     388
     389      SetExcitationEnergyPerWoundedNucleon(75.*MeV);
    317390    }
    318391
     
    322395//SetPt2ofNuclearDestruction((0.035+0.1*std::exp(4.*(Ylab-3.))/(1.+std::exp(4.*(Ylab-3.))))*GeV*GeV);
    323396
     397//SetMagQuarkExchange(120.); // 210. PipP
     398//SetSlopeQuarkExchange(2.0);
     399//SetDeltaProbAtQuarkExchange(0.6);
     400//SetProjMinDiffMass(0.7);                    // GeV 1.1
     401//SetProjMinNonDiffMass(0.7);                 // GeV
     402//SetProbabilityOfProjDiff(0.85*std::pow(s/GeV/GeV,-0.5)); // 40/32 X-dif/X-inel
     403//SetTarMinDiffMass(1.1);                     // GeV
     404//SetTarMinNonDiffMass(1.1);                  // GeV
     405//SetProbabilityOfTarDiff(0.85*std::pow(s/GeV/GeV,-0.5)); // 40/32 X-dif/X-inel
     406//
     407//SetAveragePt2(0.3);                         // GeV^2
     408//------------------------------------
    324409//SetProbabilityOfElasticScatt(1.,1.); //(Xtotal, Xelastic);
    325410//SetProbabilityOfProjDiff(1.*0.62*std::pow(s/GeV/GeV,-0.51)); // 0->1
     
    328413//SetAvaragePt2ofElasticScattering(0.);
    329414
    330 //SetCofNuclearDestruction(0.6); //(0.4);                 
    331 SetExcitationEnergyPerWoundedNucleon(75.*MeV); //(75.*MeV);
    332 //SetDofNuclearDestruction(0.6); //(0.4);                 
    333 //SetPt2ofNuclearDestruction(0.12*GeV*GeV); //(0.168*GeV*GeV);
     415//SetMaxNumberOfCollisions(4.*(Plab+0.01),Plab); //6.); // ##############################
     416//SetCofNuclearDestruction(0.2); //(0.4);                 
     417//SetExcitationEnergyPerWoundedNucleon(0.*MeV); //(75.*MeV);
     418//SetDofNuclearDestruction(0.4); //(0.4);                 
     419//SetPt2ofNuclearDestruction(0.1*GeV*GeV); //(0.168*GeV*GeV);
    334420
    335421}
  • trunk/source/processes/hadronic/models/parton_string/diffraction/src/G4FTFParticipants.cc

    r1340 r1347  
    2626//
    2727// $Id: G4FTFParticipants.cc,v 1.17 2010/09/20 15:50:46 vuzhinsk Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030// ------------------------------------------------------------
  • trunk/source/processes/hadronic/models/parton_string/hadronization/History

    r1340 r1347  
    1 $Id: History,v 1.17 2010/09/28 09:03:07 gcosmo Exp $
     1$Id: History,v 1.18 2010/11/03 17:11:31 gunter Exp $
    22-------------------------------------------------------------------
    33
     
    1515     * Please list in reverse chronological order (last date on top)
    1616     ---------------------------------------------------------------
     17
     183 Nov 2010, Gunter Folger               (had-hadronization-V09-03-02)
     19- fix minor coverity warnings in G4HadronBuilder
    1720
    182122-September-2010  V. Uzhinsky          (had-hadronization-V09-03-01)
  • trunk/source/processes/hadronic/models/parton_string/management/History

    r1340 r1347  
    1 $Id: History,v 1.9 2010/09/08 16:57:50 gunter Exp $
     1$Id: History,v 1.10 2010/11/30 16:11:25 vuzhinsk Exp $
    22-------------------------------------------------------------------
    33
     
    1515     * Please list in reverse chronological order (last date on top)
    1616     ---------------------------------------------------------------
     1730 Nov. 2010 V. Uzhinsky (had-partonstring-mgt-V09-03-01)
     18   Member G4int Status in G4VSplitableHadron was changed
     19   into G4int curStatus
    1720
    18218-Sept-2010, G.Folger       (had-partonstring-mgt-V09-03-00)
  • trunk/source/processes/hadronic/models/pre_equilibrium/History

    r1340 r1347  
    1414     * Please list in reverse chronological order (last date on top)
    1515     ---------------------------------------------------------------
     16
     1723-November 2010 V.Ivanchenko   hadr-pre-V09-03-17
     18---------------------------------------------------
     19G4PreCompoundFragment, G4PreCompoundEmission, G4PreCompoundModel -
     20  return back ref-09 computations
     21
     2218-November 2010 V.Ivanchenko   hadr-pre-V09-03-16
     23---------------------------------------------------
     24G4PreCompoundModel - change number of excitons to be as in 9.3
     25  affects tail of neutron stectrum for low-energy projectile
     26
     2717-November 2010 V.Ivanchenko   hadr-pre-V09-03-15
     28---------------------------------------------------
     29G4PreCompoundProton, G4PreCompoundNeutron, G4PreCompoundHe3 - fixed
     30  usage of integer Z and A
     31
     3202-November 2010 V.Ivanchenko   hadr-pre-V09-03-14
     33---------------------------------------------------
     34- Fixed Coverity warnings - pedantic initialisation in constructors
     35
     3628-October 2010 V.Ivanchenko   hadr-pre-V09-03-13
     37---------------------------------------------------
     38G4PreCompoundModel - use more safe constructor of G4DynamicParticle
     39G4LowEIonFragmentation - complete transition to integar Z and A,
     40                         use of updated methods for G4Fragment
    1641
    174220-October 2010 V.Ivanchenko   hadr-pre-V09-03-12
  • trunk/source/processes/hadronic/models/qmd/History

    r1228 r1347  
    1313     * Please list in reverse chronological order (last date on top)
    1414     ---------------------------------------------------------------
     15
     1618-November-2010 Tatsumi Koi (hadr-qmd-V09-03-00)
     17- Enable RQMD
     18        include/G4QMDReaction.hh 
     19        src/G4QMDReaction.cc 
     20        include/G4QMDMeanField.hh
     21        src/G4QMDMeanField.cc
    1522
    162320-November-2009 Tatsumi Koi (hadr-qmd-V09-02-03)
  • trunk/source/processes/hadronic/models/qmd/include/G4QMDMeanField.hh

    r962 r1347  
    6060
    6161      G4double GetTotalPotential();
     62      G4double GetPotential( G4int );
    6263
    6364      void DoPropagation( G4double );
  • trunk/source/processes/hadronic/models/qmd/include/G4QMDReaction.hh

    r1228 r1347  
    7474      void EnableFermiG(){ heg = true; setHighEnergyModel(); };
    7575
     76      void SetTMAX( G4int i ){ maxTime = i; };
     77      void SetDT( G4double t ){ deltaT = t; };
     78      void SetEF( G4double x ){ envelopF = x; };
     79
    7680   private:
    7781
     
    8993      G4double deltaT;
    9094      G4int maxTime;
     95      G4double envelopF;
    9196
    9297      G4Evaporation* evaporation;
  • trunk/source/processes/hadronic/models/qmd/src/G4QMDMeanField.cc

    r962 r1347  
    392392      G4ThreeVector ri = system->GetParticipant( i )->GetPosition(); 
    393393      G4LorentzVector p4i = system->GetParticipant( i )->Get4Momentum(); 
    394      
     394
    395395      G4ThreeVector betai = p4i.v()/p4i.e();
    396396     
    397       ffr[i] = betai;
     397//    R-JQMD
     398      G4double Vi = GetPotential( i );
     399      G4double p_zero = std::sqrt( p4i.e()*p4i.e() + 2*p4i.m()*Vi);
     400      G4ThreeVector betai_R = p4i.v()/p_zero;
     401      G4double mi_R = p4i.m()/p_zero;
     402//
     403      ffr[i] = betai_R;
    398404      ffp[i] = G4ThreeVector( 0.0 );
     405
     406      if ( false )
     407      {
     408         ffr[i] = betai;
     409         mi_R = 1.0;
     410      }
    399411
    400412      for ( G4int j = 0 ; j < system->GetTotalNumberOfParticipant() ; j ++ )
     
    417429                           * ( 1. - 2. * std::abs( jcharge - icharge ) )
    418430                       + cl * rhc[j][i];
     431         ccpp *= mi_R;
    419432
    420433/*
     
    435448
    436449
    437            G4ThreeVector rij = ri - rj;   
    438            G4ThreeVector betaij =  ( p4i + p4j ).v()/eij;   
    439 
    440            G4ThreeVector cij = betaij - betai;   
    441 
    442            ffr[i] = ffr[i] + 2*ccrr* ( rij + grbb*cij );
     450         G4ThreeVector rij = ri - rj;   
     451         G4ThreeVector betaij =  ( p4i + p4j ).v()/eij;   
     452
     453         G4ThreeVector cij = betaij - betai;   
     454
     455         ffr[i] = ffr[i] + 2*ccrr* ( rij + grbb*cij );
    443456           
    444            ffp[i] = ffp[i] - 2*ccpp* ( rij + grbb*betaij );
     457         ffp[i] = ffp[i] - 2*ccpp* ( rij + grbb*betaij );
    445458
    446459      }
     
    450463   //std::cout << "gradu 1 " << ffr[1] << " " << ffp[1] << std::endl;
    451464
     465}
     466
     467
     468
     469G4double G4QMDMeanField::GetPotential( G4int i )
     470{
     471   G4int n = system->GetTotalNumberOfParticipant();
     472
     473   G4double rhoa = 0.0;
     474   G4double rho3 = 0.0;
     475   G4double rhos = 0.0;
     476   G4double rhoc = 0.0;
     477
     478
     479   G4int icharge = system->GetParticipant(i)->GetChargeInUnitOfEplus();
     480   G4int inuc = system->GetParticipant(i)->GetNuc();
     481
     482   for ( G4int j = 0 ; j < n ; j ++ )
     483   {
     484      G4int jcharge = system->GetParticipant(j)->GetChargeInUnitOfEplus();
     485      G4int jnuc = system->GetParticipant(j)->GetNuc();
     486
     487      rhoa += rha[j][i];
     488      rhoc += rhe[j][i];
     489      rhos += rha[j][i] * jnuc * inuc
     490                * ( 1 - 2 * std::abs ( jcharge - icharge ) );
     491   }
     492
     493   rho3 = std::pow ( rhoa , gamm );
     494
     495   G4double potential = c0 * rhoa
     496                      + c3 * rho3
     497                      + cs * rhos
     498                      + cl * rhoc;
     499
     500   return potential;
    452501}
    453502
  • trunk/source/processes/hadronic/models/qmd/src/G4QMDReaction.cc

    r1228 r1347  
    4343G4QMDReaction::G4QMDReaction()
    4444: system ( NULL )
    45 , deltaT ( 1 ) // in fsec
     45, deltaT ( 1 ) // in fsec (c=1)
    4646, maxTime ( 100 ) // will have maxTime-th time step
     47, envelopF ( 1.05 ) // 10% for Peripheral reactions
    4748, gem ( true )
    4849, frag ( false )
     
    155156
    156157// impact parameter
    157       G4double bmax = 1.05*(bmax_0/fermi);  // 10% for Peripheral reactions
     158      //G4double bmax = 1.05*(bmax_0/fermi);  // 10% for Peripheral reactions
     159      G4double bmax = envelopF*(bmax_0/fermi);
    158160      G4double b = bmax * std::sqrt ( G4UniformRand() );
    159161//071112
  • trunk/source/processes/hadronic/models/radioactive_decay/History

    r1340 r1347  
    1414     * Reverse chronological order (last date on top), please *
    1515     ----------------------------------------------------------
     1618 November 2010  F.Lei (radioactive_decay-V09-03-04)
     17- src/G4RadioactiveDecay.cc:1593 get rid of the compalition warning with gcc4.5.1
     18
     1917 November 2010  F.Lei (radioactive_decay-V09-03-03)
     20- Completed the implementation of generating the activity table in VR mode
     21- Set the default h-l threshold to 1 micros in VR mode.
     22- General improvement in VR mode implementation. 
     23- G4RadioactiveDecaymessenger.cc: icmCMD,armCMD & hlThreshold are available at all states.
     24
     2511 November 2010  F.Lei
     26- further updates to G4RadioactivityTable.hh .cc and G4RadioactiveDecay.hh .cc
     27
     2810 November 2010  Dennis Wright (radioactive_decay-V09-03-02)
     29-------------------------------------------------------------
     30- G4RadioactiveDecay.cc : replaced incorrect use of "->" with "." for G4Track
     31  in DecayIt(const G4Track&, )
     32
     33- G4RadioactivityTable.cc : add include file for <map> and replace map
     34  with std::map in method AddIsotope
     35
     3629 Oct 2010 F. Lei
     37------------------
     38- Added G4RadioactivityTable.hh .cc files for tallying the accumulated radioactivitties in VR mode
     39- Added in G4RadioactiveDecay.hh:
     40        std::vector<G4RadioactivityTable*> GetTheRadioactivityTables() {return theRadioactivityTables;}
     41        // this is how the radioactivity tables can be retrieved by the user
     42        std::vector<G4RadioactivityTable*>      theRadioactivityTables;
     43        std::map<G4int,G4int>             decayWindows;
     44- In G4RadioactiveDecay.cc:
     45        starting line 1291: changes need to setup the radioactivity tables
     46        line 1624: include the track weight in the weight calculation
     47        line 1627: add the rate to the radioactivity tables
     48- improved formatting of all the class files
     49       
    1650
    175111 Oct 2010 F. Lei (radioactive_decay-V09-03-01)
  • trunk/source/processes/hadronic/models/radioactive_decay/include/G4RadioactiveDecay.hh

    r1315 r1347  
    6161#include "G4RadioactiveDecayRateVector.hh"
    6262#include "G4RIsotopeTable.hh"
     63#include "G4RadioactivityTable.hh"
     64
    6365#include <vector>
     66
    6467
    6568//class G4UserlimitsForRD;
     
    7477class G4RadioactiveDecay : public G4VRestDiscreteProcess
    7578{
    76   // class description
    77  
    78   // Implementation of nuclear radioactive decay process.
    79   // It simulates the decays of radioactive nuclei, which is submitted to RDM in the form
    80   // of G4Ions. Half-liffe and decay schemes are hold in the Radioactivity database
    81   // All decay products are submitted back to the particle tracking process through
    82   // the G4ParticleChangeForRadDecay object.
    83 
    84   // class description - end
    85  
     79        // class description
     80
     81        // Implementation of nuclear radioactive decay process.
     82        // It simulates the decays of radioactive nuclei, which is submitted to RDM in the form
     83        // of G4Ions. Half-liffe and decay schemes are hold in the Radioactivity database
     84        // All decay products are submitted back to the particle tracking process through
     85        // the G4ParticleChangeForRadDecay object.
     86
     87        // class description - end
     88
    8689public: // with description
    8790
    88   G4RadioactiveDecay (const G4String& processName="RadioactiveDecay");
    89   ~G4RadioactiveDecay();
    90   // constructor and destructor
    91   //
    92 
    93   G4bool IsApplicable(const G4ParticleDefinition &);
    94   // Returns true if the specified isotope is
    95   //  1) defined as "nucleus" and
    96   //  2) it is within theNucleusLimit
    97   //
    98   G4bool IsLoaded (const G4ParticleDefinition &);
    99   // Returns true if the decay table of the specified nuclei is ready.
    100   //
    101   void SelectAVolume(const G4String aVolume);
    102   // Select a logical volume in which RDM applies.
    103   //
    104   void DeselectAVolume(const G4String aVolume);
    105   // remove a logical volume from the RDM applied list
    106   //
    107   void SelectAllVolumes();
    108   // Select all logical volumes for the application of RDM.
    109   //
    110   void DeselectAllVolumes();
    111   // Remove all logical volumes from RDM applications.
    112   //
    113   void SetDecayBias (G4String filename);
    114   //   Sets the decay biasing scheme using the data in "filename"
    115   //
    116   void SetHLThreshold (G4double hl) {halflifethreshold = hl;}
    117   // Set the half-life threshold for isomer production
    118   //
    119   void SetICM (G4bool icm) {applyICM = icm;}
    120   // Enable/disable ICM
    121   //
    122   void SetARM (G4bool arm) {applyARM = arm;}
    123   // Enable/disable ARM
    124   //
    125   void SetSourceTimeProfile (G4String filename) ;
    126   //  Sets source exposure function using histograms in "filename"
    127   //
    128   G4bool IsRateTableReady(const G4ParticleDefinition &);
    129   // Returns true if the coefficient and decay time table for all the
    130   // descendants of the specified isotope are ready.
    131   //
    132   // used in VR decay mode only
    133   //
    134   void AddDecayRateTable(const G4ParticleDefinition &);
    135   // Calculates the coefficient and decay time table for all the descendants
    136   // of the specified isotope.  Adds the calculated table to the private data
    137   // member "theDecayRateTableVector".
    138   //
    139   //
    140   // used in VR decay mode only
    141   //
    142   void GetDecayRateTable(const G4ParticleDefinition &);
    143   // Used to retrieve the coefficient and decay time table for all the
    144   // descendants of the specified isotope from "theDecayRateTableVector"
    145   // and place it in "theDecayRateTable".
    146   //
    147   //
    148   // used in VR decay mode only
    149   //
    150   void SetDecayRate(G4int,G4int,G4double, G4int, std::vector<G4double>,
    151                     std::vector<G4double>);
    152   // Sets "theDecayRate" with data supplied in the arguements.
    153   //
    154   //  //
    155   // used in VR decay mode only
    156   //
    157 
    158   G4DecayTable *LoadDecayTable (G4ParticleDefinition & theParentNucleus);
    159   // Load the decay data of isotope theParentNucleus.
    160   //
    161   inline void  SetVerboseLevel(G4int value) {verboseLevel = value;}
    162   // Sets the VerboseLevel which controls duggering display.
    163   //
    164   inline G4int GetVerboseLevel() const {return verboseLevel;}
    165   // Returns the VerboseLevel which controls level of debugging output.
    166   //
    167   inline void SetNucleusLimits(G4NucleusLimits theNucleusLimits1)
    168   {theNucleusLimits = theNucleusLimits1 ;}
    169   //  Sets theNucleusLimits which specifies the range of isotopes
    170   //  the G4RadioactiveDecay applies.
    171   //
    172   inline G4NucleusLimits GetNucleusLimits() const
    173   {return theNucleusLimits;}
    174   //  Returns theNucleusLimits which specifies the range of isotopes
    175   //  the G4RadioactiveDecay applies.
    176   //
    177   inline void SetAnalogueMonteCarlo (G4bool r ) { AnalogueMC  = r; }
    178   //   Controls whether G4RadioactiveDecay runs in analogue mode or
    179   //   variance reduction mode.
    180   inline void SetFBeta (G4bool r ) { FBeta  = r; }
    181   //   Controls whether G4RadioactiveDecay uses fast beta simulation mode
    182   //
    183   inline G4bool IsAnalogueMonteCarlo () {return AnalogueMC;}
    184   //   Returns true if the simulation is an analogue Monte Carlo, and false if
    185   //   any of the biassing schemes have been selected.
    186   //
    187   inline void SetBRBias (G4bool r ) { BRBias  = r;
    188   SetAnalogueMonteCarlo(0);}
    189   //   Sets whether branching ration bias scheme applies.
    190   //
    191   inline void SetSplitNuclei (G4int r) { NSplit = r; SetAnalogueMonteCarlo(0); }
    192   //  Sets the N number for the Nuclei spliting bias scheme
    193   //
    194   inline G4int GetSplitNuclei () {return NSplit;}
    195   //  Returns the N number used for the Nuclei spliting bias scheme
    196   //
     91        G4RadioactiveDecay (const G4String& processName="RadioactiveDecay");
     92        ~G4RadioactiveDecay();
     93        // constructor and destructor
     94        //
     95
     96        G4bool IsApplicable(const G4ParticleDefinition &);
     97        // Returns true if the specified isotope is
     98        //  1) defined as "nucleus" and
     99        //  2) it is within theNucleusLimit
     100        //
     101        G4bool IsLoaded (const G4ParticleDefinition &);
     102        // Returns true if the decay table of the specified nuclei is ready.
     103        //
     104        void SelectAVolume(const G4String aVolume);
     105        // Select a logical volume in which RDM applies.
     106        //
     107        void DeselectAVolume(const G4String aVolume);
     108        // remove a logical volume from the RDM applied list
     109        //
     110        void SelectAllVolumes();
     111        // Select all logical volumes for the application of RDM.
     112        //
     113        void DeselectAllVolumes();
     114        // Remove all logical volumes from RDM applications.
     115        //
     116        void SetDecayBias (G4String filename);
     117        //   Sets the decay biasing scheme using the data in "filename"
     118        //
     119        void SetHLThreshold (G4double hl) {halflifethreshold = hl;}
     120        // Set the half-life threshold for isomer production
     121        //
     122        void SetICM (G4bool icm) {applyICM = icm;}
     123        // Enable/disable ICM
     124        //
     125        void SetARM (G4bool arm) {applyARM = arm;}
     126        // Enable/disable ARM
     127        //
     128        void SetSourceTimeProfile (G4String filename) ;
     129        //  Sets source exposure function using histograms in "filename"
     130        //
     131        G4bool IsRateTableReady(const G4ParticleDefinition &);
     132        // Returns true if the coefficient and decay time table for all the
     133        // descendants of the specified isotope are ready.
     134        //
     135        // used in VR decay mode only
     136        //
     137        void AddDecayRateTable(const G4ParticleDefinition &);
     138        // Calculates the coefficient and decay time table for all the descendants
     139        // of the specified isotope.  Adds the calculated table to the private data
     140        // member "theDecayRateTableVector".
     141        //
     142        //
     143        // used in VR decay mode only
     144        //
     145        void GetDecayRateTable(const G4ParticleDefinition &);
     146        // Used to retrieve the coefficient and decay time table for all the
     147        // descendants of the specified isotope from "theDecayRateTableVector"
     148        // and place it in "theDecayRateTable".
     149        //
     150        //
     151        // used in VR decay mode only
     152        //
     153        void SetDecayRate(G4int,G4int,G4double, G4int, std::vector<G4double>,
     154                std::vector<G4double>);
     155        // Sets "theDecayRate" with data supplied in the arguements.
     156        //
     157        //  //
     158        // used in VR decay mode only
     159        //
     160
     161        std::vector<G4RadioactivityTable*> GetTheRadioactivityTables() {return theRadioactivityTables;}
     162        // return the vector of G4Radioactivity map
     163        // should be used in VR mode only
     164
     165        G4DecayTable *LoadDecayTable (G4ParticleDefinition & theParentNucleus);
     166        // Load the decay data of isotope theParentNucleus.
     167        //
     168        inline void  SetVerboseLevel(G4int value) {verboseLevel = value;}
     169        // Sets the VerboseLevel which controls duggering display.
     170        //
     171        inline G4int GetVerboseLevel() const {return verboseLevel;}
     172        // Returns the VerboseLevel which controls level of debugging output.
     173        //
     174        inline void SetNucleusLimits(G4NucleusLimits theNucleusLimits1)
     175        {theNucleusLimits = theNucleusLimits1 ;}
     176        //  Sets theNucleusLimits which specifies the range of isotopes
     177        //  the G4RadioactiveDecay applies.
     178        //
     179        inline G4NucleusLimits GetNucleusLimits() const
     180        {return theNucleusLimits;}
     181        //  Returns theNucleusLimits which specifies the range of isotopes
     182        //  the G4RadioactiveDecay applies.
     183        //
     184        inline void SetAnalogueMonteCarlo (G4bool r ) {
     185          AnalogueMC  = r;
     186          if (!AnalogueMC) halflifethreshold = 1e-6*s;
     187        }
     188        //   Controls whether G4RadioactiveDecay runs in analogue mode or
     189        //   variance reduction mode.
     190        inline void SetFBeta (G4bool r ) { FBeta  = r; }
     191        //   Controls whether G4RadioactiveDecay uses fast beta simulation mode
     192        //
     193        inline G4bool IsAnalogueMonteCarlo () {return AnalogueMC;}
     194        //   Returns true if the simulation is an analogue Monte Carlo, and false if
     195        //   any of the biassing schemes have been selected.
     196        //
     197        inline void SetBRBias (G4bool r ) { BRBias  = r;
     198        SetAnalogueMonteCarlo(0);}
     199        //   Sets whether branching ration bias scheme applies.
     200        //
     201        inline void SetSplitNuclei (G4int r) { NSplit = r; SetAnalogueMonteCarlo(0); }
     202        //  Sets the N number for the Nuclei spliting bias scheme
     203        //
     204        inline G4int GetSplitNuclei () {return NSplit;}
     205        //  Returns the N number used for the Nuclei spliting bias scheme
     206        //
    197207public:
    198  
    199   void BuildPhysicsTable(const G4ParticleDefinition &);
     208
     209        void BuildPhysicsTable(const G4ParticleDefinition &);
    200210
    201211protected:
    202212
    203   G4VParticleChange* DecayIt( const G4Track& theTrack,
    204                               const G4Step&  theStep);
    205 
    206   G4DecayProducts* DoDecay(G4ParticleDefinition& theParticleDef);
    207 
    208   G4double GetMeanFreePath(const G4Track& theTrack,
    209                            G4double previousStepSize,
    210                            G4ForceCondition* condition);
    211 
    212   G4double GetMeanLifeTime(const G4Track& theTrack,
    213                            G4ForceCondition* condition);
    214 
    215   G4double GetTaoTime(G4double,G4double);
    216 
    217   G4double GetDecayTime();
    218 
    219   G4int GetDecayTimeBin(const G4double aDecayTime);
     213        G4VParticleChange* DecayIt( const G4Track& theTrack,
     214                const G4Step&  theStep);
     215
     216        G4DecayProducts* DoDecay(G4ParticleDefinition& theParticleDef);
     217
     218        G4double GetMeanFreePath(const G4Track& theTrack,
     219                G4double previousStepSize,
     220                G4ForceCondition* condition);
     221
     222        G4double GetMeanLifeTime(const G4Track& theTrack,
     223                G4ForceCondition* condition);
     224
     225        G4double GetTaoTime(G4double,G4double);
     226
     227        G4double GetDecayTime();
     228
     229        G4int GetDecayTimeBin(const G4double aDecayTime);
    220230
    221231private:
    222232
    223   G4RadioactiveDecay(const G4RadioactiveDecay &right);
    224   G4RadioactiveDecay & operator=(const G4RadioactiveDecay &right);
     233        G4RadioactiveDecay(const G4RadioactiveDecay &right);
     234        G4RadioactiveDecay & operator=(const G4RadioactiveDecay &right);
    225235
    226236private:
    227237
    228   G4RadioactiveDecaymessenger  *theRadioactiveDecaymessenger;
    229 
    230   G4PhysicsTable               *aPhysicsTable;
    231 
    232   G4RIsotopeTable              *theIsotopeTable;
    233 
    234   G4NucleusLimits               theNucleusLimits;
    235 
    236   const G4double                HighestBinValue;
    237   const G4double                LowestBinValue;
    238 
    239   const G4int                   TotBin;
    240 
    241   G4bool                        AnalogueMC;
    242   G4bool                        BRBias;
    243   G4bool                        FBeta;
    244   G4int                         NSplit;
    245 
    246   G4double                      halflifethreshold;
    247   G4bool                        applyICM;
    248   G4bool                        applyARM;
    249 
    250   G4int                         NSourceBin;
    251   G4double                      SBin[99];
    252   G4double                      SProfile[99];
    253 
    254   G4int                         NDecayBin;
    255   G4double                      DBin[99];
    256   G4double                      DProfile[99];
    257 
    258   std::vector<G4String>         LoadedNuclei;
    259   std::vector<G4String>         ValidVolumes;
    260 
    261   G4RadioactiveDecayRate        theDecayRate;
    262   G4RadioactiveDecayRates       theDecayRateVector;
    263   G4RadioactiveDecayRateVector  theDecayRateTable;
    264   G4RadioactiveDecayRateTable   theDecayRateTableVector;
    265 
    266   static const G4double         levelTolerance;
    267 
    268   // Remainder of life time at rest
    269   G4double                      fRemainderLifeTime;
    270 
    271   G4int                         verboseLevel;
    272 
    273 
    274   // ParticleChange for decay process
    275   G4ParticleChangeForRadDecay   fParticleChangeForRadDecay;
    276 
    277   inline G4double AtRestGetPhysicalInteractionLength
    278     (const G4Track& track, G4ForceCondition* condition)
    279   {fRemainderLifeTime = G4VRestDiscreteProcess::
    280     AtRestGetPhysicalInteractionLength(track, condition );
    281   return fRemainderLifeTime;}
    282 
    283   inline G4VParticleChange* AtRestDoIt
    284     (const G4Track& theTrack, const G4Step& theStep)
    285   {return DecayIt(theTrack, theStep);}
    286 
    287   inline G4VParticleChange* PostStepDoIt
    288     (const G4Track& theTrack, const G4Step& theStep)
    289   {return DecayIt(theTrack, theStep);}
     238        G4RadioactiveDecaymessenger  *theRadioactiveDecaymessenger;
     239
     240        G4PhysicsTable               *aPhysicsTable;
     241
     242        G4RIsotopeTable              *theIsotopeTable;
     243
     244        G4NucleusLimits               theNucleusLimits;
     245
     246        const G4double                HighestBinValue;
     247        const G4double                LowestBinValue;
     248
     249        const G4int                   TotBin;
     250
     251        G4bool                        AnalogueMC;
     252        G4bool                        BRBias;
     253        G4bool                        FBeta;
     254        G4int                         NSplit;
     255
     256        G4double                      halflifethreshold;
     257        G4bool                        applyICM;
     258        G4bool                        applyARM;
     259
     260        G4int                         NSourceBin;
     261        G4double                      SBin[99];
     262        G4double                      SProfile[99];
     263
     264        G4int                         NDecayBin;
     265        G4double                      DBin[99];
     266        G4double                      DProfile[99];
     267
     268        std::vector<G4String>         LoadedNuclei;
     269        std::vector<G4String>         ValidVolumes;
     270
     271        G4RadioactiveDecayRate        theDecayRate;
     272        G4RadioactiveDecayRates       theDecayRateVector;
     273        G4RadioactiveDecayRateVector  theDecayRateTable;
     274        G4RadioactiveDecayRateTable   theDecayRateTableVector;
     275
     276        // for the radioactivity tables
     277        std::vector<G4RadioactivityTable*>      theRadioactivityTables;
     278        G4int                         decayWindows[99];
     279
     280        //
     281        static const G4double             levelTolerance;
     282
     283        // Remainder of life time at rest
     284        G4double                      fRemainderLifeTime;
     285
     286        G4int                         verboseLevel;
     287
     288
     289        // ParticleChange for decay process
     290        G4ParticleChangeForRadDecay   fParticleChangeForRadDecay;
     291
     292        inline G4double AtRestGetPhysicalInteractionLength
     293                (const G4Track& track, G4ForceCondition* condition)
     294        {fRemainderLifeTime = G4VRestDiscreteProcess::
     295        AtRestGetPhysicalInteractionLength(track, condition );
     296        return fRemainderLifeTime;}
     297
     298        inline G4VParticleChange* AtRestDoIt
     299                (const G4Track& theTrack, const G4Step& theStep)
     300        {return DecayIt(theTrack, theStep);}
     301
     302        inline G4VParticleChange* PostStepDoIt
     303                (const G4Track& theTrack, const G4Step& theStep)
     304        {return DecayIt(theTrack, theStep);}
    290305
    291306};
  • trunk/source/processes/hadronic/models/radioactive_decay/src/G4RadioactiveDecay.cc

    r1340 r1347  
    121121// Constructor
    122122//
    123 G4RadioactiveDecay::G4RadioactiveDecay
    124   (const G4String& processName)
    125   :G4VRestDiscreteProcess(processName, fDecay), HighestBinValue(10.0),
    126    LowestBinValue(1.0e-3), TotBin(200), verboseLevel(0)
     123G4RadioactiveDecay::G4RadioactiveDecay (const G4String& processName)
     124 :G4VRestDiscreteProcess(processName, fDecay), HighestBinValue(10.0),
     125  LowestBinValue(1.0e-3), TotBin(200), verboseLevel(0)
    127126{
    128127#ifdef G4VERBOSE
     
    136135  aPhysicsTable                = 0;
    137136  pParticleChange              = &fParticleChangeForRadDecay;
    138  
     137
    139138  //
    140139  // Now register the Isotopetable with G4IonTable.
     
    156155  NSourceBin  = 1;
    157156  SBin[0]     = 0.* s;
    158   SBin[1]     = 1e10 * s;
     157  SBin[1]     = 1.* s;
    159158  SProfile[0] = 1.;
    160   SProfile[1] = 1.;
     159  SProfile[1] = 0.;
    161160  NDecayBin   = 1;
    162   DBin[0]     = 9.9e9 * s ;
    163   DBin[1]     = 1e10 * s;
     161  DBin[0]     = 0. * s ;
     162  DBin[1]     = 1. * s;
    164163  DProfile[0] = 1.;
    165164  DProfile[1] = 0.;
     165  decayWindows[0] = 0;
     166  G4RadioactivityTable* rTable = new G4RadioactivityTable() ;
     167  theRadioactivityTables.push_back(rTable);
    166168  NSplit      = 1;
    167169  AnalogueMC  = true ;
     
    187189      delete aPhysicsTable;
    188190    }
    189   //  delete theIsotopeTable;
    190   delete theRadioactiveDecaymessenger;
     191  //    delete theIsotopeTable;
     192    delete theRadioactiveDecaymessenger;
    191193}
    192194
     
    197199//
    198200G4bool G4RadioactiveDecay::IsApplicable( const G4ParticleDefinition &
    199   aParticle)
     201                                        aParticle)
    200202{
    201203  //
     
    224226//
    225227G4bool G4RadioactiveDecay::IsLoaded(const G4ParticleDefinition &
    226   aParticle)
     228                                    aParticle)
    227229{
    228230  //
     
    232234  //
    233235  return std::binary_search(LoadedNuclei.begin(),
    234                        LoadedNuclei.end(),
    235                        aParticle.GetParticleName());
     236                            LoadedNuclei.end(),
     237                            aParticle.GetParticleName());
    236238}
    237239////////////////////////////////////////////////////////////////////////////////
     
    242244void G4RadioactiveDecay::SelectAVolume(const G4String aVolume)
    243245{
    244  
     246
    245247  G4LogicalVolumeStore *theLogicalVolumes;
    246248  G4LogicalVolume *volume;
     
    331333    G4cout << " RDM removed from all volumes" << G4endl;
    332334#endif
    333  
     335
    334336}
    335337
     
    340342//
    341343G4bool G4RadioactiveDecay::IsRateTableReady(const G4ParticleDefinition &
    342   aParticle)
     344                                            aParticle)
    343345{
    344346  //
     
    351353    {
    352354      if (theDecayRateTableVector[i].GetIonName() == aParticleName)
    353         return true ;
     355        return true ;
    354356    }
    355357  return false;
     
    363365//
    364366void G4RadioactiveDecay::GetDecayRateTable(const G4ParticleDefinition &
    365   aParticle)
     367                                           aParticle)
    366368{
    367369
     
    376378    }
    377379#ifdef G4VERBOSE
    378         if (GetVerboseLevel()>0)
    379           {
    380             G4cout <<"The DecayRate Table for "
    381                    << aParticleName << " is selected." <<  G4endl;
    382           }
     380  if (GetVerboseLevel()>0)
     381    {
     382      G4cout <<"The DecayRate Table for "
     383             << aParticleName << " is selected." <<  G4endl;
     384    }
    383385#endif
    384386}
     
    388390// GetTaoTime
    389391//
    390 // to perform the convilution of the sourcetimeprofile function with the
     392// to perform the convolution of the source time profile function with the
    391393// decay constants in the decay chain.
    392394//
     
    408410  }
    409411  taotime +=  SProfile[nbin] * (1-std::exp(-(t-SBin[nbin])/tao));
     412  if (taotime < 0.)  {
     413    G4cout <<" Tao time: " <<taotime << " reset to zero!"<<G4endl;
     414    taotime = 0.;
     415  }
     416
    410417#ifdef G4VERBOSE
    411418  if (GetVerboseLevel()>1)
    412419    {G4cout <<" Tao time: " <<taotime <<G4endl;}
    413420#endif
    414   return  taotime ;
    415 }
    416  
     421  return taotime ;
     422}
     423
    417424////////////////////////////////////////////////////////////////////////////////
    418425//
     
    433440#ifdef G4VERBOSE
    434441  if (GetVerboseLevel()>1)
    435     {G4cout <<" Decay time: " <<decaytime <<"[ns]" <<G4endl;}
     442    {G4cout <<" Decay time: " <<decaytime/s <<"[s]" <<G4endl;}
    436443#endif
    437444  return  decaytime;       
     
    447454G4int G4RadioactiveDecay::GetDecayTimeBin(const G4double aDecayTime)
    448455{
    449   for (G4int i = 0; i < NDecayBin; i++)
    450     {
    451       if ( aDecayTime > DBin[i]) return i+1;     
    452     }
    453   return  1;
     456  G4int i = 0;
     457  while ( aDecayTime > DBin[i] ) i++;
     458  return  i;
    454459}
    455460////////////////////////////////////////////////////////////////////////////////
     
    472477    G4ParticleDefinition* theParticleDef = theParticle->GetDefinition();
    473478    G4double theLife = theParticleDef->GetPDGLifeTime();
    474      
     479
    475480#ifdef G4VERBOSE
    476481    if (GetVerboseLevel()>2)
     
    485490    else if (theLife < 0.0) {meanlife = DBL_MAX;}
    486491    else {meanlife = theLife;}
    487   // set the meanlife to zero for excited istopes which is not in the RDM database
     492    // set the meanlife to zero for excited istopes which is not in the RDM database
    488493    if (((const G4Ions*)(theParticleDef))->GetExcitationEnergy() > 0. && meanlife == DBL_MAX) {meanlife = 0.;}
    489494  }
    490495#ifdef G4VERBOSE
    491496  if (GetVerboseLevel()>1)
    492     {G4cout <<"mean life time: " <<meanlife <<"[ns]" <<G4endl;}
    493 #endif
    494  
     497    {G4cout <<"mean life time: " <<meanlife/s <<"[s]" <<G4endl;}
     498#endif
     499
    495500  return  meanlife;
    496501}
     
    507512  // constants
    508513  G4bool isOutRange ;
    509  
     514
    510515  // get particle
    511516  const G4DynamicParticle* aParticle = aTrack.GetDynamicParticle();
    512  
     517
    513518  // returns the mean free path in GEANT4 internal units
    514519  G4double pathlength;
     
    516521  G4double aCtau = c_light * aParticleDef->GetPDGLifeTime();
    517522  G4double aMass = aParticle->GetMass();
    518  
     523
    519524#ifdef G4VERBOSE
    520525  if (GetVerboseLevel()>2) {
     
    525530  }
    526531#endif
    527  
     532
    528533  // check if the particle is stable?
    529534  if (aParticleDef->GetPDGStable()) {
    530535    pathlength = DBL_MAX;
    531    
     536
    532537  } else if (aCtau < 0.0) {
    533538    pathlength =  DBL_MAX;
    534    
     539
    535540    //check if the particle has very short life time ?
    536541  } else if (aCtau < DBL_MIN) {
    537542    pathlength =  DBL_MIN;
    538    
     543
    539544    //check if zero mass
    540545  } else if (aMass <  DBL_MIN)  {
     
    545550    }
    546551#endif
    547    } else {
    548      //calculate the mean free path
    549      // by using normalized kinetic energy (= Ekin/mass)
    550      G4double   rKineticEnergy = aParticle->GetKineticEnergy()/aMass;
    551      if ( rKineticEnergy > HighestBinValue) {
    552        // beta >> 1
    553        pathlength = ( rKineticEnergy + 1.0)* aCtau;
    554      } else if ( rKineticEnergy > LowestBinValue) {
    555        // check if aPhysicsTable exists
    556        if (aPhysicsTable == 0) BuildPhysicsTable(*aParticleDef);
    557        // beta is in the range valid for PhysicsTable
    558        pathlength = aCtau *
    559          ((*aPhysicsTable)(0))-> GetValue(rKineticEnergy,isOutRange);
    560      } else if ( rKineticEnergy < DBL_MIN ) {
    561        // too slow particle
    562 #ifdef G4VERBOSE
    563        if (GetVerboseLevel()>2) {
    564          G4cout << "G4Decay::GetMeanFreePath()   !!particle stops!!";
    565          G4cout << aParticleDef->GetParticleName() << G4endl;
    566          G4cout << "KineticEnergy:" << aParticle->GetKineticEnergy()/GeV <<"[GeV]";
    567        }
    568 #endif
    569        pathlength = DBL_MIN;
    570      } else {
    571        // beta << 1
    572        pathlength = (aParticle->GetTotalMomentum())/aMass*aCtau ;
    573      }
    574    }
    575 #ifdef G4VERBOSE
    576    if (GetVerboseLevel()>1) {
    577      G4cout << "mean free path: "<< pathlength/m << "[m]" << G4endl;
    578    }
    579 #endif
    580    return  pathlength;
     552  } else {
     553    //calculate the mean free path
     554    // by using normalized kinetic energy (= Ekin/mass)
     555    G4double   rKineticEnergy = aParticle->GetKineticEnergy()/aMass;
     556    if ( rKineticEnergy > HighestBinValue) {
     557      // beta >> 1
     558      pathlength = ( rKineticEnergy + 1.0)* aCtau;
     559    } else if ( rKineticEnergy > LowestBinValue) {
     560      // check if aPhysicsTable exists
     561      if (aPhysicsTable == 0) BuildPhysicsTable(*aParticleDef);
     562      // beta is in the range valid for PhysicsTable
     563      pathlength = aCtau *
     564        ((*aPhysicsTable)(0))-> GetValue(rKineticEnergy,isOutRange);
     565    } else if ( rKineticEnergy < DBL_MIN ) {
     566      // too slow particle
     567#ifdef G4VERBOSE
     568      if (GetVerboseLevel()>2) {
     569        G4cout << "G4Decay::GetMeanFreePath()   !!particle stops!!";
     570        G4cout << aParticleDef->GetParticleName() << G4endl;
     571        G4cout << "KineticEnergy:" << aParticle->GetKineticEnergy()/GeV <<"[GeV]";
     572      }
     573#endif
     574      pathlength = DBL_MIN;
     575    } else {
     576      // beta << 1
     577      pathlength = (aParticle->GetTotalMomentum())/aMass*aCtau ;
     578    }
     579  }
     580#ifdef G4VERBOSE
     581  if (GetVerboseLevel()>1) {
     582    G4cout << "mean free path: "<< pathlength/m << "[m]" << G4endl;
     583  }
     584#endif
     585  return  pathlength;
    581586}
    582587////////////////////////////////////////////////////////////////////////////////
     
    604609  G4int i;
    605610  for ( i = 0 ; i < TotBin ; i++ ) {
    606       gammainv = 1.0/(aVector->GetLowEdgeEnergy(i) + 1.0);
    607       beta  = std::sqrt((1.0 - gammainv)*(1.0 +gammainv));
    608       aVector->PutValue(i, beta/gammainv);
     611    gammainv = 1.0/(aVector->GetLowEdgeEnergy(i) + 1.0);
     612    beta  = std::sqrt((1.0 - gammainv)*(1.0 +gammainv));
     613    aVector->PutValue(i, beta/gammainv);
    609614  }
    610615  aPhysicsTable->insert(aVector);
     
    636641    G4cout << "Please setenv G4RADIOACTIVEDATA to point to the radioactive decay data files." << G4endl;
    637642    throw G4HadronicException(__FILE__, __LINE__,
    638               "Please setenv G4RADIOACTIVEDATA to point to the radioactive decay data files.");
     643                              "Please setenv G4RADIOACTIVEDATA to point to the radioactive decay data files.");
    639644  }
    640645  G4String dirName = getenv("G4RADIOACTIVEDATA");
     
    647652  G4String file = os.str();
    648653
    649  
     654
    650655  std::ifstream DecaySchemeFile(file);
    651656  G4bool found(false);
     
    664669      modeSumBR[i]       = 0.0;
    665670    }
    666    
     671
    667672    G4bool complete(false);
    668673    char inputChars[80]={' '};
     
    718723            a/=1000.;
    719724            c/=1000.;
    720                  
     725
    721726            //  cout<< "The decay mode is [LoadTable] "<<theDecayMode<<G4endl;
    722                  
     727
    723728            switch (theDecayMode) {
    724729            case IT:
     
    750755                    e0 = c*MeV/0.511;
    751756                    n = aBetaFermiFunction->GetFFN(e0);
    752                                
     757
    753758                    // now to work out the histogram and initialise the random generator
    754759                    G4int npti = 100;                           
     
    765770                      // Special treatment for K-40 (problem #1068) (flei,06/05/2010)
    766771                      if (theParentNucleus.GetParticleName() == "K40[0.0]") f *=
    767                         (std::pow((g*g-1),3)+std::pow((ee-g),6)+7*(g*g-1)*std::pow((ee-g),2)*(g*g-1+std::pow((ee-g),2)));
     772                                                                              (std::pow((g*g-1),3)+std::pow((ee-g),6)+7*(g*g-1)*std::pow((ee-g),2)*(g*g-1+std::pow((ee-g),2)));
    768773                      pdf[ptn] = f*aBetaFermiFunction->GetFF(e);
    769774                    }             
     
    798803                  if (e0 > 0.) {
    799804                    G4BetaFermiFunction* aBetaFermiFunction = new G4BetaFermiFunction (A, -(Z-1));
    800                                
     805
    801806                    n = aBetaFermiFunction->GetFFN(e0);
    802                                
     807
    803808                    // now to work out the histogram and initialise the random generator
    804809                    G4int npti = 100;                           
     
    824829                    theDecayTable->Insert(aBetaPlusChannel);
    825830                    modeSumBR[2] += b;
    826                                
     831
    827832                    delete[] pdf;
    828833                    delete aBetaFermiFunction;       
     
    909914                G4Exception("G4RadioactiveDecay::LoadDecayTable()", "601",
    910915                            FatalException, "Error in decay mode selection");
    911                
     916
    912917              }
    913918            }
     
    972977//
    973978void G4RadioactiveDecay::SetDecayRate(G4int theZ, G4int theA, G4double theE,
    974                                        G4int theG, std::vector<G4double> theRates,
    975                                        std::vector<G4double> theTaos)
     979                                      G4int theG, std::vector<G4double> theRates,
     980                                      std::vector<G4double> theTaos)
    976981{
    977982  //fill the decay rate vector
     
    993998  // 2) Add the coefficiencies to the decay rate table vector
    994999  //
    995  
     1000
    9961001  //
    9971002  // Create and initialise variables used in the method.
     
    9991004
    10001005  theDecayRateVector.clear();
    1001  
     1006
    10021007  G4int nGeneration = 0;
    10031008  std::vector<G4double> rates;
    10041009  std::vector<G4double> taos;
    1005  
     1010
    10061011  // start rate is -1.
     1012  // Eq.4.26 of the Technical Note
    10071013  rates.push_back(-1.);
    10081014  //
     
    10121018  G4double E = ((const G4Ions*)(&theParentNucleus))->GetExcitationEnergy();
    10131019  G4double tao = theParentNucleus.GetPDGLifeTime();
     1020  if (tao < 0.) tao = 1e-30;
    10141021  taos.push_back(tao);
    10151022  G4int nEntry = 0;
    1016  
     1023
    10171024  //fill the decay rate with the intial isotope data
    10181025  SetDecayRate(Z,A,E,nGeneration,rates,taos);
     
    10341041  G4AlphaDecayChannel *theAlphaChannel = 0;
    10351042  G4RadioactiveDecayMode theDecayMode;
    1036   //  G4NuclearLevelManager levelManager;
    1037   //const G4NuclearLevel* level;
    10381043  G4double theBR = 0.0;
    10391044  G4int AP = 0;
     
    10561061  //
    10571062  theIonTable = (G4IonTable *)(G4ParticleTable::GetParticleTable()->GetIonTable());
    1058  
     1063
    10591064  while (!stable) {
    10601065    nGeneration++;
     
    10771082        aParentNucleus->SetDecayTable(LoadDecayTable(*aParentNucleus));
    10781083      }
     1084       
     1085      G4DecayTable *theDecayTable = new G4DecayTable();
    10791086      aTempDecayTable = aParentNucleus->GetDecayTable();
     1087      for (i=0; i< 7; i++) brs[i] = 0.0;
     1088
    10801089      //
    10811090      //
    10821091      // Go through the decay table and to combine the same decay channels
    10831092      //
    1084       for (i=0; i< 7; i++) brs[i] = 0.0;
    1085      
    1086       G4DecayTable *theDecayTable = new G4DecayTable();
    1087      
    10881093      for (i=0; i<aTempDecayTable->entries(); i++) {
    10891094        theChannel             = aTempDecayTable->GetDecayChannel(i);
     
    10991104
    11001105          if (std::abs(daughterExcitation - level->Energy()) < levelTolerance) {
    1101            
    1102             // Level hafe life is in ns and the gate as 1 micros by default
    1103             if ( theDecayMode == 0 && level->HalfLife()*ns >= halflifethreshold ){   
    1104               // some further though may needed here
     1106            // Level half-life is in ns and the threshold is set to 1 micros by default, user can set it via the UI command
     1107            if (level->HalfLife()*ns >= halflifethreshold ){   
     1108              // save the metastable nucleus
    11051109              theDecayTable->Insert(theChannel);
    11061110            }
     
    11201124      brs[3] = brs[4] =brs[5] =  0.0;
    11211125      for (i= 0; i<7; i++){
    1122         if (brs[i] > 0) {
     1126        if (brs[i] > 0.) {
    11231127          switch ( i ) {
    11241128          case 0:
     
    11271131            // Decay mode is isomeric transition.
    11281132            //
    1129            
     1133
    11301134            theITChannel =  new G4ITDecayChannel
    11311135              (0, (const G4Ions*) aParentNucleus, brs[0]);
    1132            
     1136
    11331137            theDecayTable->Insert(theITChannel);
    11341138            break;
    1135            
     1139
    11361140          case 1:
    11371141            //
     
    11421146                                                               brs[1], 0.*MeV, 0.*MeV, 1, false, 0);
    11431147            theDecayTable->Insert(theBetaMinusChannel);
    1144            
     1148
    11451149            break;
    1146            
     1150
    11471151          case 2:
    11481152            //
     
    11541158            theDecayTable->Insert(theBetaPlusChannel);
    11551159            break;                   
    1156            
     1160
    11571161          case 6:
    11581162            //
     
    11641168            theDecayTable->Insert(theAlphaChannel);
    11651169            break;
    1166            
     1170
    11671171          default:
    11681172            break;
     
    11701174        }
    11711175      }
    1172        
    11731176      //
    11741177      // loop over all braches in theDecayTable
     
    11791182        theBR = theChannel->GetBR();
    11801183        theDaughterNucleus = theNuclearDecayChannel->GetDaughterNucleus();
    1181        
    1182         //
    1183         // now test if the daughterNucleus is a valid one
    1184         //
    1185         if (IsApplicable(*theDaughterNucleus) && theBR
    1186             && aParentNucleus != theDaughterNucleus ) {
     1184        //  first check if the decay of the original nucleus is an IT channel, if true create a new groud-level nucleus
     1185        if (theNuclearDecayChannel->GetDecayMode() == IT && nGeneration == 1 ) {
     1186            A = ((const G4Ions*)(theDaughterNucleus))->GetAtomicMass();
     1187            Z = ((const G4Ions*)(theDaughterNucleus))->GetAtomicNumber();
     1188            theDaughterNucleus=theIonTable->GetIon(Z,A,0.);
     1189        }
     1190        if (IsApplicable(*theDaughterNucleus) && theBR && aParentNucleus != theDaughterNucleus) {
    11871191          // need to make sure daugher has decaytable
    11881192          if (!IsLoaded(*theDaughterNucleus)){
     
    11941198            Z = ((const G4Ions*)(theDaughterNucleus))->GetAtomicNumber();
    11951199            E = ((const G4Ions*)(theDaughterNucleus))->GetExcitationEnergy();
    1196          
     1200
    11971201            TaoPlus = theDaughterNucleus->GetPDGLifeTime();
    11981202            //          cout << TaoPlus <<G4endl;
    1199             if (TaoPlus > 0.) {
    1200               // first set the taos, one simply need to add to the parent ones
    1201               taos.clear();
    1202               taos = TP;
    1203               taos.push_back(TaoPlus);
    1204               // now calculate the coefficiencies
    1205               //
    1206               // they are in two parts, first the les than n ones
    1207               rates.clear();
    1208               size_t k;
    1209               for (k = 0; k < RP.size(); k++){
     1203            if (TaoPlus <= 0.)  TaoPlus = 1e-30;
     1204
     1205            // first set the taos, one simply need to add to the parent ones
     1206            taos.clear();
     1207            taos = TP;
     1208            taos.push_back(TaoPlus);
     1209            // now calculate the coefficiencies
     1210            //
     1211            // they are in two parts, first the less than n ones
     1212            // Eq 4.24 of the TN
     1213            rates.clear();
     1214            size_t k;
     1215            for (k = 0; k < RP.size(); k++){
     1216              if ((TP[k]-TaoPlus) == 0.) {
     1217                theRate =  1e30;
     1218              } else {
    12101219                theRate = TP[k]/(TP[k]-TaoPlus) * theBR * RP[k];
    1211                 rates.push_back(theRate);
    12121220              }
    1213               //
    1214               // the sencond part: the n:n coefficiency
    1215               theRate = 0.;
    1216               for (k = 0; k < RP.size(); k++){
    1217                 theRate -=TaoPlus/(TP[k]-TaoPlus) * theBR * RP[k];
     1221              rates.push_back(theRate);
     1222            }
     1223            //
     1224            // the sencond part: the n:n coefficiency
     1225            // Eq 4.25 of the TN.  Note Yn+1 is zero apart from Y1 which is -1 as treated at line 1013
     1226            //
     1227            theRate = 0.;
     1228            G4double aRate;
     1229            for (k = 0; k < RP.size(); k++){
     1230              if ((TP[k]-TaoPlus) == 0.) {
     1231                aRate =  1e30;
     1232              } else {
     1233                aRate = TaoPlus/(TP[k]-TaoPlus) * theBR * RP[k];
    12181234              }
    1219               rates.push_back(theRate);               
    1220               SetDecayRate (Z,A,E,nGeneration,rates,taos);
    1221               theDecayRateVector.push_back(theDecayRate);
    1222               nEntry++;
    1223             }
     1235              theRate -= aRate;
     1236            }
     1237            rates.push_back(theRate);         
     1238            SetDecayRate (Z,A,E,nGeneration,rates,taos);
     1239            theDecayRateVector.push_back(theDecayRate);
     1240            nEntry++;
    12241241          }
    12251242        } 
     
    12331250    if (nS == nT) stable = true;
    12341251  }
    1235  
     1252
    12361253  //end of while loop
    12371254  // the calculation completed here
    1238  
    1239  
     1255
     1256
    12401257  // fill the first part of the decay rate table
    12411258  // which is the name of the original particle (isotope)
     
    12461263  // now fill the decay table with the newly completed decay rate vector
    12471264  //
    1248  
     1265
    12491266  theDecayRateTable.SetItsRates(theDecayRateVector);
    1250  
     1267
    12511268  //
    12521269  // finally add the decayratetable to the tablevector
     
    12541271  theDecayRateTableVector.push_back(theDecayRateTable);
    12551272}
    1256  
     1273
    12571274////////////////////////////////////////////////////////////////////////////////
    12581275//
     
    12671284  std::ifstream infile ( filename, std::ios::in );
    12681285  if ( !infile ) G4Exception(__FILE__, G4inttostring(__LINE__), FatalException,  "Unable to open source data file" );
    1269  
    1270   float bin, flux;
     1286
     1287  G4double bin, flux;
    12711288  NSourceBin = -1;
    12721289  while (infile >> bin >> flux ) {
     
    12771294  }
    12781295  SetAnalogueMonteCarlo(0);
     1296  infile.close();
     1297
    12791298#ifdef G4VERBOSE
    12801299  if (GetVerboseLevel()>1)
     
    12941313  std::ifstream infile ( filename, std::ios::in);
    12951314  if ( !infile ) G4Exception(__FILE__, G4inttostring(__LINE__), FatalException,  "Unable to open bias data file" );
    1296  
    1297   float bin, flux;
     1315
     1316  G4double bin, flux;
     1317  G4int dWindows = 0;
     1318  G4int i ;
     1319
     1320  theRadioactivityTables.clear();
     1321  //  for (i = 0; i<100; i++) decayWindows[i] = -1;
     1322
    12981323  NDecayBin = -1;
    12991324  while (infile >> bin >> flux ) {
     
    13021327    DBin[NDecayBin] = bin * s;
    13031328    DProfile[NDecayBin] = flux;
     1329    if (flux > 0.) {
     1330      decayWindows[NDecayBin] = dWindows;
     1331      dWindows++;
     1332      G4RadioactivityTable *rTable = new G4RadioactivityTable() ;
     1333      theRadioactivityTables.push_back(rTable);
     1334    }
    13041335  }
    1305   G4int i ;
    13061336  for ( i = 1; i<= NDecayBin; i++) DProfile[i] += DProfile[i-1];
    13071337  for ( i = 0; i<= NDecayBin; i++) DProfile[i] /= DProfile[NDecayBin];
     1338  // converted to accumulated probabilities
     1339  //
    13081340  SetAnalogueMonteCarlo(0);
     1341  infile.close();
     1342
    13091343#ifdef G4VERBOSE
    13101344  if (GetVerboseLevel()>1)
     
    13151349////////////////////////////////////////////////////////////////////////////////
    13161350//
    1317 //
    13181351// DecayIt
    13191352//
    1320 G4VParticleChange* G4RadioactiveDecay::DecayIt(const G4Track& theTrack, const G4Step& )
    1321 {
    1322   //
     1353G4VParticleChange*
     1354G4RadioactiveDecay::DecayIt(const G4Track& theTrack, const G4Step&)
     1355{
    13231356  // Initialize the G4ParticleChange object. Get the particle details and the
    13241357  // decay table.
    1325   //
     1358
    13261359  fParticleChangeForRadDecay.Initialize(theTrack);
    13271360  const G4DynamicParticle* theParticle = theTrack.GetDynamicParticle();
     
    13291362
    13301363  // First check whether RDM applies to the current logical volume
    1331   //
    1332   if(!std::binary_search(ValidVolumes.begin(),
    1333                     ValidVolumes.end(),
    1334                     theTrack.GetVolume()->GetLogicalVolume()->GetName()))
    1335     {
    1336 #ifdef G4VERBOSE
    1337       if (GetVerboseLevel()>0)
    1338         {
    1339           G4cout <<"G4RadioactiveDecay::DecayIt : "
    1340                  << theTrack.GetVolume()->GetLogicalVolume()->GetName()
    1341                  << " is not selected for the RDM"<< G4endl;
    1342           G4cout << " There are " << ValidVolumes.size() << " volumes" << G4endl;
    1343           G4cout << " The Valid volumes are " << G4endl;
    1344           for (size_t i = 0; i< ValidVolumes.size(); i++)
    1345             G4cout << ValidVolumes[i] << G4endl;
    1346         }
    1347 #endif
    1348       fParticleChangeForRadDecay.SetNumberOfSecondaries(0);
    1349       //
    1350       //
    1351       // Kill the parent particle.
    1352       //
    1353       fParticleChangeForRadDecay.ProposeTrackStatus( fStopAndKill ) ;
    1354       fParticleChangeForRadDecay.ProposeLocalEnergyDeposit(0.0);
    1355       ClearNumberOfInteractionLengthLeft();
    1356       return &fParticleChangeForRadDecay;
     1364
     1365  if (!std::binary_search(ValidVolumes.begin(), ValidVolumes.end(),
     1366                          theTrack.GetVolume()->GetLogicalVolume()->GetName())) {
     1367#ifdef G4VERBOSE
     1368    if (GetVerboseLevel()>0) {
     1369      G4cout <<"G4RadioactiveDecay::DecayIt : "
     1370             << theTrack.GetVolume()->GetLogicalVolume()->GetName()
     1371             << " is not selected for the RDM"<< G4endl;
     1372      G4cout << " There are " << ValidVolumes.size() << " volumes" << G4endl;
     1373      G4cout << " The Valid volumes are " << G4endl;
     1374      for (size_t i = 0; i< ValidVolumes.size(); i++) G4cout << ValidVolumes[i] << G4endl;
    13571375    }
    1358    
     1376#endif
     1377    fParticleChangeForRadDecay.SetNumberOfSecondaries(0);
     1378
     1379    // Kill the parent particle.
     1380
     1381    fParticleChangeForRadDecay.ProposeTrackStatus( fStopAndKill ) ;
     1382    fParticleChangeForRadDecay.ProposeLocalEnergyDeposit(0.0);
     1383    ClearNumberOfInteractionLengthLeft();
     1384    return &fParticleChangeForRadDecay;
     1385  }
     1386
    13591387  // now check is the particle is valid for RDM
    1360   //
    1361   if (!(IsApplicable(*theParticleDef)))
    1362     {
    1363       //
    1364       // The particle is not a Ion or outside the nucleuslimits for decay
    1365       //
    1366 #ifdef G4VERBOSE
    1367       if (GetVerboseLevel()>0)
    1368         {
    1369           G4cerr <<"G4RadioactiveDecay::DecayIt : "
    1370                  <<theParticleDef->GetParticleName()
    1371                  << " is not a valid nucleus for the RDM"<< G4endl;
    1372         }
    1373 #endif
    1374       fParticleChangeForRadDecay.SetNumberOfSecondaries(0);
    1375       //
    1376       //
    1377       // Kill the parent particle.
    1378       //
    1379       fParticleChangeForRadDecay.ProposeTrackStatus( fStopAndKill ) ;
    1380       fParticleChangeForRadDecay.ProposeLocalEnergyDeposit(0.0);
    1381       ClearNumberOfInteractionLengthLeft();
    1382       return &fParticleChangeForRadDecay;
     1388
     1389  if (!(IsApplicable(*theParticleDef))) {
     1390    //
     1391    // The particle is not a Ion or outside the nucleuslimits for decay
     1392    //
     1393#ifdef G4VERBOSE
     1394    if (GetVerboseLevel()>0) {
     1395      G4cerr <<"G4RadioactiveDecay::DecayIt : "
     1396             <<theParticleDef->GetParticleName()
     1397             << " is not a valid nucleus for the RDM"<< G4endl;
    13831398    }
    1384  
     1399#endif
     1400    fParticleChangeForRadDecay.SetNumberOfSecondaries(0);
     1401
     1402    //
     1403    // Kill the parent particle.
     1404    //
     1405    fParticleChangeForRadDecay.ProposeTrackStatus( fStopAndKill ) ;
     1406    fParticleChangeForRadDecay.ProposeLocalEnergyDeposit(0.0);
     1407    ClearNumberOfInteractionLengthLeft();
     1408    return &fParticleChangeForRadDecay;
     1409  }
     1410
    13851411  if (!IsLoaded(*theParticleDef))
    13861412    {
     
    13881414    }
    13891415  G4DecayTable *theDecayTable = theParticleDef->GetDecayTable();
    1390  
     1416
    13911417  if  (theDecayTable == 0 || theDecayTable->entries() == 0 )
    13921418    {
     
    14231449      G4ThreeVector currentPosition;
    14241450      currentPosition = theTrack.GetPosition();
    1425      
     1451
    14261452      // check whether use Analogue or VR implementation
    14271453      //
     
    14541480        G4double ParentEnergy = theParticle->GetTotalEnergy();
    14551481        G4ThreeVector ParentDirection(theParticle->GetMomentumDirection());
    1456        
     1482
    14571483        if (theTrack.GetTrackStatus() == fStopButAlive )
    14581484          {
     
    15011527              (products->PopProducts(), finalGlobalTime, currentPosition);
    15021528            secondary->SetGoodForTrackingFlag();
    1503                         secondary->SetTouchableHandle(theTrack.GetTouchableHandle());
     1529            secondary->SetTouchableHandle(theTrack.GetTouchableHandle());
    15041530            fParticleChangeForRadDecay.AddSecondary(secondary);
    15051531          }
     
    15211547        if (!IsRateTableReady(*theParticleDef)) {
    15221548          // if the decayrates are not ready, calculate them and
    1523           // add to the rate table vector
     1549          // add to the rate table vector
    15241550          AddDecayRateTable(*theParticleDef);
    15251551        }
     
    15381564        G4double taotime;
    15391565        G4double decayRate;
    1540        
     1566
    15411567        size_t i;
    15421568        size_t j;
     
    15571583        for (G4int n = 0; n < NSplit; n++)
    15581584          {
    1559             /*
    1560             //
    15611585            // Get the decay time following the decay probability function
    15621586            // suppllied by user
    1563             //
     1587           
    15641588            G4double theDecayTime = GetDecayTime();
    1565            
    15661589            G4int nbin = GetDecayTimeBin(theDecayTime);
    15671590           
    1568             // claculate the first part of the weight function
     1591            // calculate the first part of the weight function
    15691592           
    1570             G4double weight1 =1./DProfile[nbin-1]
    1571               *(DBin[nbin]-DBin[nbin-1])
    1572               /NSplit;
    1573             if (nbin > 1) {
    1574                weight1 = 1./(DProfile[nbin]-DProfile[nbin-2])
    1575                  *(DBin[nbin]-DBin[nbin-1])
    1576                  /NSplit;}
     1593            G4double weight1 = 1.;
     1594            if (nbin == 1) {
     1595              weight1 = 1./DProfile[nbin-1]
     1596                *(DBin[nbin]-DBin[nbin-1])/NSplit;
     1597            } else if (nbin > 1) {
     1598              weight1 = 1./(DProfile[nbin]-DProfile[nbin-2])
     1599                *(DBin[nbin]-DBin[nbin-1])/NSplit;
     1600            }
     1601
    15771602            // it should be calculated in seconds
    15781603            weight1 /= s ;
    1579             */
    1580             //
     1604           
    15811605            // loop over all the possible secondaries of the nucleus
    15821606            // the first one is itself.
    1583             //
    1584             for ( i = 0; i<theDecayRateVector.size(); i++){
     1607
     1608            for (i = 0; i<theDecayRateVector.size(); i++){
    15851609              PZ = theDecayRateVector[i].GetZ();
    15861610              PA = theDecayRateVector[i].GetA();
     
    15891613              PR = theDecayRateVector[i].GetDecayRateC();
    15901614
    1591               //
    1592               // Get the decay time following the decay probability function
    1593               // suppllied by user
    1594               //
    1595               G4double theDecayTime = GetDecayTime();
    1596              
    1597               G4int nbin = GetDecayTimeBin(theDecayTime);
    1598              
    1599               // claculate the first part of the weight function
    1600              
    1601               G4double weight1 =1./DProfile[nbin-1]
    1602                 *(DBin[nbin]-DBin[nbin-1])
    1603                 /NSplit;
    1604               if (nbin > 1) {
    1605                 weight1 = 1./(DProfile[nbin]-DProfile[nbin-2])
    1606                   *(DBin[nbin]-DBin[nbin-1])
    1607                   /NSplit;}
    1608               // it should be calculated in seconds
    1609               weight1 /= s ;
    1610              
    16111615              // a temprary products buffer and its contents is transfered to
    16121616              // the products at the end of the loop
    1613               //
     1617
    16141618              G4DecayProducts *tempprods = 0;
    1615              
     1619
    16161620              // calculate the decay rate of the isotope
    1617               // one need to fold the the source bias function with the decaytime
    1618               //
     1621              // decayRate is the radioactivity of isotope (PZ,PA,PE) at the
     1622              // time 'theDecayTime'
     1623              // it will be used to calculate the statistical weight of the
     1624              // decay products of this isotope
     1625
     1626              //              G4cout <<"PA= "<< PA << " PZ= " << PZ << " PE= "<< PE  <<G4endl;
    16191627              decayRate = 0.;
    16201628              for ( j = 0; j < PT.size(); j++){
    16211629                taotime = GetTaoTime(theDecayTime,PT[j]);
    16221630                decayRate -= PR[j] * taotime;
     1631                // Eq.4.23 of of the TN
     1632                // note the negative here is required as the rate in the eqation is defined to be negative,
     1633                // i.e. decay away, but we need pasitive value here.
     1634
     1635                //              G4cout << j << "\t"<< PT[j]/s <<"\t"<<PR[j]<< "\t" << decayRate << G4endl ;             
    16231636              }
    1624              
    1625               // decayRatehe radioactivity of isotope (PZ,PA,PE) at the
    1626               // time 'theDecayTime'
    1627               // it will be used to calculate the statistical weight of the
    1628               // decay products of this isotope
    1629              
    1630              
    1631               //
     1637
    16321638              // now calculate the statistical weight
    1633               //
    1634              
    1635               G4double weight = weight1*decayRate;
     1639
     1640              // one need to fold the the source bias function with the decaytime
     1641              // also need to include the track weight! (F.Lei, 28/10/10)
     1642              G4double weight = weight1*decayRate*theTrack.GetWeight();
     1643               
     1644              // add the isotope to the radioactivity tables
     1645              //                            G4cout <<theDecayTime/s <<"\t"<<nbin<<G4endl;
     1646              //G4cout << theTrack.GetWeight() <<"\t"<<weight1<<"\t"<<decayRate<< G4endl;
     1647              theRadioactivityTables[decayWindows[nbin-1]]->AddIsotope(PZ,PA,PE,weight);
     1648                               
    16361649              // decay the isotope
    16371650              theIonTable = (G4IonTable *)(G4ParticleTable::GetParticleTable()->GetIonTable());
    16381651              parentNucleus = theIonTable->GetIon(PZ,PA,PE);
    1639              
     1652
    16401653              // decide whther to apply branching ratio bias or not
    16411654              //
     
    16441657                ndecaych = G4int(theDecayTable->entries()*G4UniformRand());
    16451658                G4VDecayChannel *theDecayChannel = theDecayTable->GetDecayChannel(ndecaych);
    1646                 if (theDecayChannel == 0)
    1647                   {
    1648                     // Decay channel not found.
    1649 #ifdef G4VERBOSE
    1650                     if (GetVerboseLevel()>0)
    1651                       {
    1652                         G4cerr <<"G4RadioactiveDecay::DoIt : can not determine decay channel";
    1653                         G4cerr <<G4endl;
    1654                         theDecayTable ->DumpInfo();
    1655                       }
    1656 #endif
     1659                if (theDecayChannel == 0) {
     1660                  // Decay channel not found.
     1661#ifdef G4VERBOSE
     1662                  if (GetVerboseLevel()>0) {
     1663                    G4cerr <<"G4RadioactiveDecay::DoIt : can not determine decay channel";
     1664                    G4cerr <<G4endl;
     1665                    theDecayTable ->DumpInfo();
    16571666                  }
    1658                 else
    1659                   {
    1660                     // A decay channel has been identified, so execute the DecayIt.
    1661                     G4double tempmass = parentNucleus->GetPDGMass();     
    1662                     tempprods = theDecayChannel->DecayIt(tempmass);
    1663                     weight *= (theDecayChannel->GetBR())*(theDecayTable->entries());
    1664                   }
    1665               }
    1666               else {
     1667#endif
     1668                } else {
     1669                  // A decay channel has been identified, so execute the DecayIt.
     1670                  G4double tempmass = parentNucleus->GetPDGMass();     
     1671                  tempprods = theDecayChannel->DecayIt(tempmass);
     1672                  weight *= (theDecayChannel->GetBR())*(theDecayTable->entries());
     1673                }
     1674              } else {
    16671675                tempprods = DoDecay(*parentNucleus);
    16681676              }
    1669               //
     1677
    16701678              // save the secondaries for buffers
    1671               //
     1679
    16721680              numberOfSecondaries = tempprods->entries();
    16731681              currentTime = finalGlobalTime + theDecayTime;
    1674               for (index=0; index < numberOfSecondaries; index++)
    1675                 {
    1676                   asecondaryparticle = tempprods->PopProducts();
    1677                   if (asecondaryparticle->GetDefinition()->GetBaryonNumber() < 5){
    1678                     pw.push_back(weight);
    1679                     ptime.push_back(currentTime);
    1680                     secondaryparticles.push_back(asecondaryparticle);
    1681                   }
     1682              for (index=0; index < numberOfSecondaries; index++) {
     1683                asecondaryparticle = tempprods->PopProducts();
     1684                if (asecondaryparticle->GetDefinition()->GetBaryonNumber() < 5){
     1685                  pw.push_back(weight);
     1686                  ptime.push_back(currentTime);
     1687                  secondaryparticles.push_back(asecondaryparticle);
    16821688                }
    1683               //
     1689              }
     1690
    16841691              delete tempprods;
    1685              
     1692
    16861693              //end of i loop
    16871694            }
    1688            
     1695
    16891696            // end of n loop
    1690           }
     1697          }
     1698
    16911699        // now deal with the secondaries in the two stl containers
    16921700        // and submmit them back to the tracking manager
     
    16991707                                             secondaryparticles[index], ptime[index], currentPosition);
    17001708            secondary->SetGoodForTrackingFlag();           
    1701                         secondary->SetTouchableHandle(theTrack.GetTouchableHandle());
     1709            secondary->SetTouchableHandle(theTrack.GetTouchableHandle());
    17021710            secondary->SetWeight(pw[index]);       
    1703             fParticleChangeForRadDecay.AddSecondary(secondary);
     1711            fParticleChangeForRadDecay.AddSecondary(secondary);
    17041712          }
    17051713        //
     
    17081716        //theTrack.SetTrackStatus(fStopButAlive);
    17091717        //energyDeposit += theParticle->GetKineticEnergy();
    1710        
     1718
    17111719      }
    1712    
     1720
    17131721      //
    17141722      // Kill the parent particle.
     
    17221730      //
    17231731      ClearNumberOfInteractionLengthLeft();
    1724      
     1732
    17251733      return &fParticleChangeForRadDecay ;
    17261734    }
    17271735}
    17281736
    1729 ////////////////////////////////////////////////////////////////////////////////
    1730 //
     1737///////////////////////////////////////////////////////////////////
    17311738//
    17321739// DoDecay
    17331740//
    1734 G4DecayProducts* G4RadioactiveDecay::DoDecay(  G4ParticleDefinition& theParticleDef )
    1735 {
    1736   G4DecayProducts *products = 0;
    1737   //
    1738   //
     1741G4DecayProducts*
     1742G4RadioactiveDecay::DoDecay(  G4ParticleDefinition& theParticleDef )
     1743{
     1744  G4DecayProducts* products = 0;
     1745
    17391746  // follow the decaytable and generate the secondaries...
    1740   //
    1741   //
    1742 #ifdef G4VERBOSE
    1743   if (GetVerboseLevel()>0)
    1744     {
    1745       G4cout<<"Begin of DoDecay..."<<G4endl;
     1747
     1748#ifdef G4VERBOSE
     1749  if (GetVerboseLevel()>0) G4cout<<"Begin of DoDecay..."<<G4endl;
     1750#endif
     1751
     1752  G4DecayTable* theDecayTable = theParticleDef.GetDecayTable();
     1753
     1754  // Choose a decay channel.
     1755
     1756#ifdef G4VERBOSE
     1757  if (GetVerboseLevel()>0) G4cout <<"Selecte a channel..."<<G4endl;
     1758#endif
     1759
     1760  G4VDecayChannel* theDecayChannel = theDecayTable->SelectADecayChannel();
     1761  if (theDecayChannel == 0) {
     1762    // Decay channel not found.
     1763
     1764    G4cerr <<"G4RadioactiveDecay::DoIt : can not determine decay channel";
     1765    G4cerr <<G4endl;
     1766    theDecayTable ->DumpInfo();
     1767  } else {
     1768
     1769    // A decay channel has been identified, so execute the DecayIt.
     1770
     1771#ifdef G4VERBOSE
     1772    if (GetVerboseLevel()>1) {
     1773      G4cerr <<"G4RadioactiveDecay::DoIt : selected decay channel  addr:";
     1774      G4cerr <<theDecayChannel <<G4endl;
    17461775    }
    17471776#endif
    1748   G4DecayTable *theDecayTable = theParticleDef.GetDecayTable();
    1749   //
    1750   // Choose a decay channel.
    1751   //
    1752 #ifdef G4VERBOSE
    1753   if (GetVerboseLevel()>0)
    1754     {
    1755       G4cout <<"Selecte a channel..."<<G4endl;
    1756     }
    1757 #endif
    1758   G4VDecayChannel *theDecayChannel = theDecayTable->SelectADecayChannel();
    1759   if (theDecayChannel == 0)
    1760     {
    1761       // Decay channel not found.
    1762       //
    1763       G4cerr <<"G4RadioactiveDecay::DoIt : can not determine decay channel";
    1764       G4cerr <<G4endl;
    1765       theDecayTable ->DumpInfo();
    1766     }
    1767       else
    1768     {
    1769       //
    1770       // A decay channel has been identified, so execute the DecayIt.
    1771       //
    1772 #ifdef G4VERBOSE
    1773       if (GetVerboseLevel()>1)
    1774         {
    1775           G4cerr <<"G4RadioactiveDecay::DoIt : selected decay channel  addr:";
    1776           G4cerr <<theDecayChannel <<G4endl;
    1777         }
    1778 #endif
    1779      
    1780       G4double tempmass = theParticleDef.GetPDGMass();
    1781       //
    1782      
    1783       products = theDecayChannel->DecayIt(tempmass);
    1784      
    1785     }
     1777
     1778    G4double tempmass = theParticleDef.GetPDGMass();
     1779    products = theDecayChannel->DecayIt(tempmass);
     1780  }
     1781
    17861782  return products;
    1787 
    1788 }
    1789 
    1790 
    1791 
    1792 
    1793 
    1794 
    1795 
    1796 
    1797 
     1783}
  • trunk/source/processes/hadronic/models/radioactive_decay/src/G4RadioactiveDecaymessenger.cc

    r1340 r1347  
    123123  icmCmd->SetParameterName("applyICM",true);
    124124  icmCmd->SetDefaultValue(true);
    125   icmCmd->AvailableForStates(G4State_PreInit);
     125  //icmCmd->AvailableForStates(G4State_PreInit);
    126126  //
    127127  // Command contols whether ARM will be applied or not
     
    131131  armCmd->SetParameterName("applyARM",true);
    132132  armCmd->SetDefaultValue(true);
    133   armCmd->AvailableForStates(G4State_PreInit);
     133  //armCmd->AvailableForStates(G4State_PreInit);
    134134  //
    135135  // Command to set the h-l thresold for isomer production
     
    140140  // hlthCmd->SetRange("hlThreshold>0.");
    141141  hlthCmd->SetUnitCategory("Time");
    142   hlthCmd->AvailableForStates(G4State_PreInit);
     142  //  hlthCmd->AvailableForStates(G4State_PreInit);
    143143  //
    144144  // Command to define the incident particle source time profile.
     
    209209                                    SetNucleusLimits(nucleuslimitsCmd->GetNewNucleusLimitsValue(newValues));}
    210210  else if  (command==analoguemcCmd) {
    211     G4int vl;
    212     const char* t = newValues;
    213     std::istringstream is(t);
    214     is >> vl;
    215     theRadioactiveDecayContainer->SetAnalogueMonteCarlo(vl!=0);}
     211    theRadioactiveDecayContainer->SetAnalogueMonteCarlo(analoguemcCmd->GetNewBoolValue(newValues));}
    216212  else if  (command==fbetaCmd) {
    217     G4int vl;
    218     const char* t = newValues;
    219     std::istringstream is(t);
    220     is >> vl;
    221     theRadioactiveDecayContainer->SetFBeta(vl!=0);}
     213    theRadioactiveDecayContainer->SetFBeta(fbetaCmd->GetNewBoolValue(newValues));}
    222214  else if  (command==avolumeCmd) {theRadioactiveDecayContainer->
    223215                                   SelectAVolume(newValues);}
     
    229221                                   DeselectAllVolumes();}
    230222  else if  (command==brbiasCmd) {
    231     G4int vl;
    232     const char* t = newValues;
    233     std::istringstream is(t);
    234     is >> vl;
    235     theRadioactiveDecayContainer->SetBRBias(vl!=0);}
     223    theRadioactiveDecayContainer->SetBRBias(brbiasCmd->GetNewBoolValue(newValues));}
    236224  else if (command==sourcetimeprofileCmd) {theRadioactiveDecayContainer->
    237225                                             SetSourceTimeProfile(newValues);}
  • trunk/source/processes/hadronic/models/rpg/History

    r1228 r1347  
    1414   * Please list in reverse chronological order (last date on top)
    1515   ---------------------------------------------------------------
     16
     1721 Nov 2010 - Dennis Wright (hadr-rpg-V09-03-00)
     18------------------------------------------------
     19G4RPGFragmentation.cc: initialize dndl in ctor as per CoVerity
    1620
    172120 Nov 2009 - Dennis Wright (hadr-rpg-V09-02-01)
  • trunk/source/processes/hadronic/models/util/History

    r1340 r1347  
    1 $Id: History,v 1.40 2010/09/28 17:03:26 vnivanch Exp $
     1$Id: History,v 1.45 2010/11/03 17:37:57 gunter Exp $
    22-------------------------------------------------------------------
    33
     
    1515     * Please list in reverse chronological order (last date on top)
    1616     ---------------------------------------------------------------
     17
     183 Nov 2010 Gunter Folger                        hadr-mod-util-V09-03-07
     19- G4Nuclear...Density: migrate to integer A&Z
     20
     213 Nov 2010 Gunter Folger                        hadr-mod-util-V09-03-06
     22- G4KineticTrack: fix coverity warnings of memory leak
     23
     2402 Nov 2010 Vladimir Ivanchenko hadr-mod-util-V09-03-05
     25- G4Fragment - improved printout of negative excitation energy
     26- G4DecayStrongResonances - constructor and destructor moved to source,
     27                            fixed Coverity warning
    1728
    182927 Sep 2010 Vladimir Ivanchenko hadr-mod-util-V09-03-04
  • trunk/source/processes/hadronic/models/util/include/G4DecayStrongResonances.hh

    r1340 r1347  
    2424// ********************************************************************
    2525//
     26// $Id: G4DecayStrongResonances.hh,v 1.9 2010/11/02 17:57:38 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
     28//
     29// -------------------------------------------------------------------
     30//
     31// GEANT4 Class file
     32//
     33// File name:     G4DecayStrongResonances
     34//
     35// Modified: 
     36// 02.11.2010 V.Ivanchenko moved constructor and destructor to source;
     37//                         removed unused variable
    2638
    2739#ifndef G4DecayStrongResonances_h
     
    3648{
    3749public:
    38    G4DecayStrongResonances(){}     
    39    ~G4DecayStrongResonances(){}
     50  G4DecayStrongResonances();
     51  ~G4DecayStrongResonances();
    4052
    4153private:
    4254   G4int operator==(G4DecayStrongResonances& right) {return (this == &right);}
    4355   G4int operator!=(G4DecayStrongResonances& right) {return (this != &right);}
    44    
    45    G4double theEnergy;
    4656     
    4757public:
  • trunk/source/processes/hadronic/models/util/include/G4NuclearFermiDensity.hh

    r1228 r1347  
    4040
    4141  public:
    42     G4NuclearFermiDensity(G4double anA, G4double aZ);
     42    G4NuclearFermiDensity(G4int anA, G4int aZ);
    4343    ~G4NuclearFermiDensity();
    4444   
  • trunk/source/processes/hadronic/models/util/include/G4NuclearShellModelDensity.hh

    r819 r1347  
    4040
    4141  public:
    42     G4NuclearShellModelDensity(G4double anA, G4double aZ);
     42    G4NuclearShellModelDensity(G4int anA, G4int aZ);
    4343    ~G4NuclearShellModelDensity();
    4444   
  • trunk/source/processes/hadronic/models/util/src/G4KineticTrack.cc

    r1196 r1347  
    493493      G4cout << "DECAY Actual Mass " << theActualMass << G4endl;
    494494*/
     495  G4ParticleDefinition* thisDefinition = this->GetDefinition();
     496  if(!thisDefinition)
     497  {
     498    G4cerr << "Error condition encountered in G4KineticTrack::Decay()"<<G4endl;
     499    G4cerr << "  track has no particle definition associated."<<G4endl;
     500    return 0;
     501  }
     502  G4DecayTable* theDecayTable = thisDefinition->GetDecayTable();
     503  if(!theDecayTable)
     504  {
     505    G4cerr << "Error condition encountered in G4KineticTrack::Decay()"<<G4endl;
     506    G4cerr << "  particle definiton has no decay table associated."<<G4endl;
     507    G4cerr << "  particle was "<<thisDefinition->GetParticleName()<<G4endl;
     508    return 0;
     509  }
    495510 
    496511 G4int chargeBalance = G4lrint(theDefinition->GetPDGCharge() );     
     
    512527     //  cout << "DECAY Total Width " << theTotalActualWidth << G4endl;
    513528     G4double r = theTotalActualWidth * G4UniformRand();
    514      G4ParticleDefinition* thisDefinition = this->GetDefinition();
    515      if(!thisDefinition)
    516      {
    517        G4cerr << "Error condition encountered in G4KineticTrack::Decay()"<<G4endl;
    518        G4cerr << "  track has no particle definition associated."<<G4endl;
    519        return 0;
    520      }
    521      G4DecayTable* theDecayTable = thisDefinition->GetDecayTable();
    522      if(!theDecayTable)
    523      {
    524        G4cerr << "Error condition encountered in G4KineticTrack::Decay()"<<G4endl;
    525        G4cerr << "  particle definiton has no decay table associated."<<G4endl;
    526        G4cerr << "  particle was "<<thisDefinition->GetParticleName()<<G4endl;
    527        return 0;
    528      }
    529      G4VDecayChannel* theDecayChannel=NULL;
     529     G4VDecayChannel* theDecayChannel(0);
    530530     for (index = nChannels - 1; index >= 0; index--)
    531531        {
     
    538538            }
    539539        }
    540        
     540
     541     delete [] theCumActualWidth;
     542   
    541543     if(!theDecayChannel)
    542544     {
     
    669671        }
    670672     delete theDecayProducts;
    671      delete [] theCumActualWidth;
    672673     if(getenv("DecayEnergyBalanceCheck"))
    673674       std::cout << "DEBUGGING energy balance in cms and lab, charge baryon balance : "
  • trunk/source/processes/hadronic/models/util/src/G4NuclearFermiDensity.cc

    r819 r1347  
    2929#include "G4NuclearFermiDensity.hh"
    3030
    31 G4NuclearFermiDensity::G4NuclearFermiDensity(G4double anA, G4double aZ)
    32   :  a(0.545 * fermi)
     31G4NuclearFermiDensity::G4NuclearFermiDensity(G4int anA, G4int aZ)
     32  :  theA(anA), theZ(aZ), a(0.545 * fermi)
    3333{
    3434//        const G4double r0=1.14*fermi;
    35         const G4double r0=1.16 * ( 1. - 1.16 * std::pow(anA, -2./3.)) * fermi;
    36         theA = G4int(anA);
    37         theZ = G4int(aZ);
     35        const G4double r0=1.16 * ( 1. - 1.16 * std::pow(G4double(anA), -2./3.)) * fermi;
    3836        theR= r0 * std::pow(anA, 1./3. );
    3937        Setrho0(3./ (4. * pi * std::pow(r0,3.) * theA * ( 1. + sqr(a/theR)*pi2 )));
  • trunk/source/processes/hadronic/models/util/src/G4NuclearShellModelDensity.cc

    r819 r1347  
    2929#include "G4NuclearShellModelDensity.hh"
    3030
    31 G4NuclearShellModelDensity::G4NuclearShellModelDensity(G4double anA, G4double aZ)
     31G4NuclearShellModelDensity::G4NuclearShellModelDensity(G4int anA, G4int aZ)
     32: theA(anA), theZ(aZ)
    3233{
    3334        const G4double r0sq=0.8133*fermi*fermi;
    34         theA = G4int(anA);
    35         theZ = G4int(aZ);
    3635        theRsquare= r0sq * std::pow(G4double(theA), 2./3. );
    3736        Setrho0(std::pow(1./(pi*theRsquare),3./2.));
  • trunk/source/processes/hadronic/stopping/History

    r1340 r1347  
    1515     ---------------------------------------------------------------
    1616
     1711-Nov-2010 Dennis Wright        (hadr-stopping-V09-03-01)
     18----------------------------------------------------------
     19- G4MuonMinusCaptureAtRest::DoMuCapture : fix unused branch 
     20    pd = G4Deuteron::Deuteron() in mass calculation
     21- G4PiMinusStopMaterial: theR was used but uninitialized.  Now init'ed
     22    to 0.5 in ctor
     23- G4PiMinusAbsorptionAtRest: remove null test for vector pointer
     24    in dtor
     25- G4StopDummyDeexcitation: initialize pointer _products in ctor
     26- G4KaonMinusAbsorptionAtRest::SigmaLambdaConversion : add dummy
     27    particles to default of switch/case to avoid possible NULL
     28    pointers
     29 
    173020-Sep-2010 Gunter Folger        (hadr-stopping-V09-03-00)
    1831----------------------------------------------------------
  • trunk/source/processes/hadronic/stopping/src/G4KaonMinusAbsorptionAtRest.cc

    r1196 r1347  
    502502  default:
    503503    sigmaLambdaConversionRate = 0.;
     504    // Add dummy particles to avoid possibility of passing NULL pointers
     505    inNucleonDef   = G4Proton::Proton();
     506    outNucleonDef  = G4Proton::Proton();
    504507  }
    505508 
  • trunk/source/processes/hadronic/stopping/src/G4PiMinusAbsorptionAtRest.cc

    r1196 r1347  
    209209    }
    210210
    211   G4int index = 3;
    212   if (Z <= 3) { index = 3;}
    213   if (Z > 3 && Z<= 6) {index = 6;}
     211  G4int index = 0;
     212  if (Z > 0 && Z < 4) {index = 3;}
     213  if (Z > 3 && Z < 7) {index = 6;}
    214214  if (Z == 7) {index = 7;}
    215215  if (Z >= 8 && Z<= 11) {index = 8;}
  • trunk/source/processes/hadronic/stopping/src/G4PiMinusStopMaterial.cc

    r1196 r1347  
    5454
    5555G4PiMinusStopMaterial::G4PiMinusStopMaterial()
    56  
    5756{
    5857  _definitions = 0;
     
    6059  _distributionE = 0;
    6160  _distributionAngle = 0;
    62 
     61  theR = 0.5;
    6362}
    6463
     
    6867G4PiMinusStopMaterial::~G4PiMinusStopMaterial()
    6968{
    70   //  _definitions->clear();
    7169  if (_definitions != 0) delete _definitions;
    7270  _definitions = 0;
    7371
    74   for(unsigned int i=0; i<_momenta->size(); i++) delete(*_momenta)[i];
     72  for (unsigned int i=0; i<_momenta->size(); i++) delete(*_momenta)[i];
    7573  if (_momenta != 0) delete _momenta;
    7674
     
    9492}
    9593
    96 std::vector<G4LorentzVector*>* G4PiMinusStopMaterial::P4Vector(const G4double binding,
    97                                                                       const G4double massNucleus)
     94std::vector<G4LorentzVector*>*
     95G4PiMinusStopMaterial::P4Vector(const G4double binding,
     96                                const G4double massNucleus)
    9897{
    99 
    100   // Generate energy of direct absorption products according to experimental data
    101   // The energy distribution of the two nucleons is assumed to be the same
    102   // for protons and neutrons 
    103 
     98  // Generate energy of direct absorption products according to experimental
     99  // data.  The energy distribution of the two nucleons is assumed to be the
     100  // same for protons and neutrons. 
    104101
    105102  G4double eKin1;
     
    191188}
    192189
    193 
    194 
    195 
    196 
    197 
    198 
    199 
    200 
    201 
  • trunk/source/processes/hadronic/stopping/src/G4StopDummyDeexcitation.cc

    r819 r1347  
    4242// Constructor
    4343
    44 G4StopDummyDeexcitation::G4StopDummyDeexcitation()
    45  
    46 {}
     44G4StopDummyDeexcitation::G4StopDummyDeexcitation() 
     45{
     46  _products = 0;
     47}
    4748
    4849
  • trunk/source/processes/hadronic/util/History

    r1315 r1347  
    1414     * Please list in reverse chronological order (last date on top)
    1515     ---------------------------------------------------------------
     16
     1711 Nov 2010  Dennis Wright              (hadr-util-V09-03-01)
     18-------------------------------------------------------------
     19- G4HadronicWhiteBoard: fix uninitialized ptrs (theProjectile, theDef,
     20    theName)
     21- G4Nucleus: add dtaBlackTrackEnergyfromAnnihilation and
     22    pnBlackTrackEnergyfromAnnihilation to copy ctor
     23    initialize theA, theZ. aEff, zEff to 0 in ctor
    1624
    172508 Mar 2010 G.Folger                    (hadr-util-V09-03-00)
  • trunk/source/processes/hadronic/util/include/G4HadronicWhiteBoard.hh

    r1315 r1347  
    3535{
    3636  public:
    37   G4HadronicWhiteBoard(){}
     37  G4HadronicWhiteBoard();
    3838 
    39   static G4HadronicWhiteBoard & Instance();
     39  static G4HadronicWhiteBoard& Instance();
    4040 
    41   void SetProjectile(const G4HadProjectile & aProjectile);
     41  void SetProjectile(const G4HadProjectile& aProjectile);
    4242   
    43   void SetTargetNucleus(const G4Nucleus & aTarget);
     43  void SetTargetNucleus(const G4Nucleus& aTarget);
    4444
    4545  void SetProcessName(const G4String& aProcessName);
     
    4747  void SetModelName(const G4String& aModelName);
    4848
    49   const G4HadProjectile * GetProjectile();
    50   const G4Nucleus & GetTargetNucleus();
    51   G4ParticleDefinition * GetPDef();
     49  const G4HadProjectile* GetProjectile();
     50  const G4Nucleus& GetTargetNucleus();
     51  G4ParticleDefinition* GetPDef();
    5252  G4String GetParticleName();
    5353  G4double GetEnergy();
     
    6363  private:
    6464 
    65   G4HadProjectile * theProjectile;
    66   G4ParticleDefinition * theDef;
    67   char * theName;
     65  G4HadProjectile* theProjectile;
     66  G4ParticleDefinition* theDef;
     67  char* theName;
    6868  G4double theE;
    6969  G4double thePx;
  • trunk/source/processes/hadronic/util/include/G4Nucleus.hh

    r1315 r1347  
    7676         zEff=right.zEff; 
    7777         pnBlackTrackEnergy=right.pnBlackTrackEnergy;
    78          dtaBlackTrackEnergy=right.dtaBlackTrackEnergy;
     78         dtaBlackTrackEnergy=right.dtaBlackTrackEnergy;
     79         pnBlackTrackEnergyfromAnnihilation =
     80                      right.pnBlackTrackEnergyfromAnnihilation;
     81         dtaBlackTrackEnergyfromAnnihilation =
     82                      right.dtaBlackTrackEnergyfromAnnihilation;
    7983         theTemp = right.theTemp;
    8084         excitationEnergy = right.excitationEnergy;
  • trunk/source/processes/hadronic/util/src/G4HadronicWhiteBoard.cc

    r1315 r1347  
    2525//
    2626#include "G4HadronicWhiteBoard.hh"
     27
     28
     29G4HadronicWhiteBoard::G4HadronicWhiteBoard()
     30  : theProjectile(0), theDef(0), theName(0)
     31{}
    2732
    2833
  • trunk/source/processes/hadronic/util/src/G4Nucleus.cc

    r1315 r1347  
    4646 
    4747G4Nucleus::G4Nucleus()
     48  : theA(0), theZ(0), aEff(0.0), zEff(0)
    4849{
    4950  pnBlackTrackEnergy = 0.0;
Note: See TracChangeset for help on using the changeset viewer.