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

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

Location:
trunk/source/processes/electromagnetic
Files:
341 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/electromagnetic/adjoint/History

    r1228 r1315  
    1 $Id: History,v 1.5 2009/11/23 09:02:35 gcosmo Exp $
     1$Id: History,v 1.6 2010/04/12 18:57:15 vnivanch Exp $
    22-------------------------------------------------------------------
    33
     
    1818     ----------------------------------------------------------
    1919
     2012 Apr 2010: V.Ivanchenko (emadjoint-V09-03-00)
     21- G4AdjointhMultipleScattering - removed obsolete unused header
     22
    202323 Nov 2009: G.Cosmo (emadjoint-V09-02-02)
    2124- Corrected compilation error on Windows for G4AdjointAlongStepWeightCorrection.
  • trunk/source/processes/electromagnetic/adjoint/src/G4AdjointhMultipleScattering.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4AdjointhMultipleScattering.cc,v 1.2 2009/11/20 10:31:20 ldesorgh Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4AdjointhMultipleScattering.cc,v 1.3 2010/04/12 18:57:15 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929
     
    4343
    4444#include "G4AdjointhMultipleScattering.hh"
    45 #include "G4UrbanMscModel.hh"
    4645#include "G4UrbanMscModel90.hh"
    4746#include "G4MscStepLimitType.hh"
  • trunk/source/processes/electromagnetic/highenergy/History

    r1196 r1315  
    1 $Id: History,v 1.34 2009/11/11 17:13:47 vnivanch Exp $
     1$Id: History,v 1.36 2010/06/04 10:23:31 vnivanch Exp $
    22-------------------------------------------------------------------
    33
     
    1717     * Reverse chronological order (last date on top), please *
    1818     ----------------------------------------------------------
     19
     2004 March 10: V.Ivanchenko (emhighenergy-V09-03-01)
     21- G4ICRU73NoDeltaModel - new model derived from G4ICRU73QOModel
     22
     2328 March 10: V.Ivanchenko (emhighenergy-V09-03-00)
     24- G4mplIonisation - fixed IsApplicable method - always "true"
     25                    (CMS report crash in the case when several types
     26                     of monopoles are instantiated)
    1927
    202811 November 09: V.Ivanchenko (emhighenergy-V09-02-03)
  • trunk/source/processes/electromagnetic/highenergy/src/G4hhIonisation.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4hhIonisation.cc,v 1.9 2009/02/20 16:38:33 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4hhIonisation.cc,v 1.10 2010/06/04 10:23:31 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    5151#include "G4BraggNoDeltaModel.hh"
    5252#include "G4BetheBlochNoDeltaModel.hh"
     53#include "G4ICRU73NoDeltaModel.hh"
    5354#include "G4UniversalFluctuation.hh"
    5455#include "G4BohrFluctuations.hh"
     
    110111  SetBaseParticle(0);
    111112  SetSecondaryParticle(G4Electron::Electron());
     113  //G4double q = theParticle->GetPDGCharge();
    112114  mass  = theParticle->GetPDGMass();
    113115  ratio = electron_mass_c2/mass;
     
    120122
    121123  if(eth > minKinEnergy) {
    122     G4VEmModel* em = new G4BraggNoDeltaModel();
     124    G4VEmModel* em;
     125    em = new G4BraggNoDeltaModel();
     126    //if(q > 0.0) { em = new G4BraggNoDeltaModel(); }
     127    //else { em = new G4ICRU73NoDeltaModel(); }
    123128    em->SetLowEnergyLimit(minKinEnergy);
    124129    em->SetHighEnergyLimit(eth);
    125130    AddEmModel(nm, em, flucModel);
    126     nm++;
     131    ++nm;
    127132  }
    128133
  • trunk/source/processes/electromagnetic/highenergy/src/G4mplIonisation.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4mplIonisation.cc,v 1.8 2009/02/20 16:38:33 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4mplIonisation.cc,v 1.10 2010/03/28 16:45:38 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    7575//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    7676
    77 G4bool G4mplIonisation::IsApplicable(const G4ParticleDefinition& p)
     77G4bool G4mplIonisation::IsApplicable(const G4ParticleDefinition&)
    7878{
    79   return (p.GetParticleName() == "monopole");
     79  return true;
    8080}
    8181
  • trunk/source/processes/electromagnetic/lowenergy/History

    r1228 r1315  
    1 $Id: History,v 1.407 2009/12/10 12:26:05 sincerti Exp $
     1$Id: History,v 1.438 2010/06/08 21:50:00 sincerti Exp $
    22-------------------------------------------------------------------
    33
     
    1717     * Reverse chronological order (last date on top), please *
    1818     ----------------------------------------------------------
     19
     2008.06.2010, S. Incerti, tag emlowen-V09-03-31
     21            modified initialisation of e- Emfietzoglou excitation
     22            model in G4DNAEmfietzoglouExcitationModel.cc and
     23            in G4DNAMillerGreenExcitationModel.cc
     24
     2507.06.2010, A.Mantero, tag emlowen-V09-03-30
     26            added analytical (ecpssr) and empirical (Paul and Orlic)
     27            models for the calculation of hadronc shell ionisation CS
     28
     2929.04.2010, L. Pandola, tag emlowen-V09-03-29
     30            Removed the compiler warning in G4PenelopeIonisationModel.cc which
     31            caused the rejection of emlowen-V09-03-28
     32
     3323.04.2010, L. Pandola, tag emlowen-V09-03-28
     34            Removed useless call in G4PenelopeIonisationModel which triggered fake
     35            warning messages
     36
     3715.04.2010, L. Pandola, tag emlowen-V09-03-27
     38            Added MinEnergyCut() method to G4PenelopeIonisationModel. Small (minor)
     39            changes to other G4Penelope models (mainly clean-up)
     40
     4108.04.2010, S. Incerti, tag emlowen-V09-03-26
     42            Changed computation of scattering angle in G4DNAChampionElasticModel.cc
     43            G4EMLOW 6.12 version needed
     44 
     4507.04.2010, S. Incerti, tag emlowen-V09-03-25
     46            Fixed memory leak in G4DNARuddIonisationModel.cc
     47
     4806.04.2010, S. Incerti, tag emlowen-V09-03-24
     49            Replaced hard coded masses in G4DNADingfelderCharge*.cc
     50
     5131.03.2010, L. Pandola, tag emlowen-V09-03-23
     52            Removed G4cout's used for debugging in G4Penelope08ComptonModel and
     53            G4Penelope08PhotoElectricModel
     54
     5527.03.2010, S. Incerti, tag emlowen-V09-03-22
     56            Modified G4DNABornIonisationModel.hh
     57
     5827.03.2010, S. Incerti, tag emlowen-V09-03-21
     59            Modified method declaration in G4DNABornExcitation.hh
     60
     6127.03.2010, S. Incerti, tag emlowen-V09-03-20
     62            Added new excitation model for electrons in G4DNABornExcitationModel
     63
     6426.03.2010, S. Incerti, tag emlowen-V09-03-19
     65            Modified electron correction in G4DNAMillerGreenExcitation.cc
     66
     6726.03.2010, S. Incerti, tag emlowen-V09-03-18
     68            Extended range of search for maximum of DCS in G4DNARuddIonisationModel.cc           
     69
     7026.03.2010, S. Incerti, tag emlowen-V09-03-17
     71            Changed default parameters of G4DNAEmfietzoglouExcitationModel.hh
     72
     7326.03.2010, tag emlowen-V09-03-16
     74            - S. Incerti : corrected G4DNABornIonisationModel.cc class
     75                           for maximum kinetic energy transfer
     76            - A. Mantero: fixed bugs in G4AtomicDeexcitation.cc, G4AugerTransition.cc
     77
     7826.03.2010, L. Pandola, tag emlowen-V09-03-15
     79            Changed order in some models' constructor to get rid of a valgrind
     80            warning (conditional jump or move depends on unitialized value(s)).
     81
     8225.03.2010, S. Incerti, tag emlowen-V09-03-14
     83            Modified hydrogen correction in G4DNARuddIonisation.cc
     84
     8525.03.2010, S. Incerti, tag emlowen-V09-03-13
     86            Dummy tag
     87
     8818.03.2010, S. Incerti, tag emlowen-V09-03-12
     89            - Re-added vapor water shell constants to G4DNARuddIonisationModel.cc
     90            as suggested by Ziad.
     91
     9218.03.2010, S. Incerti, tag emlowen-V09-03-11
     93            Extended low energy cover of G4DNA charge change processes
     94
     9517.03.2010, L. Pandola, tag emlowen-V09-03-10
     96            Added four new models (gamma ray models Compton, GammaConversion,
     97            PhotoElectric, Rayleigh), upgrades of G4Penelope from version2001 to
     98            version 2008. For now, 2008 models named as G4Penelope08xxxxModel
     99            ** to be used with G4LEDATA version 6.10 **
     100
     10116.03.2010, L. Pandola, tag emlowen-V09-03-09
     102            Modified public interface of G4PenelopeOscillatorManager (info to be used for
     103            PenelopeIonisation)
     104
     10515.03.2010, S. Incerti, tag emlowen-V09-03-08
     106            Modified electron correction in G4DNARuddIonisationModel.cc
     107
     10815.03.2010, L. Pandola tag emlowen-V09-03-07
     109            Updated public interface of G4LivermorePhotoElectricModel. Removed
     110            possibility to use custom cuts for fluorescence/Auger. Main cuts from
     111            G4ProductionCutsTable are always used - for consistency.
     112
     11315.03.2010, L. Pandola tag emlowen-V09-03-06
     114            Clean-up in Penelope models (explicitely set Auger flag to false in
     115            constructor)
     116
     11719.02.2010, L. Pandola tag emlowen-V09-03-05
     118            Modification in calculations made by G4PenelopeOscillatorManager (Hartree
     119            factors for Penelope Compton Scattering)
     120
     12117.02.2010, L. Pandola tag emlowen-V09-03-04
     122            Updated interface for G4PenelopeOscillatorManager. Still *beta*
     123
     12405.02.2010, S. Incerti, tag emlowen-V09-03-03
     125            Added initialisation to atomTotalCrossSection in G4hShellCrossSectionDoubleExp.cc.
     126
     12707.01.2010, S. Incerti, tag emlowen-V09-03-02
     128            Improved way of testing material in Geant4-DNA models.
     129
     13021.12.2009, L. Pandola, tag emlowen-V09-03-01
     131            Added classes G4PenelopeOscillator* to manage multi-element atomic oscillators used
     132            in Penelope Compton and Ionisation models. Already compliant with Penelope2008.
     133            **Beta version at the moment**
     134
     13521.12.2009, L. Pandola, tag emlowen-V09-03-00
     136            Added a dummy ComputeCrossSectionPerAtom() method in G4PenelopeRayleighModel.
     137            Never inkoved by tracking, issues a warning if users access it via G4EmCalculator.
    19138
    2013910.12.2009, S. Incerti, tag emlowen-V09-02-68
  • trunk/source/processes/electromagnetic/lowenergy/include/G4AtomicDeexcitation.hh

    r1228 r1315  
    2626//
    2727// $Id: G4AtomicTransitionManager.hh,v 1.2 ????
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Authors: Elena Guardincerri (Elena.Guardincerri@ge.infn.it)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4AtomicTransitionManager.hh

    r1228 r1315  
    2626//
    2727// $Id: G4AtomicTransitionManager.hh,v 1.2 ????
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Authors: Elena Guardincerri (Elena.Guardincerri@ge.infn.it)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4AugerData.hh

    r1228 r1315  
    2525//
    2626// $Id: G4AugerData.hh
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// Author: Alfonso Mantero (Alfonso.Mantero@ge.infn.it)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4BremsstrahlungParameters.hh

    r1228 r1315  
    2626//
    2727// $Id: G4BremsstrahlungParameters.hh,v 1.10 2006/06/29 19:33:06 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CompositeEMDataSet.hh

    r1228 r1315  
    2626//
    2727// $Id: G4CompositeEMDataSet.hh,v 1.13 2009/09/25 07:41:34 sincerti Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionChargeDecrease.hh

    r1228 r1315  
    2525//
    2626// $Id: G4CrossSectionChargeDecrease.hh,v 1.2 2008/07/14 20:47:32 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#ifndef G4CROSSSECTIONCHARGEDECREASE_HH
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionChargeDecreasePartial.hh

    r1228 r1315  
    2525//
    2626// $Id: G4CrossSectionChargeDecreasePartial.hh,v 1.2 2008/07/14 20:47:32 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#ifndef G4CROSSSECTIONCHARGEDECREASEPARTIAL_HH
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionChargeIncrease.hh

    r1228 r1315  
    2525//
    2626// $Id: G4CrossSectionChargeIncrease.hh,v 1.2 2008/07/14 20:47:33 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#ifndef G4CROSSSECTIONCHARGEIncrease_HH
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionChargeIncreasePartial.hh

    r1228 r1315  
    2525//
    2626// $Id: G4CrossSectionChargeIncreasePartial.hh,v 1.2 2008/07/14 20:47:33 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#ifndef G4CROSSSECTIONCHARGEIncreasePARTIAL_HH
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionChargeTransferCH.hh

    r1228 r1315  
    2626//
    2727// $Id: G4CrossSectionChargeTransferCH.hh,v 1.3 2008/03/25 16:00:20 pia Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionChargeTransferExp.hh

    r1228 r1315  
    2626//
    2727// $Id: G4CrossSectionChargeTransferExp.hh,v 1.2 2008/03/25 16:00:20 pia Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionElasticChampion.hh

    r1228 r1315  
    2525//
    2626// $Id: G4CrossSectionElasticChampion.hh,v 1.1 2008/07/15 19:56:50 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828// -------------------------------------------------------------------
    2929
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionElasticScreenedRutherford.hh

    r1228 r1315  
    2626//
    2727// $Id: G4CrossSectionElasticScreenedRutherford.hh,v 1.1 2007/10/12 23:07:10 pia Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionElasticScreenedRutherfordHE.hh

    r1228 r1315  
    2525//
    2626// $Id: G4CrossSectionElasticScreenedRutherfordHE.hh,v 1.1 2008/06/27 20:09:54 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#ifndef G4CROSSSECTIONELASTICSCREENEDRUTHERFORDHE_HH
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionElasticScreenedRutherfordLE.hh

    r1228 r1315  
    2525//
    2626// $Id: G4CrossSectionElasticScreenedRutherfordLE.hh,v 1.2 2008/07/14 20:47:33 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#ifndef G4CROSSSECTIONELASTICSCREENEDRUTHERFORDLE_HH
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionExcitationBorn.hh

    r1228 r1315  
    2525//
    2626// $Id: G4CrossSectionExcitationBorn.hh,v 1.2 2008/07/14 20:47:34 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#ifndef G4CROSSSECTIONEXCITATIONBORN_HH
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionExcitationBornPartial.hh

    r1228 r1315  
    2525//
    2626// $Id: G4CrossSectionExcitationBornPartial.hh,v 1.2 2008/07/14 20:47:34 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#ifndef G4CROSSSECTIONEXCITATIONBORNPARTIAL_HH
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionExcitationEmfietzoglou.hh

    r1228 r1315  
    2525//
    2626// $Id: G4CrossSectionExcitationEmfietzoglou.hh,v 1.3 2008/07/14 20:47:34 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#ifndef G4CROSSSECTIONEXCITATIONEMFIETZOGLOU_HH
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionExcitationEmfietzoglouPartial.hh

    r1228 r1315  
    2525//
    2626// $Id: G4CrossSectionExcitationEmfietzoglouPartial.hh,v 1.2 2008/07/14 20:47:34 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#ifndef G4CROSSSECTIONEXCITATIONEMFIETZOGLOUPARTIAL_HH
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionExcitationMillerGreenPartial.hh

    r1228 r1315  
    2525//
    2626// $Id: G4CrossSectionExcitationMillerGreenPartial.hh,v 1.2 2008/07/14 20:47:34 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#ifndef G4CROSSSECTIONEXCITATIONMILLERGREENPARTIAL_HH
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionHandler.hh

    r1228 r1315  
    2626//
    2727// $Id: G4CrossSectionHandler.hh,v 1.9 2006/06/29 19:33:10 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionIonisationBorn.hh

    r1228 r1315  
    2626//
    2727// $Id: G4CrossSectionIonisationBorn.hh,v 1.3 2008/12/18 13:01:22 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929
    3030#ifndef G4CROSSSECTIONIONISATIONBORN_HH
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionIonisationBornElectron.hh

    r1228 r1315  
    2626//
    2727// $Id: G4CrossSectionIonisationBornElectron.hh,v 1.1 2007/10/15 08:33:25 pia Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionIonisationBornPartial.hh

    r1228 r1315  
    2525//
    2626// $Id: G4CrossSectionIonisationBornPartial.hh,v 1.2 2008/07/14 20:47:34 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#ifndef G4CROSSSECTIONIONISATIONBORNPARTIAL_HH
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionIonisationBornPartialElectron.hh

    r1228 r1315  
    2626//
    2727// $Id: G4CrossSectionIonisationBornPartialElectron.hh,v 1.1 2007/10/15 08:33:25 pia Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionIonisationRudd.hh

    r1228 r1315  
    2525//
    2626// $Id: G4CrossSectionIonisationRudd.hh,v 1.2 2008/07/14 20:47:34 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#ifndef G4CROSSSECTIONIONISATIONRUDD_HH
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionIonisationRuddPartial.hh

    r1228 r1315  
    2525//
    2626// $Id: G4CrossSectionIonisationRuddPartial.hh,v 1.2 2008/07/14 20:47:34 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#ifndef G4CROSSSECTIONIONISATIONRuddPARTIAL_HH
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionKill.hh

    r1228 r1315  
    2626//
    2727// $Id: G4CrossSectionKill.hh,v 1.1 2007/11/09 20:26:47 pia Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionPsCreationChampion.hh

    r1228 r1315  
    2525//
    2626// $Id: G4CrossSectionPsCreationChampion.hh,v 1.1 2008/07/16 19:01:07 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828// -------------------------------------------------------------------
    2929
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionPsCreationChampionPartial.hh

    r1228 r1315  
    2525//
    2626// $Id: G4CrossSectionPsCreationChampionPartial.hh,v 1.1 2008/07/16 19:01:07 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828// -------------------------------------------------------------------
    2929
  • trunk/source/processes/electromagnetic/lowenergy/include/G4DNABornExcitationModel.hh

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4DNABornExcitationModel.hh,v 1.1 2009/01/12 14:26:02 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4DNABornExcitationModel.hh,v 1.4 2010/03/27 12:46:51 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929
     
    3737#include "G4DNACrossSectionDataSet.hh"
    3838#include "G4LogLogInterpolation.hh"
     39#include "G4Electron.hh"
    3940#include "G4Proton.hh"
    4041#include "G4WaterExcitationStructure.hh"
     
    5051  virtual ~G4DNABornExcitationModel();
    5152
    52   virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&);
     53  virtual void Initialise(const G4ParticleDefinition*, const G4DataVector& = *(new G4DataVector()) );
    5354
    5455  virtual G4double CrossSectionPerVolume(const G4Material* material,
     
    7071private:
    7172
    72   G4double lowEnergyLimit;
    73   G4double highEnergyLimit;
     73  std::map<G4String,G4double,std::less<G4String> > lowEnergyLimit;
     74  std::map<G4String,G4double,std::less<G4String> > highEnergyLimit;
     75
    7476  G4bool isInitialised;
    7577  G4int verboseLevel;
     
    7779  // Cross section
    7880
    79   G4DNACrossSectionDataSet* table;
     81  typedef std::map<G4String,G4String,std::less<G4String> > MapFile;
     82  MapFile tableFile;
     83
     84  typedef std::map<G4String,G4DNACrossSectionDataSet*,std::less<G4String> > MapData;
     85  MapData tableData;
    8086
    8187  // Partial cross section
    8288 
    83   G4int RandomSelect(G4double energy);
     89  G4int RandomSelect(G4double energy,const G4String& particle );
    8490 
    8591  // Final state
     
    8793  G4WaterExcitationStructure waterStructure;
    8894   
    89   // Test water material
    90    
    91   G4bool flagMaterialIsWater;
    92   G4double densityWater;
    93    
    9495  //
    95    
     96 
    9697  G4DNABornExcitationModel & operator=(const  G4DNABornExcitationModel &right);
    9798  G4DNABornExcitationModel(const  G4DNABornExcitationModel&);
  • trunk/source/processes/electromagnetic/lowenergy/include/G4DNABornIonisationModel.hh

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4DNABornIonisationModel.hh,v 1.3 2009/06/26 10:15:19 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4DNABornIonisationModel.hh,v 1.5 2010/03/28 18:33:19 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929
     
    5555  virtual ~G4DNABornIonisationModel();
    5656
    57   virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&);
     57  virtual void Initialise(const G4ParticleDefinition*, const G4DataVector& = *(new G4DataVector()));
    5858
    5959  virtual G4double CrossSectionPerVolume(  const G4Material* material,
     
    6868                                 G4double tmin,
    6969                                 G4double maxEnergy);
     70                               
     71  double DifferentialCrossSection(G4ParticleDefinition * aParticleDefinition, G4double k, G4double energyTransfer, G4int shell);
    7072
    7173protected:
     
    98100                                           outgoingParticleEnergy, G4double & cosTheta, G4double & phi );
    99101   
    100   double DifferentialCrossSection(G4ParticleDefinition * aParticleDefinition, G4double k, G4double energyTransfer, G4int shell);
    101 
    102102  G4double LogLogInterpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2);
    103103   
     
    129129  G4int RandomSelect(G4double energy,const G4String& particle );
    130130
    131   // Test water material
    132    
    133   G4bool flagMaterialIsWater;
    134   G4double densityWater;
    135    
    136131  //
    137132   
  • trunk/source/processes/electromagnetic/lowenergy/include/G4DNAChampionElasticModel.hh

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4DNAChampionElasticModel.hh,v 1.1 2009/01/12 14:26:02 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4DNAChampionElasticModel.hh,v 1.3 2010/04/08 17:30:16 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929
     
    4545
    4646  G4DNAChampionElasticModel(const G4ParticleDefinition* p = 0,
    47                           const G4String& nam = "DNAChampionElasticModel");
     47                            const G4String& nam = "DNAChampionElasticModel");
    4848
    4949  virtual ~G4DNAChampionElasticModel();
     
    5252
    5353  virtual G4double CrossSectionPerVolume(const G4Material* material,
    54                                            const G4ParticleDefinition* p,
    55                                            G4double ekin,
    56                                            G4double emin,
    57                                            G4double emax);
     54                                         const G4ParticleDefinition* p,
     55                                         G4double ekin,
     56                                         G4double emin,
     57                                         G4double emax);
    5858
    5959  virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*,
     
    8686  // Final state
    8787
    88   G4double DifferentialCrossSection(G4ParticleDefinition * aParticleDefinition, G4double k, G4double theta);
     88  //G4double DifferentialCrossSection(G4ParticleDefinition * aParticleDefinition, G4double k, G4double theta);
    8989
     90  G4double Theta(G4ParticleDefinition * aParticleDefinition, G4double k, G4double integrDiff);
     91 
     92  G4double LinLinInterpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2);
     93
     94  G4double LinLogInterpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2);
     95   
    9096  G4double LogLogInterpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2);
    91    
    92   G4double LinLogInterpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2);
    9397   
    9498  G4double QuadInterpolator(G4double e11,
     
    115119  G4double RandomizeCosTheta(G4double k);
    116120   
    117   // Test water material
    118    
    119   G4bool flagMaterialIsWater;
    120   G4double densityWater;
    121    
    122121  //
    123122   
  • trunk/source/processes/electromagnetic/lowenergy/include/G4DNAChargeDecrease.hh

    r1228 r1315  
    2525//
    2626// $Id: G4DNAChargeDecrease.hh,v 1.2 2009/03/04 13:28:49 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
  • trunk/source/processes/electromagnetic/lowenergy/include/G4DNAChargeIncrease.hh

    r1228 r1315  
    2525//
    2626// $Id: G4DNAChargeIncrease.hh,v 1.2 2009/03/04 13:28:49 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
  • trunk/source/processes/electromagnetic/lowenergy/include/G4DNACrossSectionDataSet.hh

    r1228 r1315  
    2626//
    2727// $Id: G4DNACrossSectionDataSet.hh,v 1.7 2009/09/25 07:41:34 sincerti Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: Riccardo Capra <capra@ge.infn.it>
  • trunk/source/processes/electromagnetic/lowenergy/include/G4DNADingfelderChargeDecreaseModel.hh

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4DNADingfelderChargeDecreaseModel.hh,v 1.1 2009/01/12 14:26:02 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4DNADingfelderChargeDecreaseModel.hh,v 1.2 2010/01/07 18:10:19 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929
     
    104104  G4double OutgoingParticleBindingEnergyConstant(G4ParticleDefinition* particleDefinition, G4int finalStateIndex);
    105105 
    106   // Test water material
    107    
    108   G4bool flagMaterialIsWater;
    109   G4double densityWater;
    110    
    111106  //
    112107   
  • trunk/source/processes/electromagnetic/lowenergy/include/G4DNADingfelderChargeIncreaseModel.hh

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4DNADingfelderChargeIncreaseModel.hh,v 1.1 2009/01/12 14:26:02 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4DNADingfelderChargeIncreaseModel.hh,v 1.2 2010/01/07 18:10:19 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929
     
    107107  G4double IncomingParticleBindingEnergyConstant(G4ParticleDefinition* particleDefinition, G4int finalStateIndex);
    108108 
    109   // Test water material
    110    
    111   G4bool flagMaterialIsWater;
    112   G4double densityWater;
    113    
    114109  //
    115110   
  • trunk/source/processes/electromagnetic/lowenergy/include/G4DNAElastic.hh

    r1228 r1315  
    2525//
    2626// $Id: G4DNAElastic.hh,v 1.2 2009/03/04 13:28:49 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
  • trunk/source/processes/electromagnetic/lowenergy/include/G4DNAEmfietzoglouExcitationModel.hh

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4DNAEmfietzoglouExcitationModel.hh,v 1.1 2009/01/12 14:26:02 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4DNAEmfietzoglouExcitationModel.hh,v 1.3 2010/03/26 19:52:44 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929
     
    5050  virtual ~G4DNAEmfietzoglouExcitationModel();
    5151
    52   virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&);
     52  virtual void Initialise(const G4ParticleDefinition*, const G4DataVector& = *(new G4DataVector()) );
    5353
    5454  virtual G4double CrossSectionPerVolume(const G4Material* material,
     
    8989  G4WaterExcitationStructure waterExcitation;
    9090 
    91   // Test water material
    92    
    93   G4bool flagMaterialIsWater;
    94   G4double densityWater;
    95    
    9691  //
    9792   
  • trunk/source/processes/electromagnetic/lowenergy/include/G4DNAExcitation.hh

    r1228 r1315  
    2525//
    2626// $Id: G4DNAExcitation.hh,v 1.2 2009/03/04 13:28:49 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
  • trunk/source/processes/electromagnetic/lowenergy/include/G4DNAGenericIonsManager.hh

    r1228 r1315  
    2626//
    2727// $Id: G4DNAGenericIonsManager.hh,v 1.4 2009/06/10 13:32:58 mantero Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929
    3030#ifndef   G4DNAGENERICIONSMANAGER_HH
  • trunk/source/processes/electromagnetic/lowenergy/include/G4DNAIonisation.hh

    r1228 r1315  
    2525//
    2626// $Id: G4DNAIonisation.hh,v 1.3 2009/03/04 13:28:49 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
  • trunk/source/processes/electromagnetic/lowenergy/include/G4DNAMillerGreenExcitationModel.hh

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4DNAMillerGreenExcitationModel.hh,v 1.1 2009/01/12 14:26:03 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4DNAMillerGreenExcitationModel.hh,v 1.2 2010/01/07 18:10:19 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929
     
    115115  G4double sCoefficient[3][4];
    116116
    117   // Final state
    118  
    119   // Test water material
    120    
    121   G4bool flagMaterialIsWater;
    122   G4double densityWater;
    123    
    124117  //
    125118   
  • trunk/source/processes/electromagnetic/lowenergy/include/G4DNAProcess.hh

    r1228 r1315  
    2626//
    2727// $Id: G4DNAProcess.hh,v 1.5 2007/11/09 16:20:04 pia Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author:  Maria Grazia Pia (Maria.Grazia.Pia@ge.infn.it)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4DNAProcess.icc

    r1228 r1315  
    2626//
    2727// $Id: G4DNAProcess.icc,v 1.12 2009/01/20 07:50:28 sincerti Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4DNARuddIonisationModel.hh

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4DNARuddIonisationModel.hh,v 1.3 2009/06/26 09:42:32 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4DNARuddIonisationModel.hh,v 1.4 2010/01/07 18:10:19 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929
     
    148148  G4int RandomSelect(G4double energy,const G4String& particle );
    149149 
    150   // Test water material
    151    
    152   G4bool flagMaterialIsWater;
    153   G4double densityWater;
    154    
    155150  //
    156151   
  • trunk/source/processes/electromagnetic/lowenergy/include/G4DNAScreenedRutherfordElasticModel.hh

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4DNAScreenedRutherfordElasticModel.hh,v 1.1 2009/01/12 14:26:03 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4DNAScreenedRutherfordElasticModel.hh,v 1.2 2010/01/07 18:10:19 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929
     
    9393  G4double ScreenedRutherfordRandomizeCosTheta(G4double k, G4double z);
    9494
    95   // Test water material
    96    
    97   G4bool flagMaterialIsWater;
    98   G4double densityWater;
    99    
    10095  //
    10196   
  • trunk/source/processes/electromagnetic/lowenergy/include/G4DopplerProfile.hh

    r1228 r1315  
    2626//
    2727// $Id: G4DopplerProfile.hh,v 1.2 2008/03/17 13:45:25 pia Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4DummyFinalState.hh

    r1228 r1315  
    2626//
    2727// $Id: G4DummyFinalState.hh,v 1.2 2007/10/07 12:52:18 pia Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4EMDataSet.hh

    r1228 r1315  
    2626//
    2727// $Id: G4EMDataSet.hh,v 1.13 2009/09/25 07:41:34 sincerti Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4FinalStateChargeDecrease.hh

    r1228 r1315  
    2525//
    2626// $Id: G4FinalStateChargeDecrease.hh,v 1.2 2008/07/14 20:47:34 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#ifndef G4FINALSTATECHARGEDECREASE_HH
  • trunk/source/processes/electromagnetic/lowenergy/include/G4FinalStateChargeIncrease.hh

    r1228 r1315  
    2525//
    2626// $Id: G4FinalStateChargeIncrease.hh,v 1.2 2008/07/14 20:47:34 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#ifndef G4FINALSTATECHARGEIncrease_HH
  • trunk/source/processes/electromagnetic/lowenergy/include/G4FinalStateChargeTransferProton.hh

    r1228 r1315  
    2626//
    2727// $Id: G4FinalStateChargeTransferProton.hh,v 1.2 2008/03/25 16:00:20 pia Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4FinalStateElasticBrennerZaider.hh

    r1228 r1315  
    2525//
    2626// $Id: G4FinalStateElasticBrennerZaider.hh,v 1.2 2008/07/14 20:47:34 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#ifndef G4FINALSTATEELASTICBRENNERZAIDER_HH
  • trunk/source/processes/electromagnetic/lowenergy/include/G4FinalStateElasticChampion.hh

    r1228 r1315  
    2525//
    2626// $Id: G4FinalStateElasticChampion.hh,v 1.1 2008/07/15 19:56:50 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828// -------------------------------------------------------------------
    2929
  • trunk/source/processes/electromagnetic/lowenergy/include/G4FinalStateElasticScreenedRutherford.hh

    r1228 r1315  
    2525//
    2626// $Id: G4FinalStateElasticScreenedRutherford.hh,v 1.3 2008/07/14 20:47:34 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#ifndef G4FINALSTATEELASTICSCREENEDRUTHERFORD_HH
  • trunk/source/processes/electromagnetic/lowenergy/include/G4FinalStateExcitationBorn.hh

    r1228 r1315  
    2525//
    2626// $Id: G4FinalStateExcitationBorn.hh,v 1.2 2008/07/14 20:47:34 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#ifndef G4FINALSTATEEXCITATIONBORN_HH
  • trunk/source/processes/electromagnetic/lowenergy/include/G4FinalStateExcitationEmfietzoglou.hh

    r1228 r1315  
    2525//
    2626// $Id: G4FinalStateExcitationEmfietzoglou.hh,v 1.2 2008/07/14 20:47:34 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#ifndef G4FINALSTATEEXCITATIONEMFIETZOGLOU_HH
  • trunk/source/processes/electromagnetic/lowenergy/include/G4FinalStateExcitationMillerGreen.hh

    r1228 r1315  
    2525//
    2626// $Id: G4FinalStateExcitationMillerGreen.hh,v 1.2 2008/07/14 20:47:34 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#ifndef G4FINALSTATEEXCITATIONMILLERGREEN_HH
  • trunk/source/processes/electromagnetic/lowenergy/include/G4FinalStateIonisationBorn.hh

    r1228 r1315  
    2525//
    2626// $Id: G4FinalStateIonisationBorn.hh,v 1.4 2008/07/14 20:47:34 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#ifndef G4FINALSTATEIONISATIONBORN_HH
  • trunk/source/processes/electromagnetic/lowenergy/include/G4FinalStateIonisationRudd.hh

    r1228 r1315  
    2525//
    2626// $Id: G4FinalStateIonisationRudd.hh,v 1.4 2008/07/14 20:47:34 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929
  • trunk/source/processes/electromagnetic/lowenergy/include/G4FinalStateKill.hh

    r1228 r1315  
    2626//
    2727// $Id: G4FinalStateKill.hh,v 1.1 2007/11/09 20:26:47 pia Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4FinalStateProduct.hh

    r1228 r1315  
    2626//
    2727// $Id: G4FinalStateProduct.hh,v 1.5 2009/01/20 07:50:28 sincerti Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4FinalStatePsCreationChampion.hh

    r1228 r1315  
    2525//
    2626// $Id: G4FinalStatePsCreationChampion.hh,v 1.1 2008/07/16 19:01:07 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828// -------------------------------------------------------------------
    2929
  • trunk/source/processes/electromagnetic/lowenergy/include/G4FluoTransition.hh

    r1228 r1315  
    2626//
    2727// $Id: G4FluoTransition.hh,v 1.2 ????
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: Elena Guardincerri (Elena.Guardincerri@ge.infn.it)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4LinInterpolation.hh

    r1228 r1315  
    2626//
    2727// $Id: G4LinInterpolation.hh,v 1.4 2009/09/25 07:41:34 sincerti Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4LivermoreBremsstrahlungModel.hh

    r1228 r1315  
    2525//
    2626// $Id: G4LivermoreBremsstrahlungModel.hh,v 1.2 2009/04/17 10:29:20 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// Author: Luciano Pandola
  • trunk/source/processes/electromagnetic/lowenergy/include/G4LivermoreComptonModel.hh

    r1228 r1315  
    2525//
    2626// $Id: G4LivermoreComptonModel.hh,v 1.3 2009/04/17 10:29:20 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929//
  • trunk/source/processes/electromagnetic/lowenergy/include/G4LivermoreGammaConversionModel.hh

    r1228 r1315  
    2525//
    2626// $Id: G4LivermoreGammaConversionModel.hh,v 1.3 2009/04/17 10:29:20 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929
  • trunk/source/processes/electromagnetic/lowenergy/include/G4LivermoreIonisationModel.hh

    r1228 r1315  
    2525//
    2626// $Id: G4LivermoreIonisationModel.hh,v 1.3 2009/10/23 09:28:37 pandola Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// Author: Luciano Pandola
  • trunk/source/processes/electromagnetic/lowenergy/include/G4LivermorePhotoElectricModel.hh

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4LivermorePhotoElectricModel.hh,v 1.3 2009/04/17 10:29:20 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4LivermorePhotoElectricModel.hh,v 1.4 2010/03/15 09:02:29 pandola Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
     29// 15-Mar-2010   L. Pandola, removed methods to set explicitely fluorescence cuts.
     30//               Main cuts from G4ProductionCutsTable are always used
     31//
     32
    2933
    3034#ifndef G4LivermorePhotoElectricModel_h
     
    7680                                 G4double maxEnergy);
    7781
    78   void SetCutForLowEnSecPhotons(G4double);
    79 
    80   void SetCutForLowEnSecElectrons(G4double);
    81 
    8282  void ActivateAuger(G4bool);
    8383
     
    8989
    9090  G4ParticleChangeForGamma* fParticleChange;
    91   /*
    92   G4double GetMeanFreePath(const G4Track& aTrack,
    93                            G4double previousStepSize,
    94                            G4ForceCondition* condition);
    95   */
     91
     92
    9693private:
    9794
     
    106103  G4VCrossSectionHandler* crossSectionHandler;
    107104  G4VCrossSectionHandler* shellCrossSectionHandler;
    108 
    109   G4double cutForLowEnergySecondaryPhotons;
    110   G4double cutForLowEnergySecondaryElectrons;
    111105
    112106  G4AtomicDeexcitation deexcitationManager;
  • trunk/source/processes/electromagnetic/lowenergy/include/G4LivermorePolarizedComptonModel.hh

    r1228 r1315  
    2525//
    2626// $Id: G4LivermorePolarizedComptonModel.hh,v 1.3 2009/05/02 15:20:52 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929
  • trunk/source/processes/electromagnetic/lowenergy/include/G4LivermorePolarizedGammaConversionModel.hh

    r1228 r1315  
    2525//
    2626// $Id: G4LivermorePolarizedGammaConversionModel.hh,v 1.1 2009/10/30 14:52:05 flongo Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929
  • trunk/source/processes/electromagnetic/lowenergy/include/G4LivermorePolarizedPhotoElectricModel.hh

    r1228 r1315  
    2525//
    2626// $Id: G4LivermorePolarizedPhotoElectricModel.hh,v 1.1 2009/10/30 14:52:05 flongo Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929
  • trunk/source/processes/electromagnetic/lowenergy/include/G4LivermorePolarizedRayleighModel.hh

    r1228 r1315  
    2525//
    2626// $Id: G4LivermorePolarizedRayleighModel.hh,v 1.3 2009/05/02 15:20:52 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929
  • trunk/source/processes/electromagnetic/lowenergy/include/G4LivermoreRayleighModel.hh

    r1228 r1315  
    2525//
    2626// $Id: G4LivermoreRayleighModel.hh,v 1.3 2009/04/17 10:29:20 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929
  • trunk/source/processes/electromagnetic/lowenergy/include/G4LogLogInterpolation.hh

    r1228 r1315  
    2626//
    2727// $Id: G4LogLogInterpolation.hh,v 1.7 2009/09/25 07:41:34 sincerti Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4LowEnergyBremsstrahlung.hh

    r1228 r1315  
    2727// -------------------------------------------------------------------
    2828// $Id: G4LowEnergyBremsstrahlung.hh,v 1.37 2006/06/29 19:35:55 gunter Exp $
    29 // GEANT4 tag $Name: geant4-09-03 $
     29// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    3030//
    3131// Author: A. Forti
  • trunk/source/processes/electromagnetic/lowenergy/include/G4LowEnergyCompton.hh

    r1228 r1315  
    2525//
    2626// $Id: G4LowEnergyCompton.hh,v 1.24 2008/11/04 10:14:00 pandola Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// Author: A. Forti
  • trunk/source/processes/electromagnetic/lowenergy/include/G4LowEnergyGammaConversion.hh

    r1228 r1315  
    2626//
    2727// $Id: G4LowEnergyGammaConversion.hh,v 1.15 2006/06/29 19:35:59 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: A. Forti
  • trunk/source/processes/electromagnetic/lowenergy/include/G4LowEnergyIonisation.hh

    r1228 r1315  
    2626// -------------------------------------------------------------------
    2727// $Id: G4LowEnergyIonisation.hh,v 1.41 2006/06/29 19:36:01 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: A. Forti
  • trunk/source/processes/electromagnetic/lowenergy/include/G4LowEnergyPhotoElectric.hh

    r1228 r1315  
    2626//
    2727// $Id: G4LowEnergyPhotoElectric.hh,v 1.28 2006/06/29 19:36:03 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: A. Forti
  • trunk/source/processes/electromagnetic/lowenergy/include/G4LowEnergyPolarizedCompton.hh

    r1228 r1315  
    2626//
    2727// $Id: G4LowEnergyPolarizedCompton.hh,v 1.10 2008/05/02 13:04:41 flongo Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// ------------------------------------------------------------
  • trunk/source/processes/electromagnetic/lowenergy/include/G4LowEnergyPolarizedRayleigh.hh

    r1228 r1315  
    2525//
    2626// $Id: G4LowEnergyPolarizedRayleigh.hh,v 1.5 2006/06/29 19:36:07 gunter Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// --------------------------------------------------------------
  • trunk/source/processes/electromagnetic/lowenergy/include/G4LowEnergyRayleigh.hh

    r1228 r1315  
    2626//
    2727// $Id: G4LowEnergyRayleigh.hh,v 1.16 2006/06/29 19:36:09 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
  • trunk/source/processes/electromagnetic/lowenergy/include/G4OrlicLiCrossSection.hh

    r1197 r1315  
    2525//
    2626// $Id: G4OrlicLiCrossSection.hh,v 1.2 2009/06/11 15:46:18 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03-cand-01 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// Author: Haifa Ben Abdelouahed
  • trunk/source/processes/electromagnetic/lowenergy/include/G4PaulKCrossSection.hh

    r1228 r1315  
    2525//
    2626//
     27// History:
     28// -----------
     29//  21 Apr 2008   H. Abdelohauwed - 1st implementation
     30//  29 Apr 2009   ALF  Major Design Revision
     31//
     32// -------------------------------------------------------------------
     33
     34// Class description:
     35// Low Energy Electromagnetic Physics, Cross section, p ionisation, K shell
     36// Further documentation available from http://www.ge.infn.it/geant4/lowE
     37
     38// -------------------------------------------------------------------
    2739
    2840
     
    3042#define G4PAULKCROSSSECTION_HH 1
    3143
     44//#include "G4VDataSetAlgorithm.hh"
    3245#include "globals.hh"
     46#include <map>
    3347
     48class G4VDataSetAlgorithm;
     49class G4VEMDataSet;
    3450
    3551class G4PaulKCrossSection
     
    4258  virtual ~G4PaulKCrossSection();
    4359                             
    44   G4double CalculateKCrossSection(G4int zTarget,G4int zIncident, G4double energyIncident);
     60  G4double CalculateKCrossSection(G4int zTarget,G4double massIncident, G4double energyIncident);
    4561                                   
    4662 
    47 
    48    
    49 
    5063private:
    5164
     
    5467  G4PaulKCrossSection & operator = (const G4PaulKCrossSection &right);
    5568
     69  G4VDataSetAlgorithm* interpolation;
     70
     71  std::map< G4int , G4VEMDataSet* > protonDataSetMap;
     72
     73  std::map< G4int , G4VEMDataSet* > alphaDataSetMap;
     74 
     75
    5676};
    5777
  • trunk/source/processes/electromagnetic/lowenergy/include/G4PenelopeAnnihilationModel.hh

    r1228 r1315  
    2525//
    2626// $Id: G4PenelopeAnnihilationModel.hh,v 1.1 2008/11/04 10:14:56 pandola Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// Author: Luciano Pandola
  • trunk/source/processes/electromagnetic/lowenergy/include/G4PenelopeBremsstrahlung.hh

    r1228 r1315  
    2727// -------------------------------------------------------------------
    2828// $Id: G4PenelopeBremsstrahlung.hh,v 1.8 2006/06/29 19:36:15 gunter Exp $
    29 // GEANT4 tag $Name: geant4-09-03 $
     29// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    3030//
    3131// Author: L.Pandola
  • trunk/source/processes/electromagnetic/lowenergy/include/G4PenelopeBremsstrahlungAngular.hh

    r1228 r1315  
    2727// -------------------------------------------------------------------
    2828// $Id: G4PenelopeBremsstrahlungAngular.hh,v 1.3 2006/06/29 19:36:17 gunter Exp $
    29 // GEANT4 tag $Name: geant4-09-03 $
     29// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    3030//
    3131// Author: L.Pandola
  • trunk/source/processes/electromagnetic/lowenergy/include/G4PenelopeBremsstrahlungContinuous.hh

    r1228 r1315  
    2727// -------------------------------------------------------------------
    2828// $Id: G4PenelopeBremsstrahlungContinuous.hh,v 1.4 2008/12/09 15:04:05 pandola Exp $
    29 // GEANT4 tag $Name: geant4-09-03 $
     29// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    3030//
    3131// Author: L.Pandola
  • trunk/source/processes/electromagnetic/lowenergy/include/G4PenelopeBremsstrahlungModel.hh

    r1228 r1315  
    2525//
    2626// $Id: G4PenelopeBremsstrahlungModel.hh,v 1.2 2009/04/17 10:29:20 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// Author: Luciano Pandola
  • trunk/source/processes/electromagnetic/lowenergy/include/G4PenelopeCompton.hh

    r1228 r1315  
    2525//
    2626// $Id: G4PenelopeCompton.hh,v 1.11 2008/03/26 15:30:19 pandola Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// Author: Luciano Pandola
  • trunk/source/processes/electromagnetic/lowenergy/include/G4PenelopeComptonModel.hh

    r1228 r1315  
    2525//
    2626// $Id: G4PenelopeComptonModel.hh,v 1.3 2009/10/21 14:56:47 pandola Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// Author: Luciano Pandola
  • trunk/source/processes/electromagnetic/lowenergy/include/G4PenelopeGammaConversion.hh

    r1228 r1315  
    2626//
    2727// $Id: G4PenelopeGammaConversion.hh,v 1.2 2006/06/29 19:36:25 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: L. Pandola
  • trunk/source/processes/electromagnetic/lowenergy/include/G4PenelopeGammaConversionModel.hh

    r1228 r1315  
    2525//
    2626// $Id: G4PenelopeGammaConversionModel.hh,v 1.1 2008/10/28 08:50:21 pandola Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// Author: Luciano Pandola
  • trunk/source/processes/electromagnetic/lowenergy/include/G4PenelopeIonisation.hh

    r1228 r1315  
    2626// -------------------------------------------------------------------
    2727// $Id: G4PenelopeIonisation.hh,v 1.5 2006/06/29 19:36:33 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: L. Pandola
  • trunk/source/processes/electromagnetic/lowenergy/include/G4PenelopeIonisationModel.hh

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PenelopeIonisationModel.hh,v 1.3 2009/10/21 14:56:47 pandola Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4PenelopeIonisationModel.hh,v 1.5 2010/04/15 10:02:10 pandola Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// Author: Luciano Pandola
     
    3636//                            AtomicDeexcitationFlag - now demanded to G4VEmModel
    3737//                            Add ActivateAuger() method
     38// 29 Mar 2010   L. Pandola   Added a dummy ComputeCrossSectioPerAtom() method issueing a
     39//                            warning if users try to access atomic cross sections via
     40//                            G4EmCalculator
     41// 15 Apr 2010   L. Pandola   Implemented model's own version of MinEnergyCut()
    3842//
    3943// -------------------------------------------------------------------
     
    7377  virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&);
    7478
     79  //*This is a dummy method. Never inkoved by the tracking, it just issues
     80  //*a warning if one tries to get Cross Sections per Atom via the
     81  //*G4EmCalculator.
     82  virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
     83                                              G4double,
     84                                              G4double,
     85                                              G4double,
     86                                              G4double,
     87                                              G4double);
     88
    7589  virtual G4double CrossSectionPerVolume(const G4Material* material,
    7690                                         const G4ParticleDefinition* theParticle,
     
    90104                               G4double cutEnergy);
    91105                               
     106  // Min cut in kinetic energy allowed by the model
     107  virtual G4double MinEnergyCut(const G4ParticleDefinition*,
     108                                const G4MaterialCutsCouple*);
     109
    92110  void SetVerbosityLevel(G4int lev){verboseLevel = lev;};
    93111  G4int GetVerbosityLevel(){return verboseLevel;};
  • trunk/source/processes/electromagnetic/lowenergy/include/G4PenelopePhotoElectric.hh

    r1228 r1315  
    2626//
    2727// $Id: G4PenelopePhotoElectric.hh,v 1.4 2006/06/29 19:36:35 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: L.Pandola
  • trunk/source/processes/electromagnetic/lowenergy/include/G4PenelopePhotoElectricModel.hh

    r1228 r1315  
    2525//
    2626// $Id: G4PenelopePhotoElectricModel.hh,v 1.2 2009/10/21 10:47:02 pandola Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// Author: Luciano Pandola
  • trunk/source/processes/electromagnetic/lowenergy/include/G4PenelopeRayleigh.hh

    r1228 r1315  
    2626//
    2727// $Id: G4PenelopeRayleigh.hh,v 1.5 2006/06/29 19:36:37 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: Luciano Pandola
  • trunk/source/processes/electromagnetic/lowenergy/include/G4PenelopeRayleighModel.hh

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PenelopeRayleighModel.hh,v 1.1 2008/10/28 08:50:21 pandola Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4PenelopeRayleighModel.hh,v 1.3 2010/04/15 10:02:25 pandola Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// Author: Luciano Pandola
     
    3333// 13 Oct 2008   L. Pandola   1st implementation. Migration from EM process
    3434//                            to EM model
     35// 18 Dec 2009   L. Pandola   Added a dummy ComputeCrossSectioPerAtom() method issueing a
     36//                            warning if users try to access atomic cross sections via
     37//                            G4EmCalculator
    3538//
    3639// -------------------------------------------------------------------
     
    3841// Class description:
    3942// Low Energy Electromagnetic Physics, Rayleigh Scattering
    40 // with Penelope Model
     43// with Penelope v2001 Model
    4144// -------------------------------------------------------------------
    4245
     
    7174                                         G4double maxEnergy = DBL_MAX);
    7275 
     76  //*This is a dummy method. Never inkoved by the tracking, it just issues
     77  //*a warning if one tries to get Cross Sections per Atom via the
     78  //*G4EmCalculator.
     79  virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
     80                                              G4double,
     81                                              G4double,
     82                                              G4double,
     83                                              G4double,
     84                                              G4double);
     85
    7386  virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*,
    7487                                 const G4MaterialCutsCouple*,
  • trunk/source/processes/electromagnetic/lowenergy/include/G4RangeNoTest.hh

    r1228 r1315  
    2626//
    2727// $Id: G4RangeNoTest.hh,v 1.4 2006/06/29 19:36:47 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4RangeTest.hh

    r1228 r1315  
    2626//
    2727// $Id: G4RangeTest.hh,v 1.4 2006/06/29 19:36:49 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4RayleighScattering.hh

    r1228 r1315  
    2626//
    2727// $Id: G4RayleighScattering.hh,v 1.2 2009/03/18 13:45:51 pandola Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//------------------ G4RayleighScattering physics process -----------------------
  • trunk/source/processes/electromagnetic/lowenergy/include/G4SemiLogInterpolation.hh

    r1228 r1315  
    2626//
    2727// $Id: G4SemiLogInterpolation.hh,v 1.5 2009/09/25 07:41:34 sincerti Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4ShellData.hh

    r1228 r1315  
    2626//
    2727// $Id: G4ShellData.hh,v 1.7 2008/03/17 13:45:25 pia Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4ShellEMDataSet.hh

    r1228 r1315  
    2626//
    2727// $Id: G4ShellEMDataSet.hh,v 1.13 2009/09/25 07:41:34 sincerti Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4VCrossSectionHandler.hh

    r1228 r1315  
    2626//
    2727// $Id: G4VCrossSectionHandler.hh,v 1.15 2009/09/25 07:41:34 sincerti Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4VDataSetAlgorithm.hh

    r1228 r1315  
    2626//
    2727// $Id: G4VDataSetAlgorithm.hh,v 1.8 2009/09/25 07:41:34 sincerti Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4VEMDataSet.hh

    r1228 r1315  
    2626//
    2727// $Id: G4VEMDataSet.hh,v 1.13 2009/09/25 07:41:34 sincerti Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4VLowEnergyDiscretePhotonProcess.hh

    r1228 r1315  
    2525//
    2626// $Id: G4VLowEnergyDiscretePhotonProcess.hh,v 1.4 2006/06/29 19:37:13 gunter Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// --------------------------------------------------------------
  • trunk/source/processes/electromagnetic/lowenergy/include/G4VLowEnergyTestableDiscreteProcess.hh

    r1228 r1315  
    2626//
    2727// $Id: G4VLowEnergyTestableDiscreteProcess.hh,v 1.3 2006/06/29 19:37:17 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030
  • trunk/source/processes/electromagnetic/lowenergy/include/G4VRangeTest.hh

    r1228 r1315  
    2626//
    2727// $Id: G4VRangeTest.hh,v 1.3 2006/06/29 19:37:21 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4VeLowEnergyLoss.hh

    r1228 r1315  
    2626//
    2727// $Id: G4VeLowEnergyLoss.hh,v 1.9 2006/06/29 19:37:23 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// 3.4.2000 Veronique Lefebure:
  • trunk/source/processes/electromagnetic/lowenergy/include/G4WaterExcitationStructure.hh

    r1228 r1315  
    2626//
    2727// $Id: G4WaterExcitationStructure.hh,v 1.1 2007/10/15 08:33:25 pia Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4WaterIonisationStructure.hh

    r1228 r1315  
    2626//
    2727// $Id: G4WaterIonisationStructure.hh,v 1.1 2007/11/08 20:38:40 pia Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4eBremsstrahlungSpectrum.hh

    r1228 r1315  
    2525//
    2626// $Id: G4eBremsstrahlungSpectrum.hh,v 1.8 2006/06/29 19:37:33 gunter Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
  • trunk/source/processes/electromagnetic/lowenergy/include/G4eCrossSectionExcitationEmfietzoglou.hh

    r1228 r1315  
    2626//
    2727// $Id: G4eCrossSectionExcitationEmfietzoglou.hh,v 1.1 2007/05/02 17:18:48 pia Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4eCrossSectionScreenedRutherford.hh

    r1228 r1315  
    2626//
    2727// $Id: G4eCrossSectionScreenedRutherford.hh,v 1.2 2007/10/12 12:26:34 pia Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4eIonisationCrossSectionHandler.hh

    r1228 r1315  
    2525//
    2626// $Id: G4eIonisationCrossSectionHandler.hh,v 1.7 2009/01/29 08:13:27 pandola Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
  • trunk/source/processes/electromagnetic/lowenergy/include/G4eIonisationParameters.hh

    r1228 r1315  
    2626//
    2727// $Id: G4eIonisationParameters.hh,v 1.8 2006/06/29 19:37:38 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4eIonisationSpectrum.hh

    r1228 r1315  
    2525//
    2626// $Id: G4eIonisationSpectrum.hh,v 1.7 2006/06/29 19:37:40 gunter Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
  • trunk/source/processes/electromagnetic/lowenergy/include/G4eLowEnergyLoss.hh

    r1228 r1315  
    2626//
    2727// $Id: G4eLowEnergyLoss.hh,v 1.14 2006/06/29 19:37:42 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// -------------------------------------------------------------------
  • trunk/source/processes/electromagnetic/lowenergy/include/G4eLowEnergyLoss.icc

    r1228 r1315  
    2626//
    2727// $Id: G4eLowEnergyLoss.icc,v 1.8 2006/06/29 19:37:44 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// ---------------------------------------------------------------
  • trunk/source/processes/electromagnetic/lowenergy/include/G4empCrossSection.hh

    r1197 r1315  
    2525//
    2626// $Id: G4empCrossSection.hh,v 1.1 2009/06/17 16:39:55 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03-cand-01 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929//         
  • trunk/source/processes/electromagnetic/lowenergy/include/G4hLowEnergyIonisation.hh

    r1228 r1315  
    5050// 26 Feb    2002 V.Ivanchenko Add initialMass for GenericIons
    5151// 21 Jan    2003 V.Ivanchenko Cut per region
     52// 03 Oct    2009 ALF added SelectShellIonisationCS
    5253// ------------------------------------------------------------
    5354 
     
    175176  // This method switch on/off simulation of the fluorescence of the media.
    176177
     178  void SelectShellIonisationCS(G4String);
     179
     180
    177181  G4VParticleChange* AlongStepDoIt(const G4Track& trackData ,
    178182                                   const G4Step& stepData ) ;
     
    260264                                                  G4double hMass,
    261265                                                  G4double eLoss);
     266
    262267
    263268  G4int SelectRandomAtom(const G4MaterialCutsCouple* couple,
     
    314319  std::vector<G4VEMDataSet*> zFluoDataVector;
    315320  G4bool theFluo;
    316   G4bool expFlag;
    317321};
    318322
  • trunk/source/processes/electromagnetic/lowenergy/include/G4hLowEnergyLoss.hh

    r1228 r1315  
    2626//
    2727// $Id: G4hLowEnergyLoss.hh,v 1.17 2006/06/29 19:37:58 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// $Id:
  • trunk/source/processes/electromagnetic/lowenergy/include/G4hLowEnergyLoss.icc

    r1228 r1315  
    2626//
    2727// $Id: G4hLowEnergyLoss.icc,v 1.3 2006/06/29 19:38:00 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// $Id:
  • trunk/source/processes/electromagnetic/lowenergy/include/G4hShellCrossSectionDoubleExp.hh

    r1228 r1315  
    4545// -------------------------------------------------------------------
    4646// $Id: G4hShellCrossSectionDoubleExp.hh,v 1.3 2006/06/29 19:38:12 gunter Exp $
    47 // GEANT4 tag $Name: geant4-09-03 $
     47// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    4848
    4949#ifndef G4HSHELLCROSSSECTIONDOUBLEEXP_HH
  • trunk/source/processes/electromagnetic/lowenergy/include/G4hShellCrossSectionDoubleExpData.hh

    r1228 r1315  
    4040// -------------------------------------------------------------------
    4141// $Id: G4hShellCrossSectionDoubleExpData.hh,v 1.3 2006/06/29 19:38:14 gunter Exp $
    42 // GEANT4 tag $Name: geant4-09-03 $
     42// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    4343
    4444#ifndef G4hShellCrossSectionDoubleExpData_HH
  • trunk/source/processes/electromagnetic/lowenergy/include/G4hShellCrossSectionExp.hh

    r1228 r1315  
    4545// -------------------------------------------------------------------
    4646// $Id: G4hShellCrossSectionExp.hh,v 1.3 2006/06/29 19:38:16 gunter Exp $
    47 // GEANT4 tag $Name: geant4-09-03 $
     47// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    4848
    4949#ifndef G4HSHELLCROSSSECTIONEXP_HH
  • trunk/source/processes/electromagnetic/lowenergy/include/G4hShellCrossSectionExpData.hh

    r1228 r1315  
    3838// -------------------------------------------------------------------
    3939// $Id: G4hShellCrossSectionExpData.hh,v 1.3 2006/06/29 19:38:18 gunter Exp $
    40 // GEANT4 tag $Name: geant4-09-03 $
     40// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    4141
    4242#ifndef G4hShellCrossSectionExpData_HH
  • trunk/source/processes/electromagnetic/lowenergy/include/G4teoCrossSection.hh

    r1197 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4teoCrossSection.hh,v 1.4 2009/06/25 15:52:08 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03-cand-01 $
     26// $Id: G4teoCrossSection.hh,v 1.5 2010/06/06 23:40:35 mantero Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929//         
     
    4949#include "G4VhShellCrossSection.hh"
    5050
    51 #include "G4ecpssrKCrossSection.hh"
    52 #include "G4ecpssrLiCrossSection.hh"
     51#include "G4AnalyticalEcpssrKCrossSection.hh"
     52#include "G4AnalyticalEcpssrLiCrossSection.hh"
    5353
    5454class G4teoCrossSection : public G4VhShellCrossSection
     
    8181  G4double totalCS;
    8282             
    83   G4ecpssrKCrossSection*  ecpssrShellK;
    84   G4ecpssrLiCrossSection*  ecpssrShellLi;
     83  G4VecpssrKModel*  ecpssrShellK;
     84  G4VecpssrLiModel*  ecpssrShellLi;
    8585                       
    8686                       
  • trunk/source/processes/electromagnetic/lowenergy/src/G4AtomicDeexcitation.cc

    r1228 r1315  
    2626//
    2727// $Id: G4AtomicDeexcitation.cc,v 1.11
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Authors: Elena Guardincerri (Elena.Guardincerri@ge.infn.it)
     
    384384     
    385385      G4int numberOfPossibleAuger = 0;
    386       numberOfPossibleAuger = anAugerTransition->AugerTransitionProbabilities(transitionRandomShellId)->size();
    387 
    388 
     386     
    389387      G4bool foundFlag = false;
    390388
  • trunk/source/processes/electromagnetic/lowenergy/src/G4AtomicTransitionManager.cc

    r1228 r1315  
    2626//
    2727// $Id: G4AtomicTransitionManager.cc,v 1.2 ????
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Authors: Elena Guardincerri (Elena.Guardincerri@ge.infn.it)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4AugerTransition.cc

    r819 r1315  
    9797{
    9898  std::map<G4int,G4DataVector,std::less<G4int> >::const_iterator shellId = augerTransitionEnergiesMap.find(startShellId);
     99
     100  if (shellId == augerTransitionEnergiesMap.end() )
     101    {G4Exception("G4AugerTransition: corresponding map element not found");}
     102
    99103  const G4DataVector* dataSet = &(*shellId).second;
    100104
     
    103107}
    104108
    105 // Returns the emission probabilities of the auger electrons, given th shell
     109// Returns the emission probabilities of the auger electrons, given the shell
    106110// from wich the transition electron cames from.
    107111
    108112const G4DataVector* G4AugerTransition::AugerTransitionProbabilities(G4int startShellId) const
    109113{
     114
     115  //debugging
     116  //if (startShellId == 1){G4cout <<"OI!!!"<< G4endl;}
     117
    110118  std::map<G4int,G4DataVector,std::less<G4int> >::const_iterator shellId = augerTransitionProbabilitiesMap.find(startShellId);
     119
     120  if (shellId == augerTransitionProbabilitiesMap.end() )
     121    {G4Exception("G4AugerTransition: corresponding map element not found");}
     122 
    111123  const G4DataVector* dataSet = &(*shellId).second;
     124  // debugging purpose:
     125  /*  G4cout << "id: " << shellId->first << G4endl;
     126  G4cout << "size:" << dataSet->size() << G4endl;
     127  for (G4int i = 0; i < dataSet->size(); i++){
     128    G4cout << (dataSet[0])[i] << G4endl;
     129    }*/
    112130  return dataSet;
    113131}
  • trunk/source/processes/electromagnetic/lowenergy/src/G4BremsstrahlungCrossSectionHandler.cc

    r1228 r1315  
    2525//
    2626// $Id: G4BremsstrahlungCrossSectionHandler.cc,v 1.12 2009/09/27 10:47:42 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
  • trunk/source/processes/electromagnetic/lowenergy/src/G4BremsstrahlungParameters.cc

    r1228 r1315  
    2626//
    2727// $Id: G4BremsstrahlungParameters.cc,v 1.20 2009/06/10 13:32:36 mantero Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CompositeEMDataSet.cc

    r1228 r1315  
    2626//
    2727// $Id: G4CompositeEMDataSet.cc,v 1.15 2009/09/25 07:41:34 sincerti Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionChargeDecrease.cc

    r1228 r1315  
    2525//
    2626// $Id: G4CrossSectionChargeDecrease.cc,v 1.7 2009/06/11 15:47:08 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#include "G4CrossSectionChargeDecrease.hh"
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionChargeDecreasePartial.cc

    r1228 r1315  
    2525//
    2626// $Id: G4CrossSectionChargeDecreasePartial.cc,v 1.3 2009/06/10 13:32:36 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#include "G4CrossSectionChargeDecreasePartial.hh"
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionChargeIncrease.cc

    r1228 r1315  
    2525//
    2626// $Id: G4CrossSectionChargeIncrease.cc,v 1.7 2009/06/11 15:47:08 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#include "G4CrossSectionChargeIncrease.hh"
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionChargeIncreasePartial.cc

    r1228 r1315  
    2525//
    2626// $Id: G4CrossSectionChargeIncreasePartial.cc,v 1.3 2009/06/10 13:32:36 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#include "G4CrossSectionChargeIncreasePartial.hh"
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionChargeTransferCH.cc

    r1228 r1315  
    2626//
    2727// $Id: G4CrossSectionChargeTransferCH.cc,v 1.4 2009/06/10 13:32:36 mantero Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionChargeTransferExp.cc

    r1228 r1315  
    2626//
    2727// $Id: G4CrossSectionChargeTransferExp.cc,v 1.6 2009/06/10 13:32:36 mantero Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionElasticChampion.cc

    r1228 r1315  
    2525//
    2626// $Id: G4CrossSectionElasticChampion.cc,v 1.7 2009/06/11 15:47:08 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828// -------------------------------------------------------------------
    2929
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionElasticScreenedRutherford.cc

    r1228 r1315  
    2626//
    2727// $Id: G4CrossSectionElasticScreenedRutherford.cc,v 1.1 2007/10/12 23:11:41 pia Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionElasticScreenedRutherfordHE.cc

    r1228 r1315  
    2525//
    2626// $Id: G4CrossSectionElasticScreenedRutherfordHE.cc,v 1.5 2009/06/11 15:47:08 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#include "G4CrossSectionElasticScreenedRutherfordHE.hh"
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionElasticScreenedRutherfordLE.cc

    r1228 r1315  
    2525//
    2626// $Id: G4CrossSectionElasticScreenedRutherfordLE.cc,v 1.5 2009/06/11 15:47:08 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#include "G4CrossSectionElasticScreenedRutherfordLE.hh"
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionExcitationBorn.cc

    r1228 r1315  
    2525//
    2626// $Id: G4CrossSectionExcitationBorn.cc,v 1.7 2009/06/11 15:47:08 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#include "G4CrossSectionExcitationBorn.hh"
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionExcitationBornPartial.cc

    r1228 r1315  
    2525//
    2626// $Id: G4CrossSectionExcitationBornPartial.cc,v 1.4 2009/06/10 13:32:36 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#include "G4CrossSectionExcitationBornPartial.hh"
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionExcitationEmfietzoglou.cc

    r1228 r1315  
    2525//
    2626// $Id: G4CrossSectionExcitationEmfietzoglou.cc,v 1.8 2009/06/11 15:47:08 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#include "G4CrossSectionExcitationEmfietzoglou.hh"
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionExcitationEmfietzoglouPartial.cc

    r1228 r1315  
    2525//
    2626// $Id: G4CrossSectionExcitationEmfietzoglouPartial.cc,v 1.4 2009/06/10 13:32:36 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#include "G4CrossSectionExcitationEmfietzoglouPartial.hh"
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionExcitationMillerGreen.cc

    r1228 r1315  
    2525//
    2626// $Id: G4CrossSectionExcitationMillerGreen.cc,v 1.7 2009/06/11 15:47:08 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#include "G4CrossSectionExcitationMillerGreen.hh"
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionExcitationMillerGreenPartial.cc

    r1228 r1315  
    2525//
    2626// $Id: G4CrossSectionExcitationMillerGreenPartial.cc,v 1.4 2009/06/10 13:32:36 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#include "G4CrossSectionExcitationMillerGreenPartial.hh"
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionHandler.cc

    r1228 r1315  
    2626//
    2727// $Id: G4CrossSectionHandler.cc,v 1.21 2009/09/27 10:47:42 sincerti Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionIonisationBorn.cc

    r1228 r1315  
    2525//
    2626// $Id: G4CrossSectionIonisationBorn.cc,v 1.7 2009/06/11 15:47:08 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#include "G4CrossSectionIonisationBorn.hh"
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionIonisationBornElectron.cc

    r1228 r1315  
    2626//
    2727// $Id: G4CrossSectionIonisationBornElectron.cc,v 1.2 2007/11/08 18:51:34 pia Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionIonisationBornPartial.cc

    r1228 r1315  
    2525//
    2626// $Id: G4CrossSectionIonisationBornPartial.cc,v 1.6 2009/06/10 13:32:36 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#include "G4CrossSectionIonisationBornPartial.hh"
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionIonisationBornPartialElectron.cc

    r1228 r1315  
    2626//
    2727// $Id: G4CrossSectionIonisationBornPartialElectron.cc,v 1.1 2007/10/15 08:57:54 pia Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionIonisationRudd.cc

    r1228 r1315  
    2525//
    2626// $Id: G4CrossSectionIonisationRudd.cc,v 1.7 2009/06/11 15:47:08 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#include "G4CrossSectionIonisationRudd.hh"
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionIonisationRuddPartial.cc

    r1228 r1315  
    2525//
    2626// $Id: G4CrossSectionIonisationRuddPartial.cc,v 1.5 2009/06/10 13:32:36 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#include "G4CrossSectionIonisationRuddPartial.hh"
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionKill.cc

    r1228 r1315  
    2626//
    2727// $Id: G4CrossSectionKill.cc,v 1.1 2007/11/09 20:26:12 pia Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionPsCreationChampion.cc

    r1228 r1315  
    2525//
    2626// $Id: G4CrossSectionPsCreationChampion.cc,v 1.2 2009/06/10 13:32:36 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828// -------------------------------------------------------------------
    2929
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionPsCreationChampionPartial.cc

    r1228 r1315  
    2525//
    2626// $Id: G4CrossSectionPsCreationChampionPartial.cc,v 1.2 2009/06/10 13:32:36 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828// -------------------------------------------------------------------
    2929
  • trunk/source/processes/electromagnetic/lowenergy/src/G4DNABornExcitationModel.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4DNABornExcitationModel.cc,v 1.7 2009/08/31 14:03:29 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4DNABornExcitationModel.cc,v 1.9 2010/03/27 11:32:41 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929
     
    4040:G4VEmModel(nam),isInitialised(false)
    4141{
    42 
    43   lowEnergyLimit = 500 * keV;
    44   highEnergyLimit = 100 * MeV;
    45   SetLowEnergyLimit(lowEnergyLimit);
    46   SetHighEnergyLimit(highEnergyLimit);
    47 
    4842  verboseLevel= 0;
    4943  // Verbosity scale:
     
    5448  // 4 = entering in methods
    5549 
    56   //
    57  
    58   table = 0;
    59  
    60   //
    61  
    6250  if( verboseLevel>0 )
    6351  {
    64     G4cout << "Born excitation model is constructed " << G4endl
    65            << "Energy range: "
    66            << lowEnergyLimit / keV << " keV - "
    67            << highEnergyLimit / MeV << " MeV"
    68            << G4endl;
     52    G4cout << "Born excitation model is constructed " << G4endl;
    6953  }
    7054 
     
    7660{
    7761  // Cross section
    78   delete table;
    79 }
    80 
    81 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    82 
    83 void G4DNABornExcitationModel::Initialise(const G4ParticleDefinition* /*particle*/,
     62 
     63  std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos;
     64  for (pos = tableData.begin(); pos != tableData.end(); ++pos)
     65  {
     66    G4DNACrossSectionDataSet* table = pos->second;
     67    delete table;
     68  }
     69
     70}
     71
     72//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     73
     74void G4DNABornExcitationModel::Initialise(const G4ParticleDefinition* particle,
    8475                                       const G4DataVector& /*cuts*/)
    8576{
     
    8980
    9081  // Energy limits
    91  
    92   if (LowEnergyLimit() < lowEnergyLimit)
    93   {
    94     G4cout << "G4DNABornExcitationModel: low energy limit increased from " <<
    95         LowEnergyLimit()/keV << " keV to " << lowEnergyLimit/keV << " keV" << G4endl;
    96     SetLowEnergyLimit(lowEnergyLimit);
    97   }
    98 
    99   if (HighEnergyLimit() > highEnergyLimit)
    100   {
    101     G4cout << "G4DNABornExcitationModel: high energy limit decreased from " <<
    102         HighEnergyLimit()/MeV << " MeV to " << highEnergyLimit/MeV << " MeV" << G4endl;
    103     SetHighEnergyLimit(highEnergyLimit);
    104   }
    105 
    106   //
    107  
    108   if (table == 0)
    109   {
    110     table = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,(1e-22/3.343)*m*m );
    111     table->LoadData("dna/sigma_excitation_p_born");
     82  // Energy limits
     83
     84  G4String fileElectron("dna/sigma_excitation_e_born");
     85  G4String fileProton("dna/sigma_excitation_p_born");
     86
     87  G4ParticleDefinition* electronDef = G4Electron::ElectronDefinition();
     88  G4ParticleDefinition* protonDef = G4Proton::ProtonDefinition();
     89
     90  G4String electron;
     91  G4String proton;
     92 
     93  G4double scaleFactor = (1.e-22 / 3.343) * m*m;
     94
     95  if (electronDef != 0)
     96  {
     97    electron = electronDef->GetParticleName();
     98
     99    tableFile[electron] = fileElectron;
     100
     101    lowEnergyLimit[electron] = 9. * eV;
     102    highEnergyLimit[electron] = 1. * MeV;
     103
     104    // Cross section
     105   
     106    G4DNACrossSectionDataSet* tableE = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor );
     107    tableE->LoadData(fileElectron);
     108     
     109    tableData[electron] = tableE;
     110   
     111  }
     112  else
     113  {
     114    G4Exception("G4DNABornExcitationModel::Initialise(): electron is not defined");
     115  }
     116
     117  if (protonDef != 0)
     118  {
     119    proton = protonDef->GetParticleName();
     120
     121    tableFile[proton] = fileProton;
     122
     123    lowEnergyLimit[proton] = 500. * keV;
     124    highEnergyLimit[proton] = 100. * MeV;
     125
     126    // Cross section
     127   
     128    G4DNACrossSectionDataSet* tableP = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor );
     129    tableP->LoadData(fileProton);
     130     
     131    tableData[proton] = tableP;
     132     
     133  }
     134  else
     135  {
     136    G4Exception("G4DNABornExcitationModel::Initialise(): proton is not defined");
     137  }
     138
     139  if (particle==electronDef)
     140  {
     141    SetLowEnergyLimit(lowEnergyLimit[electron]);
     142    SetHighEnergyLimit(highEnergyLimit[electron]);
     143  }
     144
     145  if (particle==protonDef)
     146  {
     147    SetLowEnergyLimit(lowEnergyLimit[proton]);
     148    SetHighEnergyLimit(highEnergyLimit[proton]);
    112149  }
    113150
     
    116153    G4cout << "Born excitation model is initialized " << G4endl
    117154           << "Energy range: "
    118            << LowEnergyLimit() / keV << " keV - "
    119            << HighEnergyLimit() / MeV << " MeV " << G4endl;
    120   }
     155           << LowEnergyLimit() / eV << " eV - "
     156           << HighEnergyLimit() / keV << " keV for "
     157           << particle->GetParticleName()
     158           << G4endl;
     159  }
     160 
    121161 
    122162  if(!isInitialised)
     
    131171
    132172  // InitialiseElementSelectors(particle,cuts);
    133  
    134   // Test if water material
    135 
    136   flagMaterialIsWater= false;
    137   densityWater = 0;
    138 
    139   const G4ProductionCutsTable* theCoupleTable = G4ProductionCutsTable::GetProductionCutsTable();
    140 
    141   if(theCoupleTable)
    142   {
    143     G4int numOfCouples = theCoupleTable->GetTableSize();
    144  
    145     if(numOfCouples>0)
    146     {
    147           for (G4int i=0; i<numOfCouples; i++)
    148           {
    149             const G4MaterialCutsCouple* couple = theCoupleTable->GetMaterialCutsCouple(i);
    150             const G4Material* material = couple->GetMaterial();
    151 
    152             if (material->GetName() == "G4_WATER")
    153             {
    154               G4double density = material->GetAtomicNumDensityVector()[1];
    155               flagMaterialIsWater = true;
    156               densityWater = density;
    157              
    158               if (verboseLevel > 3)
    159               G4cout << "****** Water material is found with density(cm^-3)=" << density/(cm*cm*cm) << G4endl;
    160             }
    161  
    162           }
    163 
    164     } // if(numOfCouples>0)
    165 
    166   } // if (theCoupleTable)
    167 
    168 }
    169 
    170 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    171 
    172 G4double G4DNABornExcitationModel::CrossSectionPerVolume(const G4Material*,
     173
     174}
     175
     176//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     177
     178G4double G4DNABornExcitationModel::CrossSectionPerVolume(const G4Material* material,
    173179                                           const G4ParticleDefinition* particleDefinition,
    174                                            G4double k,
     180                                           G4double ekin,
    175181                                           G4double,
    176182                                           G4double)
     
    179185    G4cout << "Calling CrossSectionPerVolume() of G4DNABornExcitationModel" << G4endl;
    180186
     187  if (
     188      particleDefinition != G4Proton::ProtonDefinition()
     189      &&
     190      particleDefinition != G4Electron::ElectronDefinition()
     191     )
     192           
     193    return 0;
     194
    181195 // Calculate total cross section for model
    182196
    183   G4double crossSection=0;
    184  
    185   if (flagMaterialIsWater)
    186   {
    187     if (particleDefinition == G4Proton::ProtonDefinition())
    188     {
    189       if (k >= lowEnergyLimit && k < highEnergyLimit)
     197  G4double lowLim = 0;
     198  G4double highLim = 0;
     199  G4double sigma=0;
     200
     201  if (material->GetName() == "G4_WATER")
     202  {
     203    const G4String& particleName = particleDefinition->GetParticleName();
     204 
     205    std::map< G4String,G4double,std::less<G4String> >::iterator pos1;
     206    pos1 = lowEnergyLimit.find(particleName);
     207    if (pos1 != lowEnergyLimit.end())
     208    {
     209      lowLim = pos1->second;
     210    }
     211 
     212    std::map< G4String,G4double,std::less<G4String> >::iterator pos2;
     213    pos2 = highEnergyLimit.find(particleName);
     214    if (pos2 != highEnergyLimit.end())
     215    {
     216      highLim = pos2->second;
     217    }
     218
     219    if (ekin >= lowLim && ekin < highLim)
     220    {
     221      std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos;
     222      pos = tableData.find(particleName);
     223       
     224      if (pos != tableData.end())
    190225      {
    191         crossSection = table->FindValue(k);
     226        G4DNACrossSectionDataSet* table = pos->second;
     227        if (table != 0)
     228        {
     229          sigma = table->FindValue(ekin);
     230        }
    192231      }
    193 
    194       if (verboseLevel > 3)
     232      else
    195233      {
    196         G4cout << "---> Kinetic energy(keV)=" << k/keV << G4endl;
    197         G4cout << " - Cross section per water molecule (cm^2)=" << crossSection/cm/cm << G4endl;
    198         G4cout << " - Cross section per water molecule (cm^-1)=" << crossSection*densityWater/(1./cm) << G4endl;
    199       }
     234        G4Exception("G4DNABornExcitationModel::CrossSectionPerVolume: attempting to calculate cross section for wrong particle");
     235      }
    200236    }
    201   } // if (flagMaterialIsWater)
    202 
    203  return crossSection*densityWater;                 
     237
     238    if (verboseLevel > 3)
     239    {
     240      G4cout << "---> Kinetic energy(eV)=" << ekin/eV << G4endl;
     241      G4cout << " - Cross section per water molecule (cm^2)=" << sigma/cm/cm << G4endl;
     242      G4cout << " - Cross section per water molecule (cm^-1)=" << sigma*material->GetAtomicNumDensityVector()[1]/(1./cm) << G4endl;
     243    }
     244 
     245  } // if (waterMaterial)
     246 
     247 return sigma*material->GetAtomicNumDensityVector()[1];           
     248           
    204249
    205250}
     
    219264  G4double k = aDynamicParticle->GetKineticEnergy();
    220265 
    221   G4int level = RandomSelect(k);
     266  const G4String& particleName = aDynamicParticle->GetDefinition()->GetParticleName();
     267
     268  G4int level = RandomSelect(k,particleName);
    222269  G4double excitationEnergy = waterStructure.ExcitationEnergy(level);
    223270  G4double newEnergy = k - excitationEnergy;
     
    234281//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    235282
    236 G4int G4DNABornExcitationModel::RandomSelect(G4double k)
     283G4int G4DNABornExcitationModel::RandomSelect(G4double k, const G4String& particle)
    237284{   
    238285  G4int level = 0;
    239286
    240   G4double* valuesBuffer = new G4double[table->NumberOfComponents()];
    241 
    242   const size_t n(table->NumberOfComponents());
    243   size_t i(n);
    244   G4double value = 0.;
    245  
    246   while (i>0)
    247   {
    248     i--;
    249     valuesBuffer[i] = table->GetComponent(i)->FindValue(k);
    250     value += valuesBuffer[i];
    251   }
    252  
    253   value *= G4UniformRand();
    254  
    255   i = n;
    256  
    257   while (i > 0)
    258   {
    259     i--;
    260      
    261     if (valuesBuffer[i] > value)
    262     {
    263       delete[] valuesBuffer;
    264       return i;
     287  std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos;
     288  pos = tableData.find(particle);
     289
     290  if (pos != tableData.end())
     291  {
     292    G4DNACrossSectionDataSet* table = pos->second;
     293
     294    if (table != 0)
     295    {
     296      G4double* valuesBuffer = new G4double[table->NumberOfComponents()];
     297      const size_t n(table->NumberOfComponents());
     298      size_t i(n);
     299      G4double value = 0.;
     300           
     301      while (i>0)
     302      {
     303        i--;
     304        valuesBuffer[i] = table->GetComponent(i)->FindValue(k);
     305        value += valuesBuffer[i];
     306      }
     307           
     308      value *= G4UniformRand();
     309   
     310      i = n;
     311           
     312      while (i > 0)
     313      {
     314        i--;
     315
     316        if (valuesBuffer[i] > value)
     317        {
     318          delete[] valuesBuffer;
     319          return i;
     320        }
     321        value -= valuesBuffer[i];
     322      }
     323           
     324      if (valuesBuffer) delete[] valuesBuffer;
     325   
    265326    }
    266       value -= valuesBuffer[i];
    267   }
    268 
    269   if (valuesBuffer) delete[] valuesBuffer;
    270 
     327  }
     328  else
     329  {
     330    G4Exception("G4DNABornExcitationModel::RandomSelect attempting to calculate cross section for wrong particle");
     331  }
    271332  return level;
    272333}
  • trunk/source/processes/electromagnetic/lowenergy/src/G4DNABornIonisationModel.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4DNABornIonisationModel.cc,v 1.14 2009/11/12 03:08:58 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4DNABornIonisationModel.cc,v 1.16 2010/03/26 18:10:43 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929
     
    239239  // InitialiseElementSelectors(particle,cuts);
    240240
    241   // Test if water material
    242 
    243   flagMaterialIsWater= false;
    244   densityWater = 0;
    245 
    246   const G4ProductionCutsTable* theCoupleTable = G4ProductionCutsTable::GetProductionCutsTable();
    247 
    248   if(theCoupleTable)
    249   {
    250     G4int numOfCouples = theCoupleTable->GetTableSize();
    251  
    252     if(numOfCouples>0)
    253     {
    254           for (G4int i=0; i<numOfCouples; i++)
    255           {
    256             const G4MaterialCutsCouple* couple = theCoupleTable->GetMaterialCutsCouple(i);
    257             const G4Material* material = couple->GetMaterial();
    258 
    259             if (material->GetName() == "G4_WATER")
    260             {
    261               G4double density = material->GetAtomicNumDensityVector()[1];
    262               flagMaterialIsWater = true;
    263               densityWater = density;
    264              
    265               if (verboseLevel > 3)
    266               G4cout << "****** Water material is found with density(cm^-3)=" << density/(cm*cm*cm) << G4endl;
    267             }
    268  
    269           }
    270 
    271     } // if(numOfCouples>0)
    272 
    273   } // if (theCoupleTable)
    274 
    275241}
    276242
    277243//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    278244
    279 G4double G4DNABornIonisationModel::CrossSectionPerVolume(const G4Material*,
     245G4double G4DNABornIonisationModel::CrossSectionPerVolume(const G4Material* material,
    280246                                           const G4ParticleDefinition* particleDefinition,
    281247                                           G4double ekin,
     
    300266  G4double sigma=0;
    301267
    302   if (flagMaterialIsWater)
     268  if (material->GetName() == "G4_WATER")
    303269  {
    304270    const G4String& particleName = particleDefinition->GetParticleName();
     
    341307      G4cout << "---> Kinetic energy(eV)=" << ekin/eV << G4endl;
    342308      G4cout << " - Cross section per water molecule (cm^2)=" << sigma/cm/cm << G4endl;
    343       G4cout << " - Cross section per water molecule (cm^-1)=" << sigma*densityWater/(1./cm) << G4endl;
     309      G4cout << " - Cross section per water molecule (cm^-1)=" << sigma*material->GetAtomicNumDensityVector()[1]/(1./cm) << G4endl;
    344310    }
    345311 
    346312  } // if (waterMaterial)
    347313 
    348  return sigma*densityWater;               
     314 return sigma*material->GetAtomicNumDensityVector()[1];           
    349315
    350316}
     
    429395    G4DynamicParticle* dp = new G4DynamicParticle (G4Electron::Electron(),deltaDirection,secondaryKinetic) ;
    430396    fvect->push_back(dp);
    431     /*
    432     // creating neutral water molechule...
    433 
    434     G4DNAGenericMoleculeManager *instance;
    435     instance = G4DNAGenericMoleculeManager::Instance();
    436     G4ParticleDefinition* waterDef = NULL;
    437     G4Molecule* water = instance->GetMolecule("H2O");
    438     waterDef = (G4ParticleDefinition*)water;
    439 
    440     direction.set(0.,0.,0.);
    441 
    442     //G4DynamicParticle* dynamicWater = new G4DynamicParticle(waterDef, direction, bindingEnergy);
    443         G4DynamicMolecule* dynamicWater = new G4DynamicMolecule(water, direction, bindingEnergy);
    444 
    445 
    446         //dynamicWater->RemoveElectron(ionizationShell, 1);
    447 
    448     G4DynamicMolecule* dynamicWater2 = new G4DynamicMolecule(water, direction, bindingEnergy);
    449     G4DynamicMolecule* dynamicWater3 = new G4DynamicMolecule(water, direction, bindingEnergy);
    450 
    451     fvect->push_back(dynamicWater);
    452     fvect->push_back(dynamicWater2);
    453     fvect->push_back(dynamicWater3);
    454     */
     397
    455398  }
    456399
     
    512455  if (particleDefinition == G4Proton::ProtonDefinition())
    513456  {
    514     G4double maximumKineticEnergyTransfer = 4.* (electron_mass_c2 / proton_mass_c2) * k - (waterStructure.IonisationEnergy(shell));
     457    G4double maximumKineticEnergyTransfer = 4.* (electron_mass_c2 / proton_mass_c2) * k;
    515458
    516459    G4double crossSectionMaximum = 0.;
  • trunk/source/processes/electromagnetic/lowenergy/src/G4DNAChampionElasticModel.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4DNAChampionElasticModel.cc,v 1.10 2009/11/03 15:04:25 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4DNAChampionElasticModel.cc,v 1.12 2010/04/08 17:29:08 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929
     
    132132   
    133133    // For final state
    134    
     134
    135135    char *path = getenv("G4LEDATA");
    136136 
     
    139139
    140140    std::ostringstream eFullFileName;
    141     eFullFileName << path << "/dna/sigmadiff_elastic_e_champion.dat";
     141    eFullFileName << path << "/dna/sigmadiff_cumulated_elastic_e_champion.dat";
    142142    std::ifstream eDiffCrossSection(eFullFileName.str().c_str());
    143143     
     
    151151        double eDummy;
    152152        eDiffCrossSection>>tDummy>>eDummy;
    153 
     153       
    154154        // SI : mandatory eVecm initialization
     155       
    155156        if (tDummy != eTdummyVec.back())
    156157        {
     
    161162        eDiffCrossSection>>eDiffCrossSectionData[tDummy][eDummy];
    162163
    163         // SI : only if not end of file reached !
    164         if (!eDiffCrossSection.eof()) eDiffCrossSectionData[tDummy][eDummy]*=scaleFactor;
    165          
    166164        if (eDummy != eVecm[tDummy].back()) eVecm[tDummy].push_back(eDummy);
    167          
     165       
    168166    }
    169167
     
    197195  // InitialiseElementSelectors(particle,cuts);
    198196
    199   // Test if water material
    200 
    201   flagMaterialIsWater= false;
    202   densityWater = 0;
    203 
    204   const G4ProductionCutsTable* theCoupleTable = G4ProductionCutsTable::GetProductionCutsTable();
    205 
    206   if(theCoupleTable)
    207   {
    208     G4int numOfCouples = theCoupleTable->GetTableSize();
    209  
    210     if(numOfCouples>0)
    211     {
    212           for (G4int i=0; i<numOfCouples; i++)
    213           {
    214             const G4MaterialCutsCouple* couple = theCoupleTable->GetMaterialCutsCouple(i);
    215             const G4Material* material = couple->GetMaterial();
    216 
    217             if (material->GetName() == "G4_WATER")
    218             {
    219               G4double density = material->GetAtomicNumDensityVector()[1];
    220               flagMaterialIsWater = true;
    221               densityWater = density;
    222              
    223               if (verboseLevel > 3)
    224               G4cout << "****** Water material is found with density(cm^-3)=" << density/(cm*cm*cm) << G4endl;
    225             }
    226  
    227           }
    228 
    229     } // if(numOfCouples>0)
    230 
    231   } // if (theCoupleTable)
    232 
    233 }
    234 
    235 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    236 
    237 G4double G4DNAChampionElasticModel::CrossSectionPerVolume(const G4Material*,
     197}
     198
     199//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     200
     201G4double G4DNAChampionElasticModel::CrossSectionPerVolume(const G4Material* material,
    238202                                           const G4ParticleDefinition* p,
    239203                                           G4double ekin,
     
    248212 G4double sigma=0;
    249213 
    250  if (flagMaterialIsWater)
     214 if (material->GetName() == "G4_WATER")
    251215 {
    252216  const G4String& particleName = p->GetParticleName();
     
    279243    G4cout << "---> Kinetic energy(eV)=" << ekin/eV << G4endl;
    280244    G4cout << " - Cross section per water molecule (cm^2)=" << sigma/cm/cm << G4endl;
    281     G4cout << " - Cross section per water molecule (cm^-1)=" << sigma*densityWater/(1./cm) << G4endl;
     245    G4cout << " - Cross section per water molecule (cm^-1)=" << sigma*material->GetAtomicNumDensityVector()[1]/(1./cm) << G4endl;
    282246  }
    283247
    284  } // if (flagMaterialIsWater)
     248 }
    285249         
    286  return sigma*densityWater;               
     250 return sigma*material->GetAtomicNumDensityVector()[1];           
    287251}
    288252
     
    310274  if (electronEnergy0>= killBelowEnergy && electronEnergy0 < highEnergyLimit)
    311275  { 
     276 
    312277    G4double cosTheta = RandomizeCosTheta(electronEnergy0);
    313278 
     
    334299//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    335300
    336 G4double G4DNAChampionElasticModel::DifferentialCrossSection
    337   (G4ParticleDefinition * particleDefinition, G4double k, G4double theta)                                                         
    338 {
    339 
    340   G4double sigma = 0.;
     301G4double G4DNAChampionElasticModel::Theta
     302  (G4ParticleDefinition * particleDefinition, G4double k, G4double integrDiff)                                                   
     303{
     304  G4double theta = 0.;
    341305  G4double valueT1 = 0;
    342306  G4double valueT2 = 0;
     
    350314  G4double xs22 = 0;
    351315
    352   //SI : ensure the correct computation of cross section at the 180*deg limit
    353   if (theta==180.) theta=theta-1e-9;
    354 
    355316  if (particleDefinition == G4Electron::ElectronDefinition())
    356317  {
     
    358319    std::vector<double>::iterator t1 = t2-1;
    359320 
    360     std::vector<double>::iterator e12 = std::upper_bound(eVecm[(*t1)].begin(),eVecm[(*t1)].end(), theta);
     321    std::vector<double>::iterator e12 = std::upper_bound(eVecm[(*t1)].begin(),eVecm[(*t1)].end(), integrDiff);
    361322    std::vector<double>::iterator e11 = e12-1;
    362323         
    363     std::vector<double>::iterator e22 = std::upper_bound(eVecm[(*t2)].begin(),eVecm[(*t2)].end(), theta);
     324    std::vector<double>::iterator e22 = std::upper_bound(eVecm[(*t2)].begin(),eVecm[(*t2)].end(), integrDiff);
    364325    std::vector<double>::iterator e21 = e22-1;
    365326               
     
    375336    xs21 = eDiffCrossSectionData[valueT2][valueE21];
    376337    xs22 = eDiffCrossSectionData[valueT2][valueE22];
    377 
    378 }
    379      
    380   G4double xsProduct = xs11 * xs12 * xs21 * xs22;
    381  
    382   if (xs11==0 || xs12==0 ||xs21==0 ||xs22==0) return (0.);
    383      
    384   if (xsProduct != 0.)
    385   {
    386     sigma = QuadInterpolator(  valueE11, valueE12,
     338  }
     339 
     340  if (xs11==0 && xs12==0 && xs21==0 && xs22==0) return (0.);   
     341 
     342  theta = QuadInterpolator   ( valueE11, valueE12,
    387343                               valueE21, valueE22,
    388344                               xs11, xs12,
    389345                               xs21, xs22,
    390346                               valueT1, valueT2,
    391                                k, theta );
    392   }
    393 
    394   return sigma;
     347                               k, integrDiff );
     348                               
     349  return theta;
    395350}
    396351
     
    411366//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    412367
     368G4double G4DNAChampionElasticModel::LinLinInterpolate(G4double e1,
     369                                                        G4double e2,
     370                                                        G4double e,
     371                                                        G4double xs1,
     372                                                        G4double xs2)
     373{
     374  G4double d1 = xs1;
     375  G4double d2 = xs2;
     376  G4double value = (d1 + (d2 - d1)*(e - e1)/ (e2 - e1));
     377  return value;
     378}
     379
     380//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     381
    413382G4double G4DNAChampionElasticModel::LogLogInterpolate(G4double e1,
    414383                                                        G4double e2,
     
    425394
    426395//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     396
    427397
    428398G4double G4DNAChampionElasticModel::QuadInterpolator(G4double e11, G4double e12,
     
    433403                                                       G4double t, G4double e)
    434404{
    435 // Log-Log
     405  // Log-Log
    436406/*
    437407  G4double interpolatedvalue1 = LogLogInterpolate(e11, e12, e, xs11, xs12);
    438408  G4double interpolatedvalue2 = LogLogInterpolate(e21, e22, e, xs21, xs22);
    439409  G4double value = LogLogInterpolate(t1, t2, t, interpolatedvalue1, interpolatedvalue2);
    440 */
    441 
    442 // Lin-Log
     410
     411
     412  // Lin-Log
    443413  G4double interpolatedvalue1 = LinLogInterpolate(e11, e12, e, xs11, xs12);
    444414  G4double interpolatedvalue2 = LinLogInterpolate(e21, e22, e, xs21, xs22);
    445415  G4double value = LinLogInterpolate(t1, t2, t, interpolatedvalue1, interpolatedvalue2);
     416*/
     417
     418  // Lin-Lin
     419  G4double interpolatedvalue1 = LinLinInterpolate(e11, e12, e, xs11, xs12);
     420  G4double interpolatedvalue2 = LinLinInterpolate(e21, e22, e, xs21, xs22);
     421  G4double value = LinLinInterpolate(t1, t2, t, interpolatedvalue1, interpolatedvalue2);
     422
    446423  return value;
    447424}
     
    451428G4double G4DNAChampionElasticModel::RandomizeCosTheta(G4double k)
    452429{
    453  // ***** Similar method as for screened Rutherford scattering
    454 
    455  G4int iMax=180;
    456  G4double max=0;
    457  G4double tmp=0;
    458  
    459  // Look for maximum :
    460  for (G4int i=0; i<iMax; i++)
    461  {
    462    tmp = DifferentialCrossSection(G4Electron::ElectronDefinition(),k/eV,G4double(i)*180./(iMax-1));
    463    if (tmp>max) max = tmp;
    464  }
    465 
    466  G4double oneOverMax=0;
    467  if (max!=0) oneOverMax = 1./max;
    468  
    469  G4double cosTheta = 0.;
    470  G4double fCosTheta = 0.;
    471  
    472  do
    473  {
    474     cosTheta = 2. * G4UniformRand() - 1.;
    475     fCosTheta = oneOverMax * DifferentialCrossSection(G4Electron::ElectronDefinition(),k/eV,std::acos(cosTheta)*180./pi);
    476  }
    477  while (fCosTheta < G4UniformRand());
    478 
    479  if (verboseLevel > 3)
    480  {
    481    G4cout << "---> Cos(theta)=" << cosTheta << G4endl;
    482  }
     430 
     431 G4double integrdiff=0;
     432 G4double uniformRand=G4UniformRand();
     433 integrdiff = uniformRand;
     434 
     435 G4double theta=0.;
     436 G4double cosTheta=0.;
     437 theta = Theta(G4Electron::ElectronDefinition(),k/eV,integrdiff);
     438
     439 cosTheta= std::cos(theta*pi/180);
    483440
    484441 return cosTheta;
  • trunk/source/processes/electromagnetic/lowenergy/src/G4DNAChargeDecrease.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4DNAChargeDecrease.cc,v 1.3 2009/03/04 13:28:49 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4DNAChargeDecrease.cc,v 1.4 2010/03/18 16:36:48 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#include "G4DNAChargeDecrease.hh"
     
    7272    G4String name = p->GetParticleName();
    7373
    74     if( name == "proton" || name == "alpha" || name == "alpha+" )
     74    if( name == "proton" )
     75    {
     76      if(!Model()) SetModel(new G4DNADingfelderChargeDecreaseModel);
     77      Model()->SetLowEnergyLimit(100*eV);
     78      Model()->SetHighEnergyLimit(10*MeV);
     79
     80      AddEmModel(1, Model());   
     81    }
     82   
     83    if( name == "alpha" || name == "alpha+" )
    7584    {
    7685      if(!Model()) SetModel(new G4DNADingfelderChargeDecreaseModel);
  • trunk/source/processes/electromagnetic/lowenergy/src/G4DNAChargeIncrease.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4DNAChargeIncrease.cc,v 1.3 2009/03/04 13:28:49 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4DNAChargeIncrease.cc,v 1.4 2010/03/18 16:36:48 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#include "G4DNAChargeIncrease.hh"
     
    7272    G4String name = p->GetParticleName();
    7373
    74     if( name == "hydrogen" || name =="alpha+" || name =="helium" )
     74    if( name == "hydrogen" )
     75    {
     76      if(!Model()) SetModel(new G4DNADingfelderChargeIncreaseModel);
     77      Model()->SetLowEnergyLimit(100*eV);
     78      Model()->SetHighEnergyLimit(10*MeV);
     79
     80      AddEmModel(1, Model());   
     81    }
     82   
     83    if( name =="alpha+" || name =="helium" )
    7584    {
    7685      if(!Model()) SetModel(new G4DNADingfelderChargeIncreaseModel);
     
    8089      AddEmModel(1, Model());   
    8190    }
     91
    8292   
    8393  }
  • trunk/source/processes/electromagnetic/lowenergy/src/G4DNACrossSectionDataSet.cc

    r1228 r1315  
    2727
    2828// $Id: G4DNACrossSectionDataSet.cc,v 1.11 2009/11/12 10:05:30 sincerti Exp $
    29 // GEANT4 tag $Name: geant4-09-03 $
     29// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    3030//
    3131// Author: Riccardo Capra <capra@ge.infn.it>
  • trunk/source/processes/electromagnetic/lowenergy/src/G4DNADingfelderChargeDecreaseModel.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4DNADingfelderChargeDecreaseModel.cc,v 1.6 2009/08/13 11:32:47 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4DNADingfelderChargeDecreaseModel.cc,v 1.9 2010/04/06 11:00:35 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929
     
    8484  {
    8585    proton = protonDef->GetParticleName();
    86     lowEnergyLimit[proton] = 1. * keV;
     86    lowEnergyLimit[proton] = 100. * eV;
    8787    highEnergyLimit[proton] = 10. * MeV;
    8888  }
     
    209209  // InitialiseElementSelectors(particle,cuts);
    210210 
    211   // Test if water material
    212 
    213   flagMaterialIsWater= false;
    214   densityWater = 0;
    215 
    216   const G4ProductionCutsTable* theCoupleTable = G4ProductionCutsTable::GetProductionCutsTable();
    217 
    218   if(theCoupleTable)
    219   {
    220     G4int numOfCouples = theCoupleTable->GetTableSize();
    221  
    222     if(numOfCouples>0)
    223     {
    224           for (G4int i=0; i<numOfCouples; i++)
    225           {
    226             const G4MaterialCutsCouple* couple = theCoupleTable->GetMaterialCutsCouple(i);
    227             const G4Material* material = couple->GetMaterial();
    228 
    229             if (material->GetName() == "G4_WATER")
    230             {
    231               G4double density = material->GetAtomicNumDensityVector()[1];
    232               flagMaterialIsWater = true;
    233               densityWater = density;
    234              
    235               if (verboseLevel > 3)
    236               G4cout << "****** Water material is found with density(cm^-3)=" << density/(cm*cm*cm) << G4endl;
    237             }
    238  
    239           }
    240 
    241     } // if(numOfCouples>0)
    242 
    243   } // if (theCoupleTable)
    244 
    245211}
    246212
    247213//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    248214
    249 G4double G4DNADingfelderChargeDecreaseModel::CrossSectionPerVolume(const G4Material*,
     215G4double G4DNADingfelderChargeDecreaseModel::CrossSectionPerVolume(const G4Material* material,
    250216                                           const G4ParticleDefinition* particleDefinition,
    251217                                           G4double k,
     
    275241  G4double crossSection = 0.;
    276242
    277   if (flagMaterialIsWater)
     243  if (material->GetName() == "G4_WATER")
    278244  {
    279245    const G4String& particleName = particleDefinition->GetParticleName();
     
    304270      G4cout << "---> Kinetic energy(eV)=" << k/eV << G4endl;
    305271      G4cout << " - Cross section per water molecule (cm^2)=" << crossSection/cm/cm << G4endl;
    306       G4cout << " - Cross section per water molecule (cm^-1)=" << crossSection*densityWater/(1./cm) << G4endl;
     272      G4cout << " - Cross section per water molecule (cm^-1)=" << crossSection*material->GetAtomicNumDensityVector()[1]/(1./cm) << G4endl;
    307273    }
    308274
    309   } // if (flagMaterialIsWater)
    310 
    311  return crossSection*densityWater;                 
     275  }
     276
     277 return crossSection*material->GetAtomicNumDensityVector()[1];             
    312278
    313279}
     
    327293 
    328294  G4ParticleDefinition* definition = aDynamicParticle->GetDefinition();
     295 
     296  G4double particleMass = definition->GetPDGMass();
    329297
    330298  G4int finalStateIndex = RandomSelect(inK,definition);
     
    338306    outK = inK - n*(inK*electron_mass_c2/proton_mass_c2) - waterBindingEnergy + outgoingParticleBindingEnergy;
    339307  else
    340     outK = inK - n*(inK*electron_mass_c2/(3728*MeV)) - waterBindingEnergy + outgoingParticleBindingEnergy;
     308    outK = inK - n*(inK*electron_mass_c2/particleMass) - waterBindingEnergy + outgoingParticleBindingEnergy;
    341309 
    342310  if (outK<0)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4DNADingfelderChargeIncreaseModel.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4DNADingfelderChargeIncreaseModel.cc,v 1.6 2009/08/13 11:32:47 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4DNADingfelderChargeIncreaseModel.cc,v 1.9 2010/04/06 11:00:35 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929
     
    8585  {
    8686    hydrogen = hydrogenDef->GetParticleName();
    87     lowEnergyLimit[hydrogen] = 1. * keV;
     87    lowEnergyLimit[hydrogen] = 100. * eV;
    8888    highEnergyLimit[hydrogen] = 10. * MeV;
    8989  }
     
    200200  // InitialiseElementSelectors(particle,cuts);
    201201 
    202   // Test if water material
    203 
    204   flagMaterialIsWater= false;
    205   densityWater = 0;
    206 
    207   const G4ProductionCutsTable* theCoupleTable = G4ProductionCutsTable::GetProductionCutsTable();
    208 
    209   if(theCoupleTable)
    210   {
    211     G4int numOfCouples = theCoupleTable->GetTableSize();
    212  
    213     if(numOfCouples>0)
    214     {
    215           for (G4int i=0; i<numOfCouples; i++)
    216           {
    217             const G4MaterialCutsCouple* couple = theCoupleTable->GetMaterialCutsCouple(i);
    218             const G4Material* material = couple->GetMaterial();
    219 
    220             if (material->GetName() == "G4_WATER")
    221             {
    222               G4double density = material->GetAtomicNumDensityVector()[1];
    223               flagMaterialIsWater = true;
    224               densityWater = density;
    225              
    226               if (verboseLevel > 3)
    227               G4cout << "****** Water material is found with density(cm^-3)=" << density/(cm*cm*cm) << G4endl;
    228             }
    229  
    230           }
    231 
    232     } // if(numOfCouples>0)
    233 
    234   } // if (theCoupleTable)
    235 
    236202}
    237203
    238204//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    239205
    240 G4double G4DNADingfelderChargeIncreaseModel::CrossSectionPerVolume(const G4Material*,
     206G4double G4DNADingfelderChargeIncreaseModel::CrossSectionPerVolume(const G4Material* material,
    241207                                           const G4ParticleDefinition* particleDefinition,
    242208                                           G4double k,
     
    266232  G4double totalCrossSection = 0.;
    267233 
    268   if (flagMaterialIsWater)
     234  if (material->GetName() == "G4_WATER")
    269235  {
    270236    const G4String& particleName = particleDefinition->GetParticleName();
     
    315281      G4cout << "---> Kinetic energy(eV)=" << k/eV << G4endl;
    316282      G4cout << " - Cross section per water molecule (cm^2)=" << totalCrossSection/cm/cm << G4endl;
    317       G4cout << " - Cross section per water molecule (cm^-1)=" << totalCrossSection*densityWater/(1./cm) << G4endl;
     283      G4cout << " - Cross section per water molecule (cm^-1)=" << totalCrossSection*material->GetAtomicNumDensityVector()[1]/(1./cm) << G4endl;
    318284    }
    319285
    320   } // if (flagMaterialIsWater)
    321 
    322   return totalCrossSection*densityWater;                   
     286  }
     287
     288  return totalCrossSection*material->GetAtomicNumDensityVector()[1];               
    323289
    324290}
     
    339305
    340306  G4ParticleDefinition* definition = aDynamicParticle->GetDefinition();
    341  
     307
     308  G4double particleMass = definition->GetPDGMass();
     309
    342310  G4double inK = aDynamicParticle->GetKineticEnergy();
    343311
     
    353321  G4double electronK;
    354322  if (definition == instance->GetIon("hydrogen")) electronK = inK*electron_mass_c2/proton_mass_c2;
    355   else electronK = inK*electron_mass_c2/(3728*MeV);
     323  else electronK = inK*electron_mass_c2/(particleMass);
    356324 
    357325  if (outK<0)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4DNAElastic.cc

    r1228 r1315  
    2525//
    2626// $Id: G4DNAElastic.cc,v 1.3 2009/03/04 13:28:49 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#include "G4DNAElastic.hh"
  • trunk/source/processes/electromagnetic/lowenergy/src/G4DNAEmfietzoglouExcitationModel.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4DNAEmfietzoglouExcitationModel.cc,v 1.8 2009/08/13 11:32:47 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4DNAEmfietzoglouExcitationModel.cc,v 1.10 2010/06/08 21:50:00 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929
     
    4545  SetLowEnergyLimit(lowEnergyLimit);
    4646  SetHighEnergyLimit(highEnergyLimit);
     47
     48  nLevels = waterExcitation.NumberOfLevels();
    4749
    4850  verboseLevel= 0;
     
    9799
    98100  //
    99  
    100   nLevels = waterExcitation.NumberOfLevels();
    101 
    102   //
    103101  if( verboseLevel>0 )
    104102  {
     
    122120  // InitialiseElementSelectors(particle,cuts);
    123121
    124   // Test if water material
    125 
    126   flagMaterialIsWater= false;
    127   densityWater = 0;
    128 
    129   const G4ProductionCutsTable* theCoupleTable = G4ProductionCutsTable::GetProductionCutsTable();
    130 
    131   if(theCoupleTable)
    132   {
    133     G4int numOfCouples = theCoupleTable->GetTableSize();
    134  
    135     if(numOfCouples>0)
    136     {
    137           for (G4int i=0; i<numOfCouples; i++)
    138           {
    139             const G4MaterialCutsCouple* couple = theCoupleTable->GetMaterialCutsCouple(i);
    140             const G4Material* material = couple->GetMaterial();
    141 
    142             if (material->GetName() == "G4_WATER")
    143             {
    144               G4double density = material->GetAtomicNumDensityVector()[1];
    145               flagMaterialIsWater = true;
    146               densityWater = density;
    147              
    148               if (verboseLevel > 3)
    149               G4cout << "****** Water material is found with density(cm^-3)=" << density/(cm*cm*cm) << G4endl;
    150             }
    151  
    152           }
    153 
    154     } // if(numOfCouples>0)
    155 
    156   } // if (theCoupleTable)
    157 
    158 }
    159 
    160 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    161 
    162 G4double G4DNAEmfietzoglouExcitationModel::CrossSectionPerVolume(const G4Material*,
     122}
     123
     124//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     125
     126G4double G4DNAEmfietzoglouExcitationModel::CrossSectionPerVolume(const G4Material* material,
    163127                                           const G4ParticleDefinition* particleDefinition,
    164128                                           G4double ekin,
     
    173137 G4double sigma=0;
    174138 
    175  if (flagMaterialIsWater)
     139 if (material->GetName() == "G4_WATER")
    176140 {
    177141
     
    188152    G4cout << "---> Kinetic energy(eV)=" << ekin/eV << G4endl;
    189153    G4cout << " - Cross section per water molecule (cm^2)=" << sigma/cm/cm << G4endl;
    190     G4cout << " - Cross section per water molecule (cm^-1)=" << sigma*densityWater/(1./cm) << G4endl;
     154    G4cout << " - Cross section per water molecule (cm^-1)=" << sigma*material->GetAtomicNumDensityVector()[1]/(1./cm) << G4endl;
    191155  }
    192156
    193  } // if (flagMaterialIsWater)
    194         
    195  return sigma*densityWater;               
     157 }
     158       
     159 return sigma*material->GetAtomicNumDensityVector()[1];           
    196160}
    197161
     
    271235      sigma = excitationSigma / density;
    272236  }
     237
    273238  return sigma;
    274239}
  • trunk/source/processes/electromagnetic/lowenergy/src/G4DNAExcitation.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4DNAExcitation.cc,v 1.3 2009/03/04 13:28:49 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4DNAExcitation.cc,v 1.4 2010/03/27 11:32:41 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#include "G4DNAExcitation.hh"
     
    7676    if(name == "e-")
    7777    {
     78
     79      // First model
     80
    7881      if(!Model()) SetModel(new G4DNAEmfietzoglouExcitationModel);
    7982      Model()->SetLowEnergyLimit(8.23*eV);
    8083      Model()->SetHighEnergyLimit(10*MeV);
    8184
     85      // Alternative model
     86/*
     87      if(!Model()) SetModel(new G4DNABornExcitationModel);
     88      Model()->SetLowEnergyLimit(9*eV);
     89      Model()->SetHighEnergyLimit(1*MeV);
     90*/
    8291      AddEmModel(1, Model());   
    8392    }
     
    91100      if(!Model(2)) SetModel(new G4DNABornExcitationModel,2);
    92101      Model(2)->SetLowEnergyLimit(500*keV);
    93       Model(2)->SetHighEnergyLimit(10*MeV);
     102      Model(2)->SetHighEnergyLimit(100*MeV);
    94103   
    95104      AddEmModel(1, Model(1));   
  • trunk/source/processes/electromagnetic/lowenergy/src/G4DNAGenericIonsManager.cc

    r1228 r1315  
    2525//
    2626// $Id: G4DNAGenericIonsManager.cc,v 1.6 2009/06/10 13:32:36 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#include "G4DNAGenericIonsManager.hh"
  • trunk/source/processes/electromagnetic/lowenergy/src/G4DNAIonisation.cc

    r1228 r1315  
    2525//
    2626// $Id: G4DNAIonisation.cc,v 1.4 2009/11/02 17:00:11 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#include "G4DNAIonisation.hh"
  • trunk/source/processes/electromagnetic/lowenergy/src/G4DNAMillerGreenExcitationModel.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4DNAMillerGreenExcitationModel.cc,v 1.6 2009/08/13 11:32:47 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4DNAMillerGreenExcitationModel.cc,v 1.9 2010/06/08 21:50:00 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929
     
    210210  // InitialiseElementSelectors(particle,cuts);
    211211 
    212   // Test if water material
    213 
    214   flagMaterialIsWater= false;
    215   densityWater = 0;
    216 
    217   const G4ProductionCutsTable* theCoupleTable = G4ProductionCutsTable::GetProductionCutsTable();
    218 
    219   if(theCoupleTable)
    220   {
    221     G4int numOfCouples = theCoupleTable->GetTableSize();
    222  
    223     if(numOfCouples>0)
    224     {
    225           for (G4int i=0; i<numOfCouples; i++)
    226           {
    227             const G4MaterialCutsCouple* couple = theCoupleTable->GetMaterialCutsCouple(i);
    228             const G4Material* material = couple->GetMaterial();
    229 
    230             if (material->GetName() == "G4_WATER")
    231             {
    232               G4double density = material->GetAtomicNumDensityVector()[1];
    233               flagMaterialIsWater = true;
    234               densityWater = density;
    235              
    236               if (verboseLevel > 3)
    237               G4cout << "****** Water material is found with density(cm^-3)=" << density/(cm*cm*cm) << G4endl;
    238             }
    239  
    240           }
    241 
    242     } // if(numOfCouples>0)
    243 
    244   } // if (theCoupleTable)
    245 
    246212}
    247213
     
    278244  G4double crossSection = 0.;
    279245
    280   if (flagMaterialIsWater)
     246  if (material->GetName() == "G4_WATER")
    281247  {
    282248    const G4String& particleName = particleDefinition->GetParticleName();
     
    317283          G4double tmp =0.;
    318284         
    319           if (k*0.511/3728 > 7.4*eV && k*0.511/3728 < 10*keV) sigmaExcitation =
    320             excitationXS->CrossSectionPerVolume(material,particleDefinition,k*0.511/3728,tmp,tmp)/densityWater;
     285          if (k*0.511/3728 > 8.23*eV && k*0.511/3728 < 10*MeV ) sigmaExcitation =
     286            excitationXS->CrossSectionPerVolume(material,G4Electron::ElectronDefinition(),k*0.511/3728,tmp,tmp)
     287            /material->GetAtomicNumDensityVector()[1];
    321288       
    322289          if ( particleDefinition == instance->GetIon("alpha+") )
     
    335302      G4cout << "---> Kinetic energy(eV)=" << k/eV << G4endl;
    336303      G4cout << " - Cross section per water molecule (cm^2)=" << crossSection/cm/cm << G4endl;
    337       G4cout << " - Cross section per water molecule (cm^-1)=" << crossSection*densityWater/(1./cm) << G4endl;
     304      G4cout << " - Cross section per water molecule (cm^-1)=" << crossSection*material->GetAtomicNumDensityVector()[1]/(1./cm) << G4endl;
    338305    }
    339306
    340   } // if (flagMaterialIsWater)
    341 
    342  return crossSection*densityWater;                 
     307  }
     308
     309 return crossSection*material->GetAtomicNumDensityVector()[1];             
    343310
    344311}
     
    485452          G4double sigmaExcitation=0;
    486453
    487           if (k*0.511/3728 > 7.4*eV && k*0.511/3728 < 10*keV) sigmaExcitation = excitationXS->PartialCrossSection(k*0.511/3728,i);
     454          if (k*0.511/3728 > 8.23*eV && k*0.511/3728 < 10*MeV ) sigmaExcitation = excitationXS->PartialCrossSection(k*0.511/3728,i);
    488455 
    489456          G4double partial = PartialCrossSection(k,i,particle);
  • trunk/source/processes/electromagnetic/lowenergy/src/G4DNARuddIonisationModel.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4DNARuddIonisationModel.cc,v 1.10 2009/08/13 11:32:47 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4DNARuddIonisationModel.cc,v 1.17 2010/04/07 20:08:31 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929
     
    271271  // InitialiseElementSelectors(particle,cuts);
    272272
    273   // Test if water material
    274 
    275   flagMaterialIsWater= false;
    276   densityWater = 0;
    277 
    278   const G4ProductionCutsTable* theCoupleTable = G4ProductionCutsTable::GetProductionCutsTable();
    279 
    280   if(theCoupleTable)
    281   {
    282     G4int numOfCouples = theCoupleTable->GetTableSize();
    283  
    284     if(numOfCouples>0)
    285     {
    286           for (G4int i=0; i<numOfCouples; i++)
    287           {
    288             const G4MaterialCutsCouple* couple = theCoupleTable->GetMaterialCutsCouple(i);
    289             const G4Material* material = couple->GetMaterial();
    290 
    291             if (material->GetName() == "G4_WATER")
    292             {
    293               G4double density = material->GetAtomicNumDensityVector()[1];
    294               flagMaterialIsWater = true;
    295               densityWater = density;
    296              
    297               if (verboseLevel > 3)
    298               G4cout << "****** Water material is found with density(cm^-3)=" << density/(cm*cm*cm) << G4endl;
    299             }
    300  
    301           }
    302 
    303     } // if(numOfCouples>0)
    304 
    305   } // if (theCoupleTable)
    306 
    307273}
    308274
    309275//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    310276
    311 G4double G4DNARuddIonisationModel::CrossSectionPerVolume(const G4Material*,
     277G4double G4DNARuddIonisationModel::CrossSectionPerVolume(const G4Material* material,
    312278                                           const G4ParticleDefinition* particleDefinition,
    313279                                           G4double k,
     
    355321  G4double sigma=0;
    356322
    357   if (flagMaterialIsWater)
     323  if (material->GetName() == "G4_WATER")
    358324  {
    359325    const G4String& particleName = particleDefinition->GetParticleName();
     
    421387                        G4cout << "---> Kinetic energy(eV)=" << k/eV << G4endl;
    422388                        G4cout << " - Cross section per water molecule (cm^2)=" << tmp1/cm/cm << G4endl;
    423                         G4cout << " - Cross section per water molecule (cm^-1)=" << tmp1*densityWater/(1./cm) << G4endl;
     389                        G4cout << " - Cross section per water molecule (cm^-1)=" <<
     390                        tmp1*material->GetAtomicNumDensityVector()[1]/(1./cm) << G4endl;
    424391                      }
    425                       return tmp1*densityWater;
     392                      return tmp1*material->GetAtomicNumDensityVector()[1];
    426393                  }
    427394
     
    434401                        G4cout << "---> Kinetic energy(eV)=" << k/eV << G4endl;
    435402                        G4cout << " - Cross section per water molecule (cm^2)=" << tmp2/cm/cm << G4endl;
    436                         G4cout << " - Cross section per water molecule (cm^-1)=" << tmp2*densityWater/(1./cm) << G4endl;
     403                        G4cout << " - Cross section per water molecule (cm^-1)=" << tmp2*
     404                        material->GetAtomicNumDensityVector()[1]/(1./cm) << G4endl;
    437405                      }
    438                       return tmp2*densityWater;
     406                      return tmp2*material->GetAtomicNumDensityVector()[1];
    439407                  }
    440408              }     
     
    454422      G4cout << "---> Kinetic energy(eV)=" << k/eV << G4endl;
    455423      G4cout << " - Cross section per water molecule (cm^2)=" << sigma/cm/cm << G4endl;
    456       G4cout << " - Cross section per water molecule (cm^-1)=" << sigma*densityWater/(1./cm) << G4endl;
     424      G4cout << " - Cross section per water molecule (cm^-1)=" << sigma*
     425      material->GetAtomicNumDensityVector()[1]/(1./cm) << G4endl;
    457426    }
    458427 
    459428  } // if (waterMaterial)
    460429 
    461  return sigma*densityWater;               
     430 return sigma*material->GetAtomicNumDensityVector()[1];           
    462431
    463432}
     
    562531      fvect->push_back(dp);
    563532
    564       /*
    565     // creating neutral water molechule...
    566 
    567     G4DNAGenericMoleculeManager *instance;
    568     instance = G4DNAGenericMoleculeManager::Instance();
    569     G4ParticleDefinition* waterDef = NULL;
    570     G4Molecule* water = instance->GetMolecule("H2O");
    571     waterDef = (G4ParticleDefinition*)water;
    572 
    573     direction.set(0.,0.,0.);
    574 
    575     //G4DynamicParticle* dynamicWater = new G4DynamicParticle(waterDef, direction, bindingEnergy);
    576     G4DynamicMolecule* dynamicWater = new G4DynamicMolecule(water, direction, bindingEnergy);
    577     //dynamicWater->RemoveElectron(ionizationShell, 1);
    578 
    579     G4DynamicMolecule* dynamicWater2 = new G4DynamicMolecule(water, direction, bindingEnergy);
    580     G4DynamicMolecule* dynamicWater3 = new G4DynamicMolecule(water, direction, bindingEnergy);
    581     // insertion inside secondaries
    582 
    583     fvect->push_back(dynamicWater);
    584     fvect->push_back(dynamicWater2);
    585     fvect->push_back(dynamicWater3);
    586       */
    587533  }
    588534
     
    623569  G4double crossSectionMaximum = 0.;
    624570 
    625   for(G4double value=waterStructure.IonisationEnergy(shell); value<=4.*waterStructure.IonisationEnergy(shell) ; value+=0.1*eV)
     571  for(G4double value=waterStructure.IonisationEnergy(shell); value<=5.*waterStructure.IonisationEnergy(shell) && k>=value ; value+=0.1*eV)
    626572  {
    627573      G4double differentialCrossSection = DifferentialCrossSection(particleDefinition, k, value, shell);
     
    710656  G4double alphaConst ;
    711657
     658  const G4double Bj[5] = {12.61*eV, 14.73*eV, 18.55*eV, 32.20*eV, 539.7*eV};
     659
    712660  if (j == 4)
    713661  {
     
    746694
    747695  G4double wBig = (energyTransfer - waterStructure.IonisationEnergy(ionizationLevelIndex));
    748   G4double w = wBig / waterStructure.IonisationEnergy(ionizationLevelIndex);
     696  if (wBig<0) return 0.;
     697
     698  G4double w = wBig / Bj[ionizationLevelIndex];
    749699  G4double Ry = 13.6*eV;
    750700
     
    764714  }
    765715 
    766   G4double S = 4.*pi * Bohr_radius*Bohr_radius * n * std::pow((Ry/waterStructure.IonisationEnergy(ionizationLevelIndex)),2);
    767   G4double v2 = tau / waterStructure.IonisationEnergy(ionizationLevelIndex);
     716  G4double S = 4.*pi * Bohr_radius*Bohr_radius * n * std::pow((Ry/Bj[ionizationLevelIndex]),2);
     717  G4double v2 = tau / Bj[ionizationLevelIndex];
    768718  G4double v = std::sqrt(v2);
    769   G4double wc = 4.*v2 - 2.*v - (Ry/(4.*waterStructure.IonisationEnergy(ionizationLevelIndex)));
     719  G4double wc = 4.*v2 - 2.*v - (Ry/(4.*Bj[ionizationLevelIndex]));
    770720
    771721  G4double L1 = (C1* std::pow(v,(D1))) / (1.+ E1*std::pow(v, (D1+4.)));
     
    777727  G4double F2 = (L2*H2)/(L2+H2);
    778728
    779   G4double sigma = CorrectionFactor(particleDefinition, k/eV)
    780     * Gj[j] * (S/waterStructure.IonisationEnergy(ionizationLevelIndex))
     729  G4double sigma = CorrectionFactor(particleDefinition, k)
     730    * Gj[j] * (S/Bj[ionizationLevelIndex])
     731    * ( (F1+w*F2) / ( std::pow((1.+w),3) * ( 1.+std::exp(alphaConst*(w-wc)/v))) );
     732
     733  if ( (particleDefinition == instance->GetIon("hydrogen")) && (ionizationLevelIndex==4))
     734
     735    sigma = Gj[j] * (S/Bj[ionizationLevelIndex])
    781736    * ( (F1+w*F2) / ( std::pow((1.+w),3) * ( 1.+std::exp(alphaConst*(w-wc)/v))) );
    782737
     
    823778          )
    824779  {
    825       sigma = Gj[j] * (S/waterStructure.IonisationEnergy(ionizationLevelIndex)) * ( (F1+w*F2) / ( std::pow((1.+w),3) * ( 1.+std::exp(alphaConst*(w-wc)/v))) );
     780      sigma = Gj[j] * (S/Bj[ionizationLevelIndex]) * ( (F1+w*F2) / ( std::pow((1.+w),3) * ( 1.+std::exp(alphaConst*(w-wc)/v))) );
    826781   
    827782      G4double zEff = particleDefinition->GetPDGCharge() / eplus + particleDefinition->GetLeptonNumber();
     
    916871    if (particleDefinition == instance->GetIon("hydrogen"))
    917872    {
    918         G4double value = (std::log(k/eV)-4.2)/0.5;
     873        G4double value = (std::log10(k/eV)-4.2)/0.5;
    919874        return((0.8/(1+std::exp(value))) + 0.9);
    920875    }
     
    932887  // BEGIN PART 1/2 OF ELECTRON CORRECTION
    933888
    934   // add ONE or TWO electron-water excitation for alpha+ and helium
     889  // add ONE or TWO electron-water ionisation for alpha+ and helium
    935890   
    936891  G4DNAGenericIonsManager *instance;
    937892  instance = G4DNAGenericIonsManager::Instance();
    938893  G4double kElectron(0);
    939   G4double electronComponent(0);
     894
    940895  G4DNACrossSectionDataSet * electronDataset = new G4DNACrossSectionDataSet (new G4LogLogInterpolation, eV, (1./3.343e22)*m*m);
    941896 
     
    949904      kElectron = k * 0.511/3728;
    950905       
    951       electronComponent = electronDataset->FindValue(kElectron);
    952        
    953906  }     
    954  
    955   delete electronDataset;
    956907 
    957908  // END PART 1/2 OF ELECTRON CORRECTION
     
    982933
    983934              // BEGIN PART 2/2 OF ELECTRON CORRECTION
    984 
     935              // Use only electron partial cross sections
     936             
    985937              if (particle == instance->GetIon("alpha+")->GetParticleName())
    986                 {valuesBuffer[i]=table->GetComponent(i)->FindValue(k) + electronComponent; }
    987      
     938                {valuesBuffer[i]=table->GetComponent(i)->FindValue(k) + electronDataset->GetComponent(i)->FindValue(kElectron); }
     939
    988940              if (particle == instance->GetIon("helium")->GetParticleName())
    989                 {valuesBuffer[i]=table->GetComponent(i)->FindValue(k) + 2*electronComponent; }
    990      
     941                {valuesBuffer[i]=table->GetComponent(i)->FindValue(k) + 2*electronDataset->GetComponent(i)->FindValue(kElectron); }
     942
    991943              // BEGIN PART 2/2 OF ELECTRON CORRECTION
    992944
     
    1001953          {
    1002954              i--;
     955             
    1003956               
    1004957              if (valuesBuffer[i] > value)
    1005958              {
    1006959                  delete[] valuesBuffer;
     960                 
     961                  if (electronDataset) delete electronDataset;
     962                 
    1007963                  return i;
    1008964              }
     
    1018974    G4Exception("G4DNARuddIonisationModel::RandomSelect: attempting to calculate cross section for wrong particle");
    1019975  }
     976
     977  delete electronDataset;
    1020978     
    1021979  return level;
  • trunk/source/processes/electromagnetic/lowenergy/src/G4DNAScreenedRutherfordElasticModel.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4DNAScreenedRutherfordElasticModel.cc,v 1.9 2009/08/13 11:32:47 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4DNAScreenedRutherfordElasticModel.cc,v 1.10 2010/01/07 18:10:50 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929
     
    152152  // InitialiseElementSelectors(particle,cuts);
    153153
    154   // Test if water material
    155 
    156   flagMaterialIsWater= false;
    157   densityWater = 0;
    158 
    159   const G4ProductionCutsTable* theCoupleTable = G4ProductionCutsTable::GetProductionCutsTable();
    160 
    161   if(theCoupleTable)
    162   {
    163     G4int numOfCouples = theCoupleTable->GetTableSize();
    164  
    165     if(numOfCouples>0)
    166     {
    167           for (G4int i=0; i<numOfCouples; i++)
    168           {
    169             const G4MaterialCutsCouple* couple = theCoupleTable->GetMaterialCutsCouple(i);
    170             const G4Material* material = couple->GetMaterial();
    171 
    172             if (material->GetName() == "G4_WATER")
    173             {
    174               G4double density = material->GetAtomicNumDensityVector()[1];
    175               flagMaterialIsWater = true;
    176               densityWater = density;
    177              
    178               if (verboseLevel > 3)
    179               G4cout << "****** Water material is found with density(cm^-3)=" << density/(cm*cm*cm) << G4endl;
    180             }
    181  
    182           }
    183 
    184     } // if(numOfCouples>0)
    185 
    186   } // if (theCoupleTable)
    187 
    188 }
    189 
    190 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    191 
    192 G4double G4DNAScreenedRutherfordElasticModel::CrossSectionPerVolume(const G4Material*,
     154}
     155
     156//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     157
     158G4double G4DNAScreenedRutherfordElasticModel::CrossSectionPerVolume(const G4Material* material,
    193159                                           const G4ParticleDefinition*,
    194160                                           G4double ekin,
     
    203169 G4double sigma=0;
    204170 
    205  if (flagMaterialIsWater)
     171 if (material->GetName() == "G4_WATER")
    206172 {
    207173
     
    223189    G4cout << "---> Kinetic energy(eV)=" << ekin/eV << G4endl;
    224190    G4cout << " - Cross section per water molecule (cm^2)=" << sigma/cm/cm << G4endl;
    225     G4cout << " - Cross section per water molecule (cm^-1)=" << sigma*densityWater/(1./cm) << G4endl;
     191    G4cout << " - Cross section per water molecule (cm^-1)=" << sigma*material->GetAtomicNumDensityVector()[1]/(1./cm) << G4endl;
    226192  }
    227193
    228  } // if (flagMaterialIsWater)
    229 
    230  return sigma*densityWater;               
     194 }
     195
     196 return sigma*material->GetAtomicNumDensityVector()[1];           
    231197}
    232198
  • trunk/source/processes/electromagnetic/lowenergy/src/G4DopplerProfile.cc

    r1228 r1315  
    2626//
    2727// $Id: G4DopplerProfile.cc,v 1.3 2009/06/10 13:32:36 mantero Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4DummyFinalState.cc

    r1228 r1315  
    2626//
    2727// $Id: G4DummyFinalState.cc,v 1.2 2007/10/15 08:36:35 pia Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4EMDataSet.cc

    r1228 r1315  
    2626//
    2727// $Id: G4EMDataSet.cc,v 1.20 2009/09/25 07:41:34 sincerti Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateChargeDecrease.cc

    r1228 r1315  
    2525//
    2626// $Id: G4FinalStateChargeDecrease.cc,v 1.7 2009/06/11 15:47:08 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#include "G4FinalStateChargeDecrease.hh"
  • trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateChargeIncrease.cc

    r1228 r1315  
    2525//
    2626// $Id: G4FinalStateChargeIncrease.cc,v 1.7 2009/06/11 15:47:08 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#include "G4FinalStateChargeIncrease.hh"
  • trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateChargeTransferProton.cc

    r1228 r1315  
    2626//
    2727// $Id: G4FinalStateChargeTransferProton.cc,v 1.2 2009/06/10 13:32:36 mantero Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateElasticBrennerZaider.cc

    r1228 r1315  
    2525//
    2626// $Id: G4FinalStateElasticBrennerZaider.cc,v 1.11 2009/06/11 15:47:08 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#include "G4FinalStateElasticBrennerZaider.hh"
  • trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateElasticChampion.cc

    r1228 r1315  
    2525//
    2626// $Id: G4FinalStateElasticChampion.cc,v 1.10 2009/06/11 15:47:08 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828// -------------------------------------------------------------------
    2929
  • trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateElasticScreenedRutherford.cc

    r1228 r1315  
    2525//
    2626// $Id: G4FinalStateElasticScreenedRutherford.cc,v 1.7 2009/06/11 15:47:08 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#include "G4FinalStateElasticScreenedRutherford.hh"
  • trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateExcitationBorn.cc

    r1228 r1315  
    2525//
    2626// $Id: G4FinalStateExcitationBorn.cc,v 1.6 2009/06/11 15:47:08 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#include "G4FinalStateExcitationBorn.hh"
  • trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateExcitationEmfietzoglou.cc

    r1228 r1315  
    2525//
    2626// $Id: G4FinalStateExcitationEmfietzoglou.cc,v 1.8 2009/06/11 15:47:08 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#include "G4FinalStateExcitationEmfietzoglou.hh"
  • trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateExcitationMillerGreen.cc

    r1228 r1315  
    2525//
    2626// $Id: G4FinalStateExcitationMillerGreen.cc,v 1.6 2009/06/11 15:47:08 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#include "G4FinalStateExcitationMillerGreen.hh"
  • trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateIonisationBorn.cc

    r1228 r1315  
    2525//
    2626// $Id: G4FinalStateIonisationBorn.cc,v 1.19 2009/06/11 15:47:08 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#include "G4FinalStateIonisationBorn.hh"
  • trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateIonisationRudd.cc

    r1228 r1315  
    2525//
    2626// $Id: G4FinalStateIonisationRudd.cc,v 1.11 2009/06/11 15:47:08 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#include "G4FinalStateIonisationRudd.hh"
  • trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateKill.cc

    r1228 r1315  
    2626//
    2727// $Id: G4FinalStateKill.cc,v 1.1 2007/11/09 20:26:12 pia Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateProduct.cc

    r1228 r1315  
    2626//
    2727// $Id: G4FinalStateProduct.cc,v 1.7 2009/06/10 13:32:36 mantero Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStatePsCreationChampion.cc

    r1228 r1315  
    2525//
    2626// $Id: G4FinalStatePsCreationChampion.cc,v 1.2 2009/06/10 13:32:36 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828// -------------------------------------------------------------------
    2929
  • trunk/source/processes/electromagnetic/lowenergy/src/G4FluoTransition.cc

    r1228 r1315  
    2626//
    2727// $Id: G4FluoTransition.cc,v 1.2 ????
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: Elena Guardincerri (Elena.Guardincerri@ge.infn.it)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LinInterpolation.cc

    r1228 r1315  
    2626//
    2727// $Id: G4LinInterpolation.cc,v 1.5 2009/09/25 07:41:34 sincerti Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LivermoreBremsstrahlungModel.cc

    r1228 r1315  
    2525//
    2626// $Id: G4LivermoreBremsstrahlungModel.cc,v 1.6 2009/06/11 15:47:08 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// Author: Luciano Pandola
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LivermoreComptonModel.cc

    r1228 r1315  
    2525//
    2626// $Id: G4LivermoreComptonModel.cc,v 1.7 2009/06/10 13:32:36 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929//
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LivermoreGammaConversionModel.cc

    r1228 r1315  
    2525//
    2626// $Id: G4LivermoreGammaConversionModel.cc,v 1.8 2009/06/11 15:47:08 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929//
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LivermoreIonisationModel.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4LivermoreIonisationModel.cc,v 1.7 2009/10/23 09:30:08 pandola Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4LivermoreIonisationModel.cc,v 1.8 2010/03/26 09:32:50 pandola Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// Author: Luciano Pandola
     
    8585  //
    8686  verboseLevel = 0;
    87   //
    8887  //By default: use deexcitation, not auger
    8988  SetDeexcitationFlag(true);
    9089  ActivateAuger(false);
    91 
     90  //
    9291  //
    9392  // Notice: the fluorescence along step is generated only if it is
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LivermorePhotoElectricModel.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4LivermorePhotoElectricModel.cc,v 1.9 2009/10/23 09:31:03 pandola Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4LivermorePhotoElectricModel.cc,v 1.11 2010/03/26 09:32:50 pandola Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929//
     
    4343//                  - atomic deexcitation managed via G4VEmModel::DeexcitationFlag() is
    4444//                    set as "true" (default would be false)
    45 //
     45// 15 Mar 2010   L Pandola
     46//                  - removed methods to set explicitely fluorescence cuts.
     47//                  Main cuts from G4ProductionCutsTable are always used
     48//
    4649
    4750#include "G4LivermorePhotoElectricModel.hh"
     
    6265  //  SetLowEnergyLimit(lowEnergyLimit);
    6366  SetHighEnergyLimit(highEnergyLimit);
    64 
    65   //Set atomic deexcitation by default
    66   SetDeexcitationFlag(true);
    67   ActivateAuger(false);
    68    
     67 
    6968  verboseLevel= 0;
    7069  // Verbosity scale:
     
    7473  // 3 = calculation of cross sections, file openings, sampling of atoms
    7574  // 4 = entering in methods
     75
     76  //Set atomic deexcitation by default
     77  SetDeexcitationFlag(true);
     78  ActivateAuger(false);
     79
    7680  if(verboseLevel>0) {
    7781    G4cout << "Livermore PhotoElectric is constructed " << G4endl
     
    125129  shellCrossSectionHandler->LoadShellData(shellCrossSectionFile);
    126130 
    127   // SI - Simple generator is buggy
    128   //generatorName = "geant4.6.2";
    129   //ElectronAngularGenerator = new G4PhotoElectricAngularGeneratorSimple("GEANTSimpleGenerator");              // default generator
     131  // default generator
    130132  ElectronAngularGenerator =
    131133    new G4PhotoElectricAngularGeneratorSauterGavrila("GEANTSauterGavrilaGenerator");       
     
    298300//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    299301
    300 void G4LivermorePhotoElectricModel::SetCutForLowEnSecPhotons(G4double cut)
    301 {
    302   cutForLowEnergySecondaryPhotons = cut;
    303   deexcitationManager.SetCutForSecondaryPhotons(cut);
    304 }
    305 
    306 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    307 
    308 void G4LivermorePhotoElectricModel::SetCutForLowEnSecElectrons(G4double cut)
    309 {
    310   cutForLowEnergySecondaryElectrons = cut;
    311   deexcitationManager.SetCutForAugerElectrons(cut);
    312 }
    313 
    314 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    315 
    316 void G4LivermorePhotoElectricModel::ActivateAuger(G4bool val)
    317 {
    318   deexcitationManager.ActivateAugerElectronProduction(val);
     302void G4LivermorePhotoElectricModel::ActivateAuger(G4bool augerbool)
     303{
     304  if (!DeexcitationFlag() && augerbool)
     305    {
     306      G4cout << "WARNING - G4PenelopePhotoElectricModel" << G4endl;
     307      G4cout << "The use of the Atomic Deexcitation Manager is set to false " << G4endl;
     308      G4cout << "Therefore, Auger electrons will be not generated anyway" << G4endl;
     309    }
     310  deexcitationManager.ActivateAugerElectronProduction(augerbool);
     311  if (verboseLevel > 1)
     312    G4cout << "Auger production set to " << augerbool << G4endl;
    319313}
    320314
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LivermorePolarizedComptonModel.cc

    r1228 r1315  
    2525//
    2626// $Id: G4LivermorePolarizedComptonModel.cc,v 1.6 2009/05/03 08:29:55 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// History:
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LivermorePolarizedRayleighModel.cc

    r1228 r1315  
    2525//
    2626// $Id: G4LivermorePolarizedRayleighModel.cc,v 1.5 2009/05/02 15:20:53 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// History:
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LivermoreRayleighModel.cc

    r1228 r1315  
    2525//
    2626// $Id: G4LivermoreRayleighModel.cc,v 1.8 2009/09/23 16:54:06 flongo Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// Author: Sebastien Inserti
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LogLogInterpolation.cc

    r1228 r1315  
    2626//
    2727// $Id: G4LogLogInterpolation.cc,v 1.16 2009/09/25 07:41:34 sincerti Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LowEnergyBremsstrahlung.cc

    r1228 r1315  
    2525//
    2626// $Id: G4LowEnergyBremsstrahlung.cc,v 1.74 2009/06/11 15:47:08 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// --------------------------------------------------------------
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LowEnergyCompton.cc

    r1228 r1315  
    2525//
    2626// $Id: G4LowEnergyCompton.cc,v 1.50 2009/06/11 15:47:08 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// Author: A. Forti
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LowEnergyGammaConversion.cc

    r1228 r1315  
    2727///
    2828// $Id: G4LowEnergyGammaConversion.cc,v 1.39 2009/06/11 15:47:08 mantero Exp $
    29 // GEANT4 tag $Name: geant4-09-03 $
     29// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    3030//
    3131//
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LowEnergyIonisation.cc

    r1228 r1315  
    2525//
    2626// $Id: G4LowEnergyIonisation.cc,v 1.106 2009/06/11 15:47:08 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// --------------------------------------------------------------
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LowEnergyPhotoElectric.cc

    r1228 r1315  
    2626//
    2727// $Id: G4LowEnergyPhotoElectric.cc,v 1.59 2009/06/11 15:47:08 mantero Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: A. Forti
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LowEnergyPolarizedCompton.cc

    r1228 r1315  
    2626//
    2727// $Id: G4LowEnergyPolarizedCompton.cc,v 1.28 2009/06/11 15:47:08 mantero Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// ------------------------------------------------------------
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LowEnergyPolarizedRayleigh.cc

    r1228 r1315  
    2525//
    2626// $Id: G4LowEnergyPolarizedRayleigh.cc,v 1.10 2009/06/11 15:47:08 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// --------------------------------------------------------------
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LowEnergyRayleigh.cc

    r1228 r1315  
    2727//
    2828// $Id: G4LowEnergyRayleigh.cc,v 1.40 2009/06/11 15:47:08 mantero Exp $
    29 // GEANT4 tag $Name: geant4-09-03 $
     29// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    3030//
    3131// Author: A. Forti
  • trunk/source/processes/electromagnetic/lowenergy/src/G4OrlicLiCrossSection.cc

    r1197 r1315  
    2424// ********************************************************************
    2525//
    26 //$Id: G4OrlicLiCrossSection.cc,v 1.4 2009/11/11 09:14:53 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03-cand-01 $
     26//$Id: G4OrlicLiCrossSection.cc,v 1.5 2010/06/06 23:40:35 mantero Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// Author: Haifa Ben Abdelouahed
     
    3636//  21 Apr 2009   ALF Some correction for compatibility to G4VShellCrossSection
    3737//                and changed name to G4OrlicLiCrossSection
    38 //  11 Nov 2009   ALF update and code cleaning for the Dec Release
    3938//
    4039// -------------------------------------------------------------------
     
    200199                      else
    201200                        {
    202                           G4cout << "ERROR: L1 Cross-Section exist only for ZTarget between 41 and 92!!! " << G4endl;
     201                          G4cout << "ERROR: L1 Cross-Section exist only for ZTarget between 14 and 92!!! " << G4endl;
    203202                       
    204203                        }
     
    326325                      else
    327326                        {
    328                           G4cout << "ERROR: L2 Cross-Section exist only for ZTarget between 41 and 92!!! " << G4endl;
     327                          G4cout << "ERROR: L2 Cross-Section exist only for ZTarget between 14 and 92!!! " << G4endl;
    329328                       
    330329                        }
     
    446445                      else
    447446                        {
    448                           G4cout << "ERROR: L3 Cross-Section exist only for ZTarget between 41 and 92!!! " << G4endl;
     447                          G4cout << "ERROR: L3 Cross-Section exist only for ZTarget between 14 and 92!!! " << G4endl;
    449448                       
    450449                        }
  • trunk/source/processes/electromagnetic/lowenergy/src/G4PaulKCrossSection.cc

    r1228 r1315  
    2525//
    2626//
     27// History:
     28// -----------
     29//  21 Apr 2008   H. Abdelohauwed - 1st implementation
     30//  29 Apr 2009   ALF  Major Design Revision
     31//
     32// -------------------------------------------------------------------
     33
     34// Class description:
     35// Low Energy Electromagnetic Physics, Cross section, p ionisation, K shell
     36// Further documentation available from http://www.ge.infn.it/geant4/lowE
     37
     38// -------------------------------------------------------------------
    2739
    2840#include "globals.hh"
     
    3042#include <fstream>
    3143#include <iomanip>
    32 #include "G4CompositeEMDataSet.hh"
    33 #include "G4ShellEMDataSet.hh"
     44//#include "G4CompositeEMDataSet.hh"
     45//#include "G4ShellEMDataSet.hh"
    3446#include "G4EMDataSet.hh"
    35 #include "G4VEMDataSet.hh"
    36 #include "G4VDataSetAlgorithm.hh"
     47//#include "G4VEMDataSet.hh"
     48//#include "G4VDataSetAlgorithm.hh"
    3749#include "G4LogLogInterpolation.hh"
    3850#include "G4PaulKCrossSection.hh"
     51#include "G4Proton.hh"
     52#include "G4Alpha.hh"
     53
    3954
    4055G4PaulKCrossSection::G4PaulKCrossSection()
    41 { }
     56{
     57
     58 
     59  interpolation = new G4LogLogInterpolation();
     60
     61  /*
     62    G4String path = getenv("G4LEDATA");
     63 
     64    if (!path)
     65    G4Exception("G4paulKCrossSection::G4paulKCrossSection: G4LEDATA environment variable not set");
     66    G4cout << path + "/kcsPaul/kcs-" << G4endl;
     67  */
     68
     69
     70    for (G4int i=4; i<93; i++) {
     71      protonDataSetMap[i] = new G4EMDataSet(i,interpolation);
     72      protonDataSetMap[i]->LoadData("pixe/kpcsPaul/kcs-");
     73    }
     74    for (G4int i=6; i<93; i++) {
     75      alphaDataSetMap[i] = new G4EMDataSet(i,interpolation);
     76      alphaDataSetMap[i]->LoadData("pixe/kacsPaul/kacs-");
     77    }
     78
     79
     80
     81
     82}
    4283
    4384G4PaulKCrossSection::~G4PaulKCrossSection()
    44 { }
     85{
    4586
    46 G4double G4PaulKCrossSection::CalculateKCrossSection(G4int zTarget,G4int zIncident, G4double energyIncident)
     87  protonDataSetMap.clear();
     88  alphaDataSetMap.clear();
     89
     90}
     91
     92G4double G4PaulKCrossSection::CalculateKCrossSection(G4int zTarget,G4double massIncident, G4double energyIncident)
    4793{
    4894 
    49  G4String fileName;
     95  G4Proton* aProtone = G4Proton::Proton();
     96  G4Alpha* aAlpha = G4Alpha::Alpha();
     97 
     98  G4double sigma = 0;
    5099
    51  if (zIncident == 1)
    52    { fileName = "kcsPaul/kcs-";}
     100  if (massIncident == aProtone->GetPDGMass() )
     101    {
     102     
     103      sigma = protonDataSetMap[zTarget]->FindValue(energyIncident/MeV) / barn;
     104     
     105    }
    53106  else
    54107    {
    55       if (zIncident == 2)
    56         { fileName = "kacsPaul/kacs-";}
    57        
     108      if (massIncident == aAlpha->GetPDGMass())
     109        {
     110         
     111          sigma = alphaDataSetMap[zTarget]->FindValue(energyIncident/MeV) / barn;
     112         
     113        }
     114      else
     115        {
     116          G4cout << "we can treat only Proton or Alpha incident particles " << G4endl;
     117          sigma = 0.;
     118        }
    58119    }
    59 
    60120 
    61   G4VDataSetAlgorithm* interpolation = new G4LogLogInterpolation();
    62 
    63   G4VEMDataSet* dataSet;
    64 
    65   dataSet = new G4EMDataSet(zTarget,interpolation);
    66121 
    67   dataSet->LoadData(fileName);
    68    
    69 
    70           G4double sigma = dataSet->FindValue(energyIncident/MeV) / barn;
    71 
    72           return sigma;
     122 
     123  return sigma;
    73124}
    74125
  • trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeAnnihilationModel.cc

    r1228 r1315  
    2525//
    2626// $Id: G4PenelopeAnnihilationModel.cc,v 1.4 2009/06/10 13:32:36 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// Author: Luciano Pandola
  • trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeBremsstrahlung.cc

    r1228 r1315  
    2525//
    2626// $Id: G4PenelopeBremsstrahlung.cc,v 1.21 2009/06/11 15:47:08 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// --------------------------------------------------------------
  • trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeBremsstrahlungAngular.cc

    r1228 r1315  
    2525//
    2626// $Id: G4PenelopeBremsstrahlungAngular.cc,v 1.8 2009/06/10 13:32:36 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// --------------------------------------------------------------
  • trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeBremsstrahlungContinuous.cc

    r1228 r1315  
    2525//
    2626// $Id: G4PenelopeBremsstrahlungContinuous.cc,v 1.12 2009/06/10 13:32:36 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// --------------------------------------------------------------
  • trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeBremsstrahlungModel.cc

    r1228 r1315  
    2525//
    2626// $Id: G4PenelopeBremsstrahlungModel.cc,v 1.7 2009/06/11 15:47:08 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// Author: Luciano Pandola
  • trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeCompton.cc

    r1228 r1315  
    2525//
    2626// $Id: G4PenelopeCompton.cc,v 1.36 2009/06/11 15:47:08 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// Author: Luciano Pandola
  • trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeComptonModel.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PenelopeComptonModel.cc,v 1.8 2009/10/23 09:29:24 pandola Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4PenelopeComptonModel.cc,v 1.9 2010/03/26 09:32:50 pandola Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// Author: Luciano Pandola
     
    8181  ZForIntegration = 1;
    8282
    83   //by default, the model will use atomic deexcitation
    84   SetDeexcitationFlag(true);
    85   ActivateAuger(false);
    86 
    8783  verboseLevel= 0;
    8884  // Verbosity scale:
     
    9288  // 3 = calculation of cross sections, file openings, sampling of atoms
    9389  // 4 = entering in methods
     90
     91  //by default, the model will use atomic deexcitation
     92  SetDeexcitationFlag(true);
     93  ActivateAuger(false);
    9494
    9595  //These vectors do not change when materials or cut change.
  • trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeGammaConversionModel.cc

    r1228 r1315  
    2525//
    2626// $Id: G4PenelopeGammaConversionModel.cc,v 1.6 2009/06/11 15:47:08 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// Author: Luciano Pandola
  • trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeIonisation.cc

    r1228 r1315  
    2525//
    2626// $Id: G4PenelopeIonisation.cc,v 1.22 2009/06/11 15:47:08 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// --------------------------------------------------------------
  • trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeIonisationModel.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PenelopeIonisationModel.cc,v 1.10 2009/10/23 09:29:24 pandola Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4PenelopeIonisationModel.cc,v 1.16 2010/04/29 07:28:50 pandola Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// Author: Luciano Pandola
     
    4242//                            G4VEmModel::DeexcitationFlag()
    4343//                            Add ActivateAuger() method
     44// 15 Mar 2010   L Pandola    Explicitely initialize Auger to false
     45// 29 Mar 2010   L Pandola    Added a dummy ComputeCrossSectionPerAtom() method issueing a
     46//                            warning if users try to access atomic cross sections via
     47//                            G4EmCalculator
     48// 15 Apr 2010   L. Pandola   Implemented model's own version of MinEnergyCut()
     49// 23 Apr 2010   L. Pandola   Removed InitialiseElementSelectors() call. Useless here and
     50//                            triggers fake warning messages
    4451//
    4552
     
    8087  SetHighEnergyLimit(fIntrinsicHighEnergyLimit);
    8188  //
    82   // Atomic deexcitation model activated by default
    83   SetDeexcitationFlag(true);
     89  //
    8490  verboseLevel= 0;
    8591 
     
    9096  // 3 = calculation of cross sections, file openings, sampling of atoms
    9197  // 4 = entering in methods
     98
     99  // Atomic deexcitation model activated by default
     100  SetDeexcitationFlag(true);
     101  ActivateAuger(false);
    92102 
    93103  //These vectors do not change when materials or cut change.
     
    140150
    141151void G4PenelopeIonisationModel::Initialise(const G4ParticleDefinition* particle,
    142                                        const G4DataVector& cuts)
     152                                       const G4DataVector& )
    143153{
    144154  if (verboseLevel > 3)
     
    175185  //This is used to retrieve cross section values later on
    176186  crossSectionHandler->BuildMeanFreePathForMaterials();
    177 
    178   InitialiseElementSelectors(particle,cuts);
    179187 
    180188  if (verboseLevel > 2)
     
    280288//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    281289
     290//This is a dummy method. Never inkoved by the tracking, it just issues
     291//a warning if one tries to get Cross Sections per Atom via the
     292//G4EmCalculator.
     293G4double G4PenelopeIonisationModel::ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
     294                                                             G4double,
     295                                                             G4double,
     296                                                             G4double,
     297                                                             G4double,
     298                                                             G4double)
     299{
     300  G4cout << "*** G4PenelopeIonisationModel -- WARNING ***" << G4endl;
     301  G4cout << "Penelope Ionisation model does not calculate cross section _per atom_ " << G4endl;
     302  G4cout << "so the result is always zero. For physics values, please invoke " << G4endl;
     303  G4cout << "GetCrossSectionPerVolume() or GetMeanFreePath() via the G4EmCalculator" << G4endl;
     304  return 0;
     305}
     306
     307//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     308
    282309G4double G4PenelopeIonisationModel::ComputeDEDXPerVolume(const G4Material* material,
    283310                                           const G4ParticleDefinition* theParticle,
     
    348375    } 
    349376  return sPower;
     377}
     378
     379//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     380
     381G4double G4PenelopeIonisationModel::MinEnergyCut(const G4ParticleDefinition*,
     382                                                 const G4MaterialCutsCouple*)
     383{
     384  return fIntrinsicLowEnergyLimit;
    350385}
    351386
  • trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopePhotoElectric.cc

    r1228 r1315  
    2626//
    2727// $Id: G4PenelopePhotoElectric.cc,v 1.16 2009/06/11 15:47:08 mantero Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: L. Pandola
  • trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopePhotoElectricModel.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PenelopePhotoElectricModel.cc,v 1.10 2009/10/23 09:29:24 pandola Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4PenelopePhotoElectricModel.cc,v 1.12 2010/03/26 09:32:50 pandola Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// Author: Luciano Pandola
     
    4646// 21 Oct 2009   L Pandola    Remove un-necessary fUseAtomicDeexcitation flag - now managed by
    4747//                            G4VEmModel::DeexcitationFlag()
     48// 15 Mar 2010   L Pandola    Explicitely initialize Auger to false
    4849//
    4950
     
    7576  SetHighEnergyLimit(fIntrinsicHighEnergyLimit);
    7677  //
    77   //by default the model will inkove the atomic deexcitation
    78   SetDeexcitationFlag(true); 
    79 
    8078  verboseLevel= 0;
    8179  // Verbosity scale:
     
    8583  // 3 = calculation of cross sections, file openings, sampling of atoms
    8684  // 4 = entering in methods
     85
     86  //by default the model will inkove the atomic deexcitation
     87  SetDeexcitationFlag(true); 
     88  ActivateAuger(false);
    8789}
    8890
     
    252254  // In such cases do not generate secondaries
    253255  if (eKineticEnergy > 0.)
    254     {
    255       //Now check if the electron is above cuts: if so, it is created explicitely
    256       //VI: checking cut here provides inconsistency in testing
    257       //      if (eKineticEnergy > cutE)
     256    {   
    258257      // The electron is created
    259258      // Direction sampled from the Sauter distribution
     
    271270      fvect->push_back(electron);
    272271    }
    273   //  else
    274   //  {
    275   //    localEnergyDeposit += eKineticEnergy;   
    276   //    eKineticEnergy = 0;
    277   //  }
    278   //  }
    279272  else
    280273    {
  • trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeRayleigh.cc

    r1228 r1315  
    2727//
    2828// $Id: G4PenelopeRayleigh.cc,v 1.19 2009/06/11 15:47:08 mantero Exp $
    29 // GEANT4 tag $Name: geant4-09-03 $
     29// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    3030//
    3131// Author: L. Pandola (luciano.pandola@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeRayleighModel.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PenelopeRayleighModel.cc,v 1.6 2009/06/11 15:47:08 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4PenelopeRayleighModel.cc,v 1.7 2009/12/21 12:49:01 pandola Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// Author: Luciano Pandola
     
    3737// 19 May 2009   L Pandola    Explicitely set to zero pointers deleted in
    3838//                            PrepareConstants(), since they might be checked later on
     39// 18 Dec 2009   L Pandola    Added a dummy ComputeCrossSectionPerAtom() method issueing a
     40//                            warning if users try to access atomic cross sections via
     41//                            G4EmCalculator
    3942//
    4043
     
    190193      G4int atomsPerMolecule = 0;
    191194      for (G4int k=0;k<nElements;k++)
     195       {
    192196        atomsPerMolecule += stechiometric[k];
     197        if (verboseLevel > 2)
     198           {
     199             G4cout << "Element: " << (G4int) (*elementVector)[k]->GetZ() << " has " <<
     200                stechiometric[k] << " atoms/molecule" << G4endl;       
     201           }
     202       }
    193203      if (atomsPerMolecule)
    194204        {
     
    203213        }
    204214    }
    205 
     215 
    206216  if (verboseLevel > 2)
    207217    {
     
    221231  return cross;
    222232}
     233
     234
     235//This is a dummy method. Never inkoved by the tracking, it just issues
     236//a warning if one tries to get Cross Sections per Atom via the
     237//G4EmCalculator.
     238G4double G4PenelopeRayleighModel::ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
     239                                                             G4double,
     240                                                             G4double,
     241                                                             G4double,
     242                                                             G4double,
     243                                                             G4double)
     244{
     245  G4cout << "*** G4PenelopeRayleighModel -- WARNING ***" << G4endl;
     246  G4cout << "Penelope Rayleigh model does not calculate cross section _per atom_ " << G4endl;
     247  G4cout << "so the result is always zero. For physics values, please invoke " << G4endl;
     248  G4cout << "GetCrossSectionPerVolume() or GetMeanFreePath() via the G4EmCalculator" << G4endl;
     249  return 0;
     250}
     251
    223252
    224253//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
  • trunk/source/processes/electromagnetic/lowenergy/src/G4RangeTest.cc

    r1228 r1315  
    2626//
    2727// $Id: G4RangeTest.cc,v 1.9 2009/06/10 13:32:36 mantero Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4RayleighScattering.cc

    r1228 r1315  
    2525//
    2626// $Id: G4RayleighScattering.cc,v 1.2 2009/03/18 13:45:51 pandola Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929//
  • trunk/source/processes/electromagnetic/lowenergy/src/G4SemiLogInterpolation.cc

    r1228 r1315  
    2626//
    2727// $Id: G4SemiLogInterpolation.cc,v 1.8 2009/09/25 07:41:34 sincerti Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4ShellData.cc

    r1228 r1315  
    2626//
    2727// $Id: G4ShellData.cc,v 1.11 2009/06/10 13:32:36 mantero Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4ShellEMDataSet.cc

    r1228 r1315  
    2626//
    2727// $Id: G4ShellEMDataSet.cc,v 1.18 2009/09/25 07:41:34 sincerti Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4VCrossSectionHandler.cc

    r1228 r1315  
    2626//
    2727// $Id: G4VCrossSectionHandler.cc,v 1.19 2009/09/25 07:41:34 sincerti Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4VLowEnergyDiscretePhotonProcess.cc

    r1228 r1315  
    2525//
    2626// $Id: G4VLowEnergyDiscretePhotonProcess.cc,v 1.6 2009/06/10 13:32:36 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// --------------------------------------------------------------
  • trunk/source/processes/electromagnetic/lowenergy/src/G4VeLowEnergyLoss.cc

    r1228 r1315  
    2626//
    2727// $Id: G4VeLowEnergyLoss.cc,v 1.27 2009/07/23 09:15:37 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
  • trunk/source/processes/electromagnetic/lowenergy/src/G4VhShellCrossSection.cc

    r819 r1315  
    6161                                               G4double mass,
    6262                                               G4double deltaEnergy) const
     63//  returns the shell ionized if the shell exists. If the shell is not counted, it returns -1
     64
    6365{
    6466  std::vector<G4double> p = Probabilities(Z,incidentEnergy,mass,deltaEnergy);
    65   G4int shell = 0;
     67  G4int shell = -1;
    6668  size_t nShells = p.size();
    6769  G4double q = G4UniformRand();
  • trunk/source/processes/electromagnetic/lowenergy/src/G4WaterExcitationStructure.cc

    r1228 r1315  
    2626//
    2727// $Id: G4WaterExcitationStructure.cc,v 1.1 2007/10/15 08:57:54 pia Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4WaterIonisationStructure.cc

    r1228 r1315  
    2626//
    2727// $Id: G4WaterIonisationStructure.cc,v 1.1 2007/11/08 20:39:35 pia Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4eBremsstrahlungSpectrum.cc

    r1228 r1315  
    2525//
    2626// $Id: G4eBremsstrahlungSpectrum.cc,v 1.16 2009/06/10 13:32:36 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
  • trunk/source/processes/electromagnetic/lowenergy/src/G4eCrossSectionExcitationEmfietzoglou.cc

    r1228 r1315  
    2626//
    2727// $Id: G4eCrossSectionExcitationEmfietzoglou.cc,v 1.1 2007/05/04 10:16:06 pia Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030
    3131// $Id: G4eCrossSectionExcitationEmfietzoglou.cc,v 1.1 2007/05/04 10:16:06 pia Exp $
    32 // GEANT4 tag $Name: geant4-09-03 $
     32// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    3333//
    3434// Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4eCrossSectionScreenedRutherford.cc

    r1228 r1315  
    2626//
    2727// $Id: G4eCrossSectionScreenedRutherford.cc,v 1.3 2007/10/12 12:27:19 pia Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4eIonisationCrossSectionHandler.cc

    r1228 r1315  
    2525//
    2626// $Id: G4eIonisationCrossSectionHandler.cc,v 1.15 2009/09/27 10:47:42 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
  • trunk/source/processes/electromagnetic/lowenergy/src/G4eIonisationParameters.cc

    r1228 r1315  
    2626//
    2727// $Id: G4eIonisationParameters.cc,v 1.25 2009/06/10 13:32:36 mantero Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4eIonisationSpectrum.cc

    r1228 r1315  
    2525//
    2626// $Id: G4eIonisationSpectrum.cc,v 1.27 2009/06/10 13:32:36 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
  • trunk/source/processes/electromagnetic/lowenergy/src/G4eLowEnergyLoss.cc

    r1228 r1315  
    2626//
    2727// $Id: G4eLowEnergyLoss.cc,v 1.37 2009/07/23 09:15:37 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929// 
    3030// -----------------------------------------------------------
  • trunk/source/processes/electromagnetic/lowenergy/src/G4empCrossSection.cc

    r1197 r1315  
    2525//
    2626//$Id: G4empCrossSection.cc,v 1.2 2009/06/25 15:52:08 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03-cand-01 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929//         
  • trunk/source/processes/electromagnetic/lowenergy/src/G4hLowEnergyIonisation.cc

    r1228 r1315  
    100100//               parametrised proton model: min(user value, model limit)
    101101// 26 Jan   2005 S. Chauvie added PrintInfoDefinition() for antiproton
    102 
    103 
     102// 30 Sep   2009 A.Mantero Removed dependencies to old shell Ionisation XS models
     103// 07 Jun    2010 Code Celaning for June beta Release
    104104// -----------------------------------------------------------------------
    105105
     
    121121#include "G4ShellVacancy.hh"
    122122#include "G4VhShellCrossSection.hh"
    123 #include "G4hShellCrossSection.hh"
    124 #include "G4hShellCrossSectionExp.hh"
    125 #include "G4hShellCrossSectionDoubleExp.hh"
    126123#include "G4VEMDataSet.hh"
    127124#include "G4EMDataSet.hh"
     
    132129#include "G4ProcessManager.hh"
    133130#include "G4ProductionCutsTable.hh"
    134 
     131#include "G4teoCrossSection.hh"
     132#include "G4empCrossSection.hh"
    135133//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    136134
     
    153151    shellVacancy(0),
    154152    shellCS(0),
    155     theFluo(false),
    156     expFlag(false)
     153    theFluo(false)
    157154{
    158155  InitializeMe();
     
    175172  verboseLevel         = 0;
    176173
    177 //****************************************************************************
    178 // By default the method of cross section's calculation is swiched on an
    179 // 2nd implementation empirical model (G4hShellCrossSectionDoubleExp),
    180 // if you want to use Gryzinski's model (G4hShellCrossSection()) or the
    181 // 1st empiric one (G4hShellCrossSectionExp), you must change the
    182 // selection below and switching expFlag to FALSE
    183 //****************************************************************************
    184 
    185   //shellCS = new G4hShellCrossSection();
    186   //shellCS = new G4hShellCrossSectionExp();
    187   shellCS = new G4hShellCrossSectionDoubleExp();
    188   expFlag=true;
     174  shellCS = new G4teoCrossSection("analytical");
     175
    189176}
    190177
     
    12801267  //   G4cout << "Fluorescence is switched :" << theFluo << G4endl;
    12811268
     1269  // Fluorescence data start from element 6
    12821270  if(theFluo && Z > 5) {
    12831271
    12841272
    12851273
    1286     // Atom total cross section for the Empiric Model   
    1287     if (expFlag) {   
     1274    // Atom total cross section     
    12881275    shellCS->SetTotalCS(totalCrossSectionMap[Z]);   
    1289     }
     1276
    12901277    G4int shell = shellCS->SelectRandomShell(Z, KineticEnergy,ParticleMass,DeltaKineticEnergy);
    12911278
    1292     if (expFlag && shell==1) {       
    1293       aParticleChange.ProposeLocalEnergyDeposit (KineticEnergy);
    1294       aParticleChange.ProposeEnergy(0);     
    1295     }
    1296 
    1297 
    1298     const G4AtomicShell* atomicShell =
    1299                 (G4AtomicTransitionManager::Instance())->Shell(Z, shell);
    1300     G4double bindingEnergy = atomicShell->BindingEnergy();
    1301 
    1302     if(verboseLevel > 1) {
    1303       G4cout << "PostStep Z= " << Z << " shell= " << shell
    1304              << " bindingE(keV)= " << bindingEnergy/keV
    1305              << " finalE(keV)= " << finalKineticEnergy/keV
    1306              << G4endl;
    1307     }
    1308 
    1309     // Fluorescence data start from element 6
    1310 
    1311     if (finalKineticEnergy >= bindingEnergy
    1312          && (bindingEnergy >= minGammaEnergy
    1313          ||  bindingEnergy >= minElectronEnergy) ) {
    1314 
    1315       G4int shellId = atomicShell->ShellId();
    1316       secondaryVector = deexcitationManager.GenerateParticles(Z, shellId);
    1317 
    1318       if (secondaryVector != 0) {
    1319 
    1320         nSecondaries = secondaryVector->size();
    1321         for (size_t i = 0; i<nSecondaries; i++) {
    1322 
    1323           aSecondary = (*secondaryVector)[i];
    1324           if (aSecondary) {
    1325 
    1326             G4double e = aSecondary->GetKineticEnergy();
    1327             type = aSecondary->GetDefinition();
    1328             if (e < finalKineticEnergy &&
    1329                  ((type == G4Gamma::Gamma() && e > minGammaEnergy ) ||
    1330                   (type == G4Electron::Electron() && e > minElectronEnergy ))) {
    1331 
    1332               finalKineticEnergy -= e;
    1333               totalNumber++;
    1334 
    1335             } else {
    1336 
    1337               delete aSecondary;
    1338               (*secondaryVector)[i] = 0;
     1279    if (shell!=-1) {       
     1280     
     1281      const G4AtomicShell* atomicShell =
     1282        (G4AtomicTransitionManager::Instance())->Shell(Z, shell);
     1283      G4double bindingEnergy = atomicShell->BindingEnergy();
     1284     
     1285      if(verboseLevel > 1) {
     1286        G4cout << "PostStep Z= " << Z << " shell= " << shell
     1287               << " bindingE(keV)= " << bindingEnergy/keV
     1288               << " finalE(keV)= " << finalKineticEnergy/keV
     1289               << G4endl;
     1290      }
     1291     
     1292     
     1293     
     1294      if (finalKineticEnergy >= bindingEnergy
     1295          && (bindingEnergy >= minGammaEnergy
     1296              ||  bindingEnergy >= minElectronEnergy) ) {
     1297       
     1298        G4int shellId = atomicShell->ShellId();
     1299        secondaryVector = deexcitationManager.GenerateParticles(Z, shellId);
     1300       
     1301        if (secondaryVector != 0) {
     1302         
     1303          nSecondaries = secondaryVector->size();
     1304          for (size_t i = 0; i<nSecondaries; i++) {
     1305           
     1306            aSecondary = (*secondaryVector)[i];
     1307            if (aSecondary) {
     1308             
     1309              G4double e = aSecondary->GetKineticEnergy();
     1310              type = aSecondary->GetDefinition();
     1311              if (e < finalKineticEnergy &&
     1312                  ((type == G4Gamma::Gamma() && e > minGammaEnergy ) ||
     1313                   (type == G4Electron::Electron() && e > minElectronEnergy ))) {
     1314               
     1315                finalKineticEnergy -= e;
     1316                totalNumber++;
     1317               
     1318              } else {
     1319               
     1320                delete aSecondary;
     1321                (*secondaryVector)[i] = 0;
     1322              }
    13391323            }
    13401324          }
     
    13431327    }
    13441328  }
    1345 
     1329 
    13461330  // Save delta-electrons
    13471331
     
    14011385//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    14021386
    1403 std::vector<G4DynamicParticle*>*
    1404 G4hLowEnergyIonisation::DeexciteAtom(const G4MaterialCutsCouple* couple,
     1387
     1388
     1389void G4hLowEnergyIonisation::SelectShellIonisationCS(G4String val) {
     1390
     1391  if (val == "analytical" )  { 
     1392    if (shellCS) delete shellCS;
     1393    shellCS = new G4teoCrossSection(val);
     1394  }
     1395  else if (val == "empirical") {
     1396    if (shellCS) delete shellCS;
     1397    shellCS = new G4empCrossSection();
     1398  }
     1399}
     1400
     1401
     1402
     1403//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     1404
     1405
     1406std::vector<G4DynamicParticle*>* G4hLowEnergyIonisation::DeexciteAtom(const G4MaterialCutsCouple* couple,
    14051407                                           G4double incidentEnergy,
    14061408                                           G4double hMass,
  • trunk/source/processes/electromagnetic/lowenergy/src/G4hLowEnergyLoss.cc

    r1228 r1315  
    2626//
    2727// $Id: G4hLowEnergyLoss.cc,v 1.30 2009/07/23 09:15:37 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// -----------------------------------------------------------
  • trunk/source/processes/electromagnetic/lowenergy/src/G4hShellCrossSectionDoubleExp.cc

    r1228 r1315  
    4141// Empiric Model for shell cross sections in proton ionisation
    4242// -------------------------------------------------------------------
    43 // $Id: G4hShellCrossSectionDoubleExp.cc,v 1.10 2009/06/10 13:32:36 mantero Exp $
    44 // GEANT4 tag $Name: geant4-09-03 $
     43// $Id: G4hShellCrossSectionDoubleExp.cc,v 1.11 2010/02/05 08:54:12 sincerti Exp $
     44// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    4545
    4646#include "globals.hh"
     
    5656{
    5757  kShellData = new G4hShellCrossSectionDoubleExpData();
     58
     59  atomTotalCrossSection = 0.;
    5860}
    5961
  • trunk/source/processes/electromagnetic/lowenergy/src/G4hShellCrossSectionDoubleExpData.cc

    r1228 r1315  
    3434// -------------------------------------------------------------------
    3535// $Id: G4hShellCrossSectionDoubleExpData.cc,v 1.5 2009/06/10 13:32:36 mantero Exp $
    36 // GEANT4 tag $Name: geant4-09-03 $
     36// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    3737
    3838#include "G4hShellCrossSectionDoubleExpData.hh"
  • trunk/source/processes/electromagnetic/lowenergy/src/G4hShellCrossSectionExp.cc

    r1228 r1315  
    4242// -------------------------------------------------------------------
    4343// $Id: G4hShellCrossSectionExp.cc,v 1.7 2009/06/10 13:32:36 mantero Exp $
    44 // GEANT4 tag $Name: geant4-09-03 $
     44// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    4545
    4646#include "globals.hh"
  • trunk/source/processes/electromagnetic/lowenergy/src/G4hShellCrossSectionExpData.cc

    r1228 r1315  
    3434// -------------------------------------------------------------------
    3535// $Id: G4hShellCrossSectionExpData.cc,v 1.4 2009/06/10 13:32:36 mantero Exp $
    36 // GEANT4 tag $Name: geant4-09-03 $
     36// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    3737
    3838#include "G4hShellCrossSectionExpData.hh"
  • trunk/source/processes/electromagnetic/lowenergy/src/G4teoCrossSection.cc

    r1197 r1315  
    2424// ********************************************************************
    2525//
    26 //$Id: G4teoCrossSection.cc,v 1.5 2009/11/11 09:14:53 mantero Exp $
    27 // GEANT4 tag $Name: geant4-09-03-cand-01 $
     26//$Id: G4teoCrossSection.cc,v 1.6 2010/06/06 23:40:35 mantero Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929//         
     
    3333//  21 Apr 2009   ALF   1st implementation
    3434//  29 Apr 2009   ALF Updated Desing for Integration
    35 //  11 Nov 2009   ALF update and code cleaning for the Dec Release
    3635//
    3736// -------------------------------------------------------------------
     
    5049//#include <math.h>
    5150
    52 G4teoCrossSection::G4teoCrossSection(G4String shellModel = "ecpssr")
     51G4teoCrossSection::G4teoCrossSection(G4String shellModel)
    5352  :totalCS(0)
    5453{
    5554
    56   if (shellModel == "ecpssr") {
    57 
    58     ecpssrShellK = new G4ecpssrKCrossSection();
    59 
    60     ecpssrShellLi = new G4ecpssrLiCrossSection();
     55  if (shellModel == "analytical") {
     56   
     57       
     58    ecpssrShellK  = new G4AnalyticalEcpssrKCrossSection(); 
     59    ecpssrShellLi = new G4AnalyticalEcpssrLiCrossSection();
     60   
    6161  }
    62   else {
    63 
    64     G4cout << "G4teoCrossSection: sorry, only ECPSSR model available at the moment" << G4endl;
    65 
    66     ecpssrShellK = new G4ecpssrKCrossSection();
    67 
    68     ecpssrShellLi = new G4ecpssrLiCrossSection();
    69 
    70   }
    71 
    72 
    7362}
    7463
  • trunk/source/processes/electromagnetic/muons/History

    r1196 r1315  
    1 $Id: History,v 1.134 2009/11/09 19:18:01 vnivanch Exp $
     1$Id: History,v 1.136 2010/06/04 09:30:40 vnivanch Exp $
    22-------------------------------------------------------------------
    33
     
    1717     * Reverse chronological order (last date on top), please *
    1818     ----------------------------------------------------------
     19
     204 June 2010: V.Ivant (emmuons-V09-03-01)
     21- G4MuIonisation - use G4ICRU73QOModel for mu- for E< 0.2 MeV
     22
     231 June 2010: V.Ivant (emmuons-V09-03-00)
     24- G4MuPairProductionModel - added sampling recoil of a primary particle
     25- G4MuIonisation - added G4ICRU73QOModel for mu- for E< 1 MeV
    1926
    202709 November 09: V.Ivant (emmuons-V09-02-08)
  • trunk/source/processes/electromagnetic/muons/src/G4MuIonisation.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4MuIonisation.cc,v 1.59 2009/02/26 11:04:20 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4MuIonisation.cc,v 1.61 2010/06/04 09:30:40 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    8989#include "G4BohrFluctuations.hh"
    9090#include "G4UnitsTable.hh"
     91#include "G4ICRU73QOModel.hh"
    9192
    9293//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    140141
    141142    mass = theParticle->GetPDGMass();
     143    G4double q = theParticle->GetPDGCharge();
     144    G4double elow = 0.2*MeV;
    142145    SetSecondaryParticle(G4Electron::Electron());
    143146
    144147    // Bragg peak model
    145     if (!EmModel(1)) SetEmModel(new G4BraggModel(),1);
     148    if (!EmModel(1)) {
     149      if(q > 0.0) { SetEmModel(new G4BraggModel(),1); }
     150      else {
     151        SetEmModel(new G4ICRU73QOModel(),1);
     152        //elow = 1.0*MeV;
     153      }
     154    }
    146155    EmModel(1)->SetLowEnergyLimit(MinKinEnergy());
    147     EmModel(1)->SetHighEnergyLimit(0.2*MeV);
     156    EmModel(1)->SetHighEnergyLimit(elow);
    148157    AddEmModel(1, EmModel(1), new G4IonFluctuations());
    149158
    150159    // high energy fluctuation model
    151     if (!FluctModel()) SetFluctModel(new G4UniversalFluctuation());
     160    if (!FluctModel()) { SetFluctModel(new G4UniversalFluctuation()); }
    152161
    153162    // moderate energy model
    154     if (!EmModel(2)) SetEmModel(new G4BetheBlochModel(),2);
    155     EmModel(2)->SetLowEnergyLimit(0.2*MeV);
     163    if (!EmModel(2)) { SetEmModel(new G4BetheBlochModel(),2); }
     164    EmModel(2)->SetLowEnergyLimit(elow);
    156165    EmModel(2)->SetHighEnergyLimit(1.0*GeV);
    157166    AddEmModel(2, EmModel(2), FluctModel());
    158167
    159168    // high energy model
    160     if (!EmModel(3)) SetEmModel(new G4MuBetheBlochModel(),3);
     169    if (!EmModel(3)) { SetEmModel(new G4MuBetheBlochModel(),3); }
    161170    EmModel(3)->SetLowEnergyLimit(1.0*GeV);
    162171    EmModel(3)->SetHighEnergyLimit(MaxKinEnergy());
  • trunk/source/processes/electromagnetic/muons/src/G4MuPairProductionModel.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4MuPairProductionModel.cc,v 1.44 2009/08/11 16:50:07 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4MuPairProductionModel.cc,v 1.45 2010/06/01 15:21:59 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    466466{
    467467  G4double kineticEnergy = aDynamicParticle->GetKineticEnergy();
    468   G4double totalEnergy   = kineticEnergy + particleMass ;
    469   G4ParticleMomentum ParticleDirection =
    470     aDynamicParticle->GetMomentumDirection();
     468  G4double totalEnergy   = kineticEnergy + particleMass;
     469  G4double totalMomentum =
     470    sqrt(kineticEnergy*(kineticEnergy + 2.0*particleMass));
     471
     472  G4ThreeVector partDirection = aDynamicParticle->GetMomentumDirection();
    471473
    472474  G4int it;
    473   for(it=1; it<ntdat; it++) {if(kineticEnergy <= tdat[it]) break;}
    474   if(it == ntdat) it--;
     475  for(it=1; it<ntdat; ++it) {if(kineticEnergy <= tdat[it]) break;}
     476  if(it == ntdat) { --it; }
    475477  G4double dt = log(kineticEnergy/tdat[it-1])/log(tdat[it]/tdat[it-1]);
    476478
    477479  // select randomly one element constituing the material
    478   const G4Element* anElement = SelectRandomAtom(kineticEnergy, dt, it, couple, tmin);
     480  const G4Element* anElement =
     481    SelectRandomAtom(kineticEnergy, dt, it, couple, tmin);
    479482  SetCurrentElement(anElement->GetZ());
    480483
     
    484487  G4double minEnergy     = std::max(tmin, minPairEnergy);
    485488
    486   if(minEnergy >= maxEnergy) return;
     489  if(minEnergy >= maxEnergy) { return; }
    487490  //G4cout << "emin= " << minEnergy << " emax= " << maxEnergy
    488491  //     << " minPair= " << minPairEnergy << " maxpair= " << maxPairEnergy
     
    507510  G4int iz, iy;
    508511
    509   for(iz=1; iz<nzdat; iz++) {if(currentZ <= zdat[iz]) break;}
    510   if(iz == nzdat) iz--;
     512  for(iz=1; iz<nzdat; ++iz) { if(currentZ <= zdat[iz]) { break; } }
     513  if(iz == nzdat) { --iz; }
    511514
    512515  G4double dz = log(currentZ/zdat[iz-1])/log(zdat[iz]/zdat[iz-1]);
     
    520523  G4double p1 = pmin;
    521524  G4double p2 = pmin;
    522   for(iy=iymin+1; iy<=iymax; iy++) {
     525  for(iy=iymin+1; iy<=iymax; ++iy) {
    523526    p1 = p2;
    524527    p2 = InterpolatedIntegralCrossSection(dt, dz, iz, it, iy, currentZ);
     
    532535                       *log(maxPairEnergy/minPairEnergy));
    533536                       
    534   if(PairEnergy < minEnergy) PairEnergy = minEnergy;
    535   if(PairEnergy > maxEnergy) PairEnergy = maxEnergy;
     537  if(PairEnergy < minEnergy) { PairEnergy = minEnergy; }
     538  if(PairEnergy > maxEnergy) { PairEnergy = maxEnergy; }
    536539
    537540  // sample r=(E+-E-)/PairEnergy  ( uniformly .....)
     
    545548  G4double PositronEnergy = PairEnergy - ElectronEnergy;
    546549
    547   //  angles of the emitted particles ( Z - axis along the parent particle)
    548   //      (mean theta for the moment)
    549 
    550   //
    551   // scattered electron (positron) angles. ( Z - axis along the parent photon)
    552   //
    553   //  universal distribution suggested by L. Urban
    554   // (Geant3 manual (1993) Phys211),
    555   //  derived from Tsai distribution (Rev Mod Phys 49,421(1977))
    556   //  G4cout << "Ee= " << ElectronEnergy << " Ep= " << PositronEnergy << G4endl;
    557   G4double u;
    558   const G4double a1 = 0.625 , a2 = 3.*a1 , d = 27. ;
    559 
    560   if (9./(9.+d) >G4UniformRand()) u= - log(G4UniformRand()*G4UniformRand())/a1;
    561   else                            u= - log(G4UniformRand()*G4UniformRand())/a2;
    562 
    563   G4double TetEl = u*electron_mass_c2/ElectronEnergy;
    564   G4double TetPo = u*electron_mass_c2/PositronEnergy;
    565   G4double Phi  = twopi * G4UniformRand();
    566   G4double dxEl= sin(TetEl)*cos(Phi),dyEl= sin(TetEl)*sin(Phi),dzEl=cos(TetEl);
    567   G4double dxPo=-sin(TetPo)*cos(Phi),dyPo=-sin(TetPo)*sin(Phi),dzPo=cos(TetPo);
    568 
    569   G4ThreeVector ElectDirection (dxEl, dyEl, dzEl);
    570   ElectDirection.rotateUz(ParticleDirection);
     550  // The angle of the emitted virtual photon is sampled
     551  // according to the muon bremsstrahlung model
     552 
     553  G4double gam  = totalEnergy/particleMass;
     554  G4double gmax = gam*std::min(1.0, totalEnergy/PairEnergy - 1.0);
     555  G4double gmax2= gmax*gmax;
     556  G4double x = G4UniformRand()*gmax2/(1.0 + gmax2);
     557
     558  G4double theta = sqrt(x/(1.0 - x))/gam;
     559  G4double sint  = sin(theta);
     560  G4double phi   = twopi * G4UniformRand() ;
     561  G4double dirx  = sint*cos(phi), diry = sint*sin(phi), dirz = cos(theta) ;
     562
     563  G4ThreeVector gDirection(dirx, diry, dirz);
     564  gDirection.rotateUz(partDirection);
     565
     566  // the angles of e- and e+ assumed to be the same as virtual gamma
    571567
    572568  // create G4DynamicParticle object for the particle1
    573   G4DynamicParticle* aParticle1= new G4DynamicParticle(theElectron,
    574                                                        ElectDirection,
    575                                              ElectronEnergy - electron_mass_c2);
    576 
    577   G4ThreeVector PositDirection (dxPo, dyPo, dzPo);
    578   PositDirection.rotateUz(ParticleDirection);
     569  G4DynamicParticle* aParticle1 =
     570    new G4DynamicParticle(theElectron, gDirection,
     571                          ElectronEnergy - electron_mass_c2);
    579572
    580573  // create G4DynamicParticle object for the particle2
    581574  G4DynamicParticle* aParticle2 =
    582     new G4DynamicParticle(thePositron,
    583                           PositDirection,
     575    new G4DynamicParticle(thePositron, gDirection,
    584576                          PositronEnergy - electron_mass_c2);
    585577
     
    588580  fParticleChange->SetProposedKineticEnergy(kineticEnergy);
    589581
     582  partDirection *= totalMomentum;
     583  partDirection -= (aParticle1->GetMomentum() + aParticle2->GetMomentum());
     584  partDirection = partDirection.unit();
     585  fParticleChange->SetProposedMomentumDirection(partDirection);
     586
     587  // add secondary
    590588  vdp->push_back(aParticle1);
    591589  vdp->push_back(aParticle2);
  • trunk/source/processes/electromagnetic/muons/test/muEnergyLossTest.cc

    r1199 r1315  
    2626//
    2727// $Id: muEnergyLossTest.cc,v 1.7 2006/06/29 19:49:56 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03-cand-01 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//-----------------------------------------------------------------
  • trunk/source/processes/electromagnetic/standard/History

    r1228 r1315  
    1 $Id: History,v 1.480 2009/12/03 17:28:28 vnivanch Exp $
     1$Id: History,v 1.504 2010/06/04 09:25:12 vnivanch Exp $
    22-------------------------------------------------------------------
    33
     
    1717     * Reverse chronological order (last date on top), please *
    1818     ----------------------------------------------------------
     19
     204 June 2010:  V.Ivant (emstand-V09-03-17)
     21- G4ICRU73QOModel - fixed problems and add factor for transition to
     22                    Bethe-Bloch at 2 MeV
     23- G4hIonisation - use G4ICRU73QOModel for negatively charged particles
     24                  below 2 MeV
     25- G4BraggModel - above 2 MeV use ICRU'49 parameterisation for all atoms
     26
     27June 3, 2010, V. Grichine
     28- G4PAIModel.cc, G4PAIPhotonModel.cc cout for the model initialisation
     29
     301 June 2010:  V.Ivant (emstand-V09-03-16)
     31- G4WentzelOKandVIxSection - optimized computation of the transport
     32                             cross section
     33- G4WentzelVIModel - optimized method of step limitation
     34
     3527 May 2010:  V.Ivant (emstand-V09-03-15)
     36- G4BraggIonGasModel, G4BetheBlochIonGasModel - new ionisation models
     37                      for low density media
     38- G4ICRU73QOModel (A.Bagulya) new model for anti-particles
     39- G4hIonisation - use G4ICRU73QOModel for anti-particles
     40- G4WentzelOKandVIxSection - new class to compute cross sections and
     41                             sample scattering angle 
     42- G4WentzelVIModel, G4eCoulombScatteringModel, G4CoulombScatteringModel
     43                    use new class G4WentzelOKandVIxSection
     44
     4520 May 2010:  V.Ivant (emstand-V09-03-14)
     46- G4UrbanMscModel93 - L.Urban removed randomisation of step limit for the
     47                      first step in any volume in the case of UseSafety
     48- Removed obsolete models: G4UrbanMscModel, G4UrbanMscModel2, G4UrbanMscModel71,
     49  G4MultipleScattering, G4ComptonScattering52, G4PolarizedComptonScattering
     50
     5117 May 2010:  V.Ivant (emstand-V09-03-13)
     52- G4WentzelVIModel, G4eCoulombScatteringModel - added momentum dependent
     53       limit of scattering angle between single and multiple scattering
     54       which allowing to use  G4WentzelVIModel with optical model
     55       of hadron scattering
     56
     5717 May 2010:  V.Ivant (emstand-V09-03-12)
     58- G4GoudsmitSaundersonMscModel, G4GoudsmitSaundersonTable (O.Kadri) -
     59       optimized code to improve speed by addition extra class members
     60
     6130 April 2010:  V.Ivant (emstand-V09-03-11)
     62- G4UrbanMscModel93 - L.Urban add randomisation of step limit for the
     63                      first step in any volume
     64
     6528 April 2010:  V.Ivant (emstand-V09-03-10)
     66G4eBremsstrahlungModel - fixed SelectRandomAtom method (bug report #1115)
     67
     6826 April 2010:  V.Ivant (emstand-V09-03-09)
     69- G4ASTARStopping, G4PSTARTStopping - C-arrays sustituted by G4PhysicsVector
     70            with spline; reviewed names of materials (G4_He, G4_PHOTO_EMULSION,
     71            G4_NYLON-6-6)
     72- G4ASTARStopping - fixed G4_O data
     73- G4PSTARStopping - fixed G4_Pt and G4_PROPANE data
     74- G4WaterStopping - cleanup GetElectronicDEDX method
     75
     7616 April 2010:  V.Ivant (emstand-V09-03-08)
     77- G4GoudsmitSaundersonMscModel (O.Kadri) - improved numerical stability
     78            of computations for small angles by  direct xsection calculation
     79            not inverse of the inverse angular sampling without large angle
     80            rejection method longitudinal displacement is computed exactly
     81            from <z>
     82- G4GoudsmitSaundersonTable (O.Kadri)    - improved numerical stability by
     83            minimum of used arrays in computation within the dichotomy
     84            finding method
     85- G4eMultipleScattering, G4hMultipleScattering - improved printout at
     86                                                 initialisation
     87
     8815 April 2010:  V.Ivant (emstand-V09-03-07)
     89- G4hMultipleScattering - removed old unused header of G4UrbanMscModel
     90- G4ASTARStopping.cc - disabled corrupted data for Oxygen
     91
     9206 April 2010:  V.Ivant (emstand-V09-03-06)
     93- G4eBremsstrahlungRelModel, G4MollerBhabhaModel - set minimum cut
     94                      value to 0.1 keV
     95
     9630 March 2010:  V.Ivant (emstand-V09-03-05)
     97- G4PolarizedComptonScattering - add message that this process is obsolete
     98
     9922 March 2010:  V.Ivant (emstand-V09-03-04)
     100- G4eBremsstrahlungModel - reduced minThreshold to 0.1 keV
     101- G4MollerBhabhaModel - reduced minimum cut value to mean ionisation
     102                      potential
     103
     10401 March 2010:  V.Ivant (emstand-V09-03-03)
     105- G4WentzelVIModel - added protections, added DefineMaterial() call
     106                     before computing cross section
     107
     10831 March 2010:  V.Ivant (emstand-V09-03-02a)
     109- G4PolarizedComptonScattering - add message that this process is obsolete
     110- G4eCoulombScatteringModel - returned method default value 100 eV of 9.3 for
     111                              internal low limit
     112
     11324 February 2010:  V.Ivant (emstand-V09-03-02)
     114- make a tag co-working with emutils-V09-03-02
     115
     11619 February 2010:  V.Ivant (emstand-V09-03-01)
     117- G4GoudsmitSaundersonMscModel, G4GoudsmitSaundersonTable (O.Kadri)
     118      - fixed problems of small angle theta distributions
     119
     12017 February 2010:  V.Ivant (emstand-V09-03-00)
     121- G4CoulombScatteringModel - Added comments to relativistic formula
     122- G4eCoulombScatteringModel - Added method SetLowEnergyLimit, default
     123                              value is set to 1 eV (before was 100 eV)
     124- G4CoulombScattering - Removed inclined method SetBuildTableFlag because
     125                        the method exist in the base class
    19126
    2012703 December 09:  V.Ivant (emstand-V09-02-36)
  • trunk/source/processes/electromagnetic/standard/include/G4ASTARStopping.hh

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4ASTARStopping.hh,v 1.6 2008/11/13 12:04:37 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4ASTARStopping.hh,v 1.8 2010/04/26 17:22:08 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#ifndef G4ASTARStopping_h
     
    5555
    5656#include "globals.hh"
     57#include "G4LPhysicsFreeVector.hh"
     58#include <vector>
    5759
    5860class G4Material;
     
    7678  void Initialise();
    7779
     80  void AddData(G4double* e, G4double* s, G4int idx);
     81
    7882  // hide assignment operator
    7983  G4ASTARStopping & operator=(const  G4ASTARStopping &right);
    8084  G4ASTARStopping(const  G4ASTARStopping&);
    8185
     86  G4int matIndex;
    8287  const G4Material* currentMaterial;
    83   G4int index, matIndex;
    84   G4String name[74];
    85   G4double currentE, res;
    86   G4double e[74][78], kinE[78];
    87   G4double effZ[74];
     88  G4double emin;
     89  std::vector<G4String> name;
     90  std::vector<G4double> effZ;
     91  std::vector<G4LPhysicsFreeVector*> sdata;
    8892};
    8993
     
    97101{
    98102  return effZ[idx];
    99 }
     103} 
    100104
    101105#endif
  • trunk/source/processes/electromagnetic/standard/include/G4BetheBlochModel.hh

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4BetheBlochModel.hh,v 1.20 2009/04/23 17:44:43 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4BetheBlochModel.hh,v 1.23 2010/05/27 14:26:17 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    116116                                     G4double kineticEnergy);
    117117
    118   virtual void CorrectionsAlongStep(const G4MaterialCutsCouple*,
    119                                     const G4DynamicParticle*,
     118  virtual void CorrectionsAlongStep(const G4MaterialCutsCouple* couple,
     119                                    const G4DynamicParticle* dp,
    120120                                    G4double& eloss,
    121                                     G4double& niel,
     121                                    G4double&,
    122122                                    G4double length);
    123123
     
    133133                                      G4double kinEnergy);
    134134
     135  inline G4double GetChargeSquareRatio() const;
     136
     137  inline void SetChargeSquareRatio(G4double val);
     138
    135139private:
    136140
    137   inline void SetupParameters();
     141  void SetupParameters();
    138142
    139143  inline void SetParticle(const G4ParticleDefinition* p);
     
    169173//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    170174
    171 inline void G4BetheBlochModel::SetupParameters()
    172 {
    173   mass = particle->GetPDGMass();
    174   spin = particle->GetPDGSpin();
    175   G4double q = particle->GetPDGCharge()/eplus;
    176   chargeSquare = q*q;
    177   ratio = electron_mass_c2/mass;
    178   G4double magmom = particle->GetPDGMagneticMoment()*mass/(0.5*eplus*hbar_Planck*c_squared);
    179   magMoment2 = magmom*magmom - 1.0;
    180   formfact = 0.0;
    181   if(particle->GetLeptonNumber() == 0) {
    182     G4double x = 0.8426*GeV;
    183     if(spin == 0.0 && mass < GeV) {x = 0.736*GeV;}
    184     else if(mass > GeV) {
    185       x /= nist->GetZ13(mass/proton_mass_c2);
    186       //        tlimit = 51.2*GeV*A13[iz]*A13[iz];
    187     }
    188     formfact = 2.0*electron_mass_c2/(x*x);
    189     tlimit   = 2.0/formfact;
    190   }
    191 }
    192 
    193 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    194 
    195175inline void G4BetheBlochModel::SetParticle(const G4ParticleDefinition* p)
    196176{
    197177  if(particle != p) {
    198178    particle = p;
    199     if (p->GetPDGCharge()/eplus > 1.5 && p->GetBaryonNumber() > 2) isIon = true;
     179    if (p->GetPDGCharge()/eplus > 1.5 && p->GetBaryonNumber() > 2)
     180      { isIon = true; }
    200181    SetupParameters();
    201182  }
     
    206187inline void G4BetheBlochModel::SetGenericIon(const G4ParticleDefinition* p)
    207188{
    208   if(p && particle != p) {
    209     if(p->GetParticleName() == "GenericIon") isIon = true;
     189  if(p && particle != p) { 
     190    if(p->GetParticleName() == "GenericIon") { isIon = true; }
    210191  }
    211192}
    212193
     194//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     195
     196inline G4double G4BetheBlochModel::GetChargeSquareRatio() const
     197{
     198  return chargeSquare;
     199}
     200
     201//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     202
     203inline void G4BetheBlochModel::SetChargeSquareRatio(G4double val)
     204{
     205  chargeSquare = val;
     206}
     207
     208//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     209
    213210#endif
  • trunk/source/processes/electromagnetic/standard/include/G4BraggModel.hh

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4BraggModel.hh,v 1.14 2009/11/10 19:25:47 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4BraggModel.hh,v 1.15 2010/05/27 10:08:58 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    121121                                     const G4Material* mat,
    122122                                     G4double kineticEnergy);
    123   /*
    124   // add correction to energy loss and compute non-ionizing energy loss
    125   virtual void CorrectionsAlongStep(const G4MaterialCutsCouple*,
    126                                     const G4DynamicParticle*,
    127                                     G4double& eloss,
    128                                     G4double& niel,
    129                                     G4double length);
    130   */
    131123
    132124protected:
     
    134126  virtual G4double MaxSecondaryEnergy(const G4ParticleDefinition*,
    135127                                      G4double kinEnergy);
     128
     129  inline G4double GetChargeSquareRatio() const;
     130
     131  inline void SetChargeSquareRatio(G4double val);
    136132
    137133private:
     
    197193}
    198194
     195inline G4double G4BraggModel::GetChargeSquareRatio() const
     196{
     197  return chargeSquare;
     198}
     199
     200inline void G4BraggModel::SetChargeSquareRatio(G4double val)
     201{
     202  chargeSquare = val;
     203}
     204
    199205//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    200206
  • trunk/source/processes/electromagnetic/standard/include/G4CoulombScattering.hh

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4CoulombScattering.hh,v 1.13 2009/05/07 18:41:45 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4CoulombScattering.hh,v 1.14 2010/02/17 18:59:22 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    7373  // Set energy above which high energy model will be used
    7474  inline void SetHEModelLimit(G4double);
    75 
    76   // obsolete method to be removed
    77   inline void SetBuildTableFlag(G4bool);
    7875
    7976  // Print out of the class parameters
     
    125122//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    126123
    127 inline void G4CoulombScattering::SetBuildTableFlag(G4bool)
    128 {}
    129 
    130 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    131 
    132124inline void G4CoulombScattering::SetHEModelLimit(G4double val)
    133125{
  • trunk/source/processes/electromagnetic/standard/include/G4CoulombScatteringModel.hh

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4CoulombScatteringModel.hh,v 1.15 2008/07/31 13:11:34 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4CoulombScatteringModel.hh,v 1.17 2010/05/27 14:22:05 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    4545// 09.10.07 V.Ivanchenko reorganized methods, add cut dependence in scattering off e-
    4646// 09.06.08 V.Ivanchenko SelectIsotope is moved to the base class
     47// 27.05.10 V.Ivanchenko added G4WentzelOKandVIxSection class to
     48//              compute cross sections and sample scattering angle
    4749//
    4850// Class Description:
  • trunk/source/processes/electromagnetic/standard/include/G4GoudsmitSaundersonMscModel.hh

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4GoudsmitSaundersonMscModel.hh,v 1.2 2009/06/04 13:45:49 gunter Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4GoudsmitSaundersonMscModel.hh,v 1.4 2010/05/17 15:11:30 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    4141// Modifications:
    4242// 04.03.2009 V.Ivanchenko cleanup and format according to Geant4 EM style
     43// 12.05.2010 O.Kadri: adding Qn1 and Qn12 as private doubles
    4344//
    4445// Class description:
     
    5455//Ref.5:F. Salvat et al.,"ELSEPA--Dirac partial ...molecules", Comp. Phys. Comm. 165 (2005) pp 157-190;
    5556//Ref.6:G4UrbanMscModel G4_v9.1Ref09;
    56 //Ref.7:G4eCoulombScatteringModel G4_v9.1Ref09.
     57//Ref.7:G4WentzelVIModel G4_v9.3.
    5758//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    5859
     
    6364#include "G4PhysicsTable.hh"
    6465#include "globals.hh"
    65 #include "G4DataInterpolation.hh"
    6666
    6767class G4DataVector;
     
    114114  G4GoudsmitSaundersonMscModel(const  G4GoudsmitSaundersonMscModel&);
    115115
    116   G4double              lowKEnergy;
    117   G4double              highKEnergy;
     116  G4double lowKEnergy;
     117  G4double highKEnergy;
    118118  G4double currentKinEnergy;
    119119  G4double currentRange;
     
    125125  G4double charge,lambdalimit;
    126126  G4double tPathLength,stepmin ;
    127   G4double lambda1,lambda11;
     127  G4double lambda0,lambda1,lambda11,Qn1,Qn12;
    128128  G4double mass;
    129   G4double lambda0;
    130129  G4int    currentMaterialIndex;
    131130
     
    139138  const G4ParticleDefinition* particle;
    140139  G4ParticleChangeForMSC*     fParticleChange;
    141   G4DataInterpolation* MyValue;
    142140  const G4MaterialCutsCouple* currentCouple;
    143141
  • trunk/source/processes/electromagnetic/standard/include/G4GoudsmitSaundersonTable.hh

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4GoudsmitSaundersonTable.hh,v 1.3 2009/06/18 18:43:09 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4GoudsmitSaundersonTable.hh,v 1.4 2010/02/19 09:29:53 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
  • trunk/source/processes/electromagnetic/standard/include/G4PSTARStopping.hh

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PSTARStopping.hh,v 1.5 2008/11/13 12:04:37 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4PSTARStopping.hh,v 1.7 2010/04/26 17:22:08 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#ifndef G4PSTARStopping_h
     
    5656
    5757#include "globals.hh"
     58#include "G4LPhysicsFreeVector.hh"
     59#include <vector>
    5860
    5961class G4Material;
     
    7678  void Initialise();
    7779
     80  void AddData(G4double* e, G4double* s, G4int idx);
     81
    7882  // hide assignment operator
    7983  G4PSTARStopping & operator=(const  G4PSTARStopping &right);
    8084  G4PSTARStopping(const  G4PSTARStopping&);
    8185
     86  G4int matIndex;
    8287  const G4Material* currentMaterial;
    83   G4int index, matIndex;
    84   G4String name[74];
    85   G4double currentE, res;
    86   G4double e[74][60], kinE[60];
     88  G4double emin;
     89  std::vector<G4String> name;
     90  std::vector<G4LPhysicsFreeVector*> sdata;
    8791};
    8892
  • trunk/source/processes/electromagnetic/standard/include/G4UrbanMscModel93.hh

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4UrbanMscModel93.hh,v 1.1 2009/11/01 13:04:12 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4UrbanMscModel93.hh,v 1.4 2009/12/14 06:57:12 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
  • trunk/source/processes/electromagnetic/standard/include/G4WaterStopping.hh

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4WaterStopping.hh,v 1.7 2009/06/19 10:39:48 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4WaterStopping.hh,v 1.8 2010/04/26 17:22:08 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929#ifndef G4WaterStopping_h
     
    7979  G4int    Z[17];
    8080  G4double A[17];
     81  G4double emin;
    8182  std::vector<G4LPhysicsFreeVector*>  dedx;
    8283};
  • trunk/source/processes/electromagnetic/standard/include/G4WentzelVIModel.hh

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4WentzelVIModel.hh,v 1.21 2009/10/10 15:16:57 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4WentzelVIModel.hh,v 1.29 2010/05/27 14:22:05 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    4040//
    4141// Modifications:
    42 //
     42// 27-05-2010 V.Ivanchenko added G4WentzelOKandVIxSection class to
     43//              compute cross sections and sample scattering angle
    4344//
    4445// Class Description:
     
    6061#include "G4VMscModel.hh"
    6162#include "G4PhysicsTable.hh"
    62 #include "G4MscStepLimitType.hh"
    6363#include "G4MaterialCutsCouple.hh"
    64 #include "G4NistManager.hh"
    65 
     64#include "G4WentzelOKandVIxSection.hh"
     65
     66class G4ParticleDefinition;
    6667class G4LossTableManager;
    67 class G4ParticleChangeForMSC;
    68 class G4ParticleDefinition;
     68class G4Pow;
    6969
    7070//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    100100private:
    101101
    102   G4double ComputeTransportXSectionPerAtom();
    103 
    104102  G4double ComputeXSectionPerVolume();
    105103
    106   void ComputeMaxElectronScattering(G4double cut);
    107 
    108104  inline G4double GetLambda(G4double kinEnergy);
    109105
    110106  inline void SetupParticle(const G4ParticleDefinition*);
    111 
    112   inline void SetupKinematic(G4double kinEnergy, G4double cut);
    113  
    114   inline void SetupTarget(G4double Z, G4double kinEnergy);
    115107
    116108  inline void DefineMaterial(const G4MaterialCutsCouple*);
     
    120112  G4WentzelVIModel(const  G4WentzelVIModel&);
    121113
    122   const G4ParticleDefinition* theProton;
    123   const G4ParticleDefinition* theElectron;
    124   const G4ParticleDefinition* thePositron;
    125 
     114  G4LossTableManager*       theManager;
    126115  G4ParticleChangeForMSC*   fParticleChange;
     116  G4WentzelOKandVIxSection* wokvi;
     117  G4Pow*                    fG4pow;
    127118
    128119  G4PhysicsTable*           theLambdaTable;
    129   G4PhysicsTable*           theLambda2Table;
    130   G4LossTableManager*       theManager;
    131120  const G4DataVector*       currentCuts;
    132121
    133   G4NistManager*            fNistManager;
    134 
    135   G4double numlimit;
    136122  G4double tlimitminfix;
    137123  G4double invsqrt12;
    138124
    139   // cash
     125  // cache kinematics
    140126  G4double preKinEnergy;
    141   G4double ecut;
    142   G4double lambda0;
    143127  G4double tPathLength;
    144128  G4double zPathLength;
    145129  G4double lambdaeff;
    146130  G4double currentRange;
    147   G4double par1;
    148   G4double par2;
    149   G4double par3;
    150 
     131
     132  // data for single scattering mode
    151133  G4double xtsec;
    152134  std::vector<G4double> xsecn;
     
    154136  G4int    nelments;
    155137
    156   G4int    nbins;
    157   G4int    nwarnings;
    158   G4int    nwarnlimit;
    159 
     138  G4double numlimit;
     139
     140  // cache material
    160141  G4int    currentMaterialIndex;
    161 
    162142  const G4MaterialCutsCouple* currentCouple;
    163143  const G4Material* currentMaterial;
    164144
    165145  // single scattering parameters
    166   G4double coeff;
    167146  G4double cosThetaMin;
    168147  G4double cosThetaMax;
    169148  G4double cosTetMaxNuc;
    170   G4double cosTetMaxNuc2;
    171   G4double cosTetMaxElec;
    172   G4double cosTetMaxElec2;
    173   G4double q2Limit;
    174   G4double alpha2;
    175149
    176150  // projectile
    177151  const G4ParticleDefinition* particle;
    178 
    179   G4double chargeSquare;
    180   G4double spin;
    181   G4double mass;
    182   G4double tkin;
    183   G4double mom2;
    184   G4double invbeta2;
    185   G4double kinFactor;
    186   G4double etag;
    187152  G4double lowEnergyLimit;
    188 
    189   // target
    190   G4double targetZ;
    191   G4double targetMass;
    192   G4double screenZ;
    193   G4double formfactA;
    194   G4int    iz;
    195 
    196   static G4double ScreenRSquare[100];
    197   static G4double FormFactor[100];
    198153
    199154  // flags
     
    222177  G4double x;
    223178  if(theLambdaTable) {
    224     G4bool b;
    225     x = ((*theLambdaTable)[currentMaterialIndex])->GetValue(e, b);
     179    x = ((*theLambdaTable)[currentMaterialIndex])->Value(e);
    226180  } else {
    227181    x = CrossSection(currentCouple,particle,e,
    228182                     (*currentCuts)[currentMaterialIndex]);
    229183  }
    230   if(x > DBL_MIN) x = 1./x;
    231   else            x = DBL_MAX;
     184  if(x > DBL_MIN) { x = 1./x; }
     185  else            { x = DBL_MAX; }
    232186  return x;
    233187}
     
    240194  if(p != particle) {
    241195    particle = p;
    242     mass = particle->GetPDGMass();
    243     spin = particle->GetPDGSpin();
    244     G4double q = particle->GetPDGCharge()/eplus;
    245     chargeSquare = q*q;
    246     tkin = 0.0;
     196    wokvi->SetupParticle(p);
    247197  }
    248198}
    249199
    250 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    251 
    252 inline void G4WentzelVIModel::SetupKinematic(G4double ekin, G4double cut)
    253 {
    254   if(ekin != tkin || ecut != cut) {
    255     tkin  = ekin;
    256     mom2  = tkin*(tkin + 2.0*mass);
    257     invbeta2 = 1.0 +  mass*mass/mom2;
    258     cosTetMaxNuc = cosThetaMax;
    259     if(mass < MeV && ekin <= 10.*cut) {
    260       cosTetMaxNuc = ekin*(cosThetaMax + 1.0)/(10.*cut) - 1.0;
    261     }
    262     ComputeMaxElectronScattering(cut);
    263   }
    264 }
    265 
    266 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    267  
    268 inline void G4WentzelVIModel::SetupTarget(G4double Z, G4double e)
    269 {
    270   if(Z != targetZ || e != etag) {
    271     etag    = e;
    272     targetZ = Z;
    273     iz = G4int(Z);
    274     if(iz > 99) iz = 99;
    275     targetMass = fNistManager->GetAtomicMassAmu(iz)*amu_c2;
    276     screenZ = ScreenRSquare[iz]/mom2;
    277     G4double meff = targetMass/(mass+targetMass);
    278     kinFactor = coeff*targetZ*chargeSquare*invbeta2/(mom2*meff*meff);
    279     screenZ *=(1.13 + std::min(1.0,3.76*Z*Z*invbeta2*alpha2));
    280     if(mass > MeV) { screenZ *= 2.0; }
    281     formfactA = FormFactor[iz]*mom2;
    282     cosTetMaxNuc2 = cosTetMaxNuc;
    283     cosTetMaxElec2 = cosTetMaxElec;
    284   }
    285 }
    286 
    287200//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    288201
  • trunk/source/processes/electromagnetic/standard/include/G4eCoulombScatteringModel.hh

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eCoulombScatteringModel.hh,v 1.49 2009/10/10 15:16:57 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4eCoulombScatteringModel.hh,v 1.56 2010/05/27 14:22:05 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    4747// 09.06.08 V.Ivanchenko add SelectIsotope and sampling of the recoil ion
    4848// 17.06.09 C.Consoalndi modified SetupTarget method - remove kinFactor
     49// 27.05.10 V.Ivanchenko added G4WentzelOKandVIxSection class to
     50//              compute cross sections and sample scattering angle
    4951//                                     
    5052//
     
    6668
    6769#include "G4VEmModel.hh"
    68 #include "G4PhysicsTable.hh"
    6970#include "globals.hh"
    70 #include "G4NistManager.hh"
    71 #include <vector>
     71#include "G4MaterialCutsCouple.hh"
     72#include "G4WentzelOKandVIxSection.hh"
    7273
    7374class G4ParticleChangeForGamma;
    7475class G4ParticleDefinition;
     76class G4ParticleTable;
     77class G4NistManager;
    7578
    7679class G4eCoulombScatteringModel : public G4VEmModel
     
    99102                                 G4double maxEnergy);
    100103
     104  // defines low energy limit of the model
     105  inline void SetLowEnergyLimit(G4double val);
     106
     107  // obsolete method
    101108  inline void SetRecoilThreshold(G4double eth);
    102109
    103110protected:
    104 
    105   G4double CrossSectionPerAtom();
    106 
    107   G4double SampleCosineTheta();
    108111
    109112  inline void DefineMaterial(const G4MaterialCutsCouple*);
     
    111114  inline void SetupParticle(const G4ParticleDefinition*);
    112115
    113   inline void SetupKinematic(G4double kinEnergy, G4double cut);
    114  
    115   inline void SetupTarget(G4double Z, G4double kinEnergy);
    116 
    117116private:
    118 
    119   void ComputeMaxElectronScattering(G4double cut);
    120117
    121118  // hide assignment operator
     
    125122protected:
    126123 
    127   const G4ParticleDefinition* theProton;
    128   const G4ParticleDefinition* theElectron;
    129   const G4ParticleDefinition* thePositron;
    130 
    131   G4ParticleTable*          theParticleTable;
     124  G4ParticleTable*          theParticleTable;
    132125  G4ParticleChangeForGamma* fParticleChange;
     126  G4WentzelOKandVIxSection* wokvi;
    133127  G4NistManager*            fNistManager;
    134128
     
    140134  G4int                       currentMaterialIndex;
    141135
    142   G4double                  coeff;
    143136  G4double                  cosThetaMin;
    144137  G4double                  cosThetaMax;
    145138  G4double                  cosTetMinNuc;
    146139  G4double                  cosTetMaxNuc;
    147   G4double                  cosTetMaxNuc2;
    148   G4double                  cosTetMaxElec;
    149   G4double                  cosTetMaxElec2;
    150   G4double                  q2Limit;
    151140  G4double                  recoilThreshold;
    152   G4double                  elecXSection;
    153   G4double                  nucXSection;
    154   G4double                  ecut;
     141  G4double                  elecRatio;
     142  G4double                  mass;
    155143
    156144  // projectile
    157145  const G4ParticleDefinition* particle;
     146  const G4ParticleDefinition* theProton;
    158147
    159   G4double                  chargeSquare;
    160   G4double                  spin;
    161   G4double                  mass;
    162   G4double                  tkin;
    163   G4double                  mom2;
    164   G4double                  invbeta2;
    165   G4double                  etag;
    166148  G4double                  lowEnergyLimit;
    167149
    168   // target
    169   G4double                  targetZ;
    170   G4double                  targetMass;
    171   G4double                  screenZ;
    172   G4double                  formfactA;
    173   G4int                     idxelm;
    174   G4int                     iz;
    175 
    176150private:
    177 
    178   G4double                  alpha2;
    179   G4double                  faclim;
    180 
    181   static G4double ScreenRSquare[100];
    182   static G4double FormFactor[100];
    183151
    184152  G4bool                    isInitialised;             
     
    206174    particle = p;
    207175    mass = particle->GetPDGMass();
    208     spin = particle->GetPDGSpin();
    209     G4double q = particle->GetPDGCharge()/eplus;
    210     chargeSquare = q*q;
    211     tkin = 0.0;
     176    wokvi->SetupParticle(p);
    212177  }
    213178}
     
    215180//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    216181
    217 inline void G4eCoulombScatteringModel::SetupKinematic(G4double ekin,
    218                                                       G4double cut)
     182inline void G4eCoulombScatteringModel::SetLowEnergyLimit(G4double val)
    219183{
    220   if(ekin != tkin || ecut != cut) {
    221     tkin = ekin;
    222     mom2 = tkin*(tkin + 2.0*mass);
    223     invbeta2 = 1.0 +  mass*mass/mom2;
    224     cosTetMinNuc = cosThetaMin;
    225     cosTetMaxNuc = cosThetaMax;
    226     if(mass < MeV && cosThetaMin < 1.0 && ekin <= 10.*cut) {
    227       cosTetMinNuc = ekin*(cosThetaMin + 1.0)/(10.*cut) - 1.0;
    228     }
    229     ComputeMaxElectronScattering(cut);
    230   }
     184  lowEnergyLimit = val;
    231185}
    232 
    233 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    234  
    235 inline void G4eCoulombScatteringModel::SetupTarget(G4double Z, G4double e)
    236 {
    237   if(Z != targetZ || e != etag) {
    238     etag    = e;
    239     targetZ = Z;
    240     iz= G4int(Z);
    241     if(iz > 99) iz = 99;
    242     targetMass = fNistManager->GetAtomicMassAmu(iz)*amu_c2;
    243     screenZ = ScreenRSquare[iz]/mom2;
    244     screenZ *=(1.13 + std::min(1.0,3.76*Z*Z*invbeta2*alpha2));
    245     if(mass > MeV) { screenZ *= 2.0; }
    246     formfactA = FormFactor[iz]*mom2;
    247     cosTetMaxNuc2 = cosTetMaxNuc;
    248     if(1 == iz && particle == theProton && cosTetMaxNuc2 < 0.0) {
    249       cosTetMaxNuc2 = 0.0;
    250     }
    251     cosTetMaxElec2 = cosTetMaxElec;
    252   }
    253 }
    254186
    255187//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
  • trunk/source/processes/electromagnetic/standard/include/G4hIonisation.hh

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4hIonisation.hh,v 1.42 2009/02/20 12:06:37 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4hIonisation.hh,v 1.44 2010/05/27 10:25:23 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    101101  virtual void PrintInfo();
    102102
     103  // obsolete method
    103104  void ActivateNuclearStopping(G4bool);
    104105
     
    115116
    116117  G4bool     isInitialised;
    117   G4bool     nuclearStopping;
    118118
    119119  G4double   mass;
     
    124124//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    125125
    126 inline void G4hIonisation::ActivateNuclearStopping(G4bool val)
    127 {
    128   nuclearStopping = val;
    129 }
    130 
    131 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    132 
    133126#endif
  • trunk/source/processes/electromagnetic/standard/src/G4ASTARStopping.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4ASTARStopping.cc,v 1.8 2008/11/24 18:28:09 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
    28 
     26// $Id: G4ASTARStopping.cc,v 1.13 2010/04/26 17:22:08 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
     28//
    2929//---------------------------------------------------------------------------
    3030//
     
    4040//
    4141// Modifications:
     42// 19.04.2010 A.Ivanchenko fixed data for G4_O,
     43//                         checked all data
     44// 25.04.2010 V.Ivanchenko introduce G4LPhysicsFreeVector
    4245//
    4346//----------------------------------------------------------------------------
     
    5356G4ASTARStopping::G4ASTARStopping()
    5457{
    55   currentE = 0.0;
    5658  currentMaterial = 0;
    57   index = 0;
    5859  matIndex = -1;
     60
     61  name.resize(74,"");
     62  effZ.resize(74,0);
     63  sdata.resize(74,0);
     64
    5965  Initialise();
    6066}
     
    6369
    6470G4ASTARStopping::~G4ASTARStopping()
    65 {}
     71{
     72  for(size_t i=0; i<74; ++i) { delete sdata[i]; }
     73}
    6674
    6775//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    6977G4int G4ASTARStopping:: GetIndex (const G4Material* mat)
    7078
    71   if (mat == currentMaterial) return matIndex;
     79  if (mat == currentMaterial) { return matIndex; }
    7280  G4String matName = mat->GetName();
    73   for (G4int i=0; i<74; i++){
    74     if (matName == name[i]){
     81  for (G4int i=0; i<74; ++i){
     82    if (matName == name[i]){ 
    7583      matIndex = i;
    7684      currentMaterial = mat;
     
    8593G4double G4ASTARStopping::GetElectronicDEDX(G4int i, G4double energy)
    8694{
    87   if (matIndex == i && energy == currentE) return res;       
    88 
     95  G4double res = 0.0;
    8996  if (i<0 || i>73){
    9097    G4cout << "### G4ASTARStopping WARNING: index "
    9198           << i << " is out of range!" << G4endl;
    92     res = 0.0;
    9399    return res;
    94100  }
    95   matIndex = i;
    96   currentE = energy;
    97 
    98   if (energy < kinE[index] || energy > kinE[index+1]){
    99 
    100     if (energy <= kinE[0]) {
    101       index = 0;
    102       res = e[matIndex][0]*std::sqrt(energy/kinE[0]);
    103       return res;
    104     } else if (energy >= kinE[77]) {
    105       index = 76;
    106       res = e[matIndex][77];
    107       return res;
    108     }
    109     for (index = 0; index<77; index++){if (energy <= kinE[index+1]) break;}
    110   }
    111 
    112   G4double t1 = kinE[index];
    113   G4double t2 = kinE[index+1];
    114   G4double e1 = e[matIndex][index];
    115   G4double e2 = e[matIndex][index+1];
    116   res = e1*std::exp(std::log(energy/t1)*std::log(e2/e1)/std::log(t2/t1));
     101  if(energy < emin) { res = (*(sdata[i]))[0]*std::sqrt(energy/emin); }
     102  else              { res = sdata[i]->Value(energy); }
    117103  return res;
    118  }
     104}
    119105 
    120106void G4ASTARStopping::Initialise()
    121107{
    122 
    123 G4int i;
    124108G4double Z[74] = {
    125109  6.0,  6.0,  6.0, 47.0,  7.0, 13.0, 13.0, 18.0, 79.0, 6.0,
     
    133117};
    134118
    135  for(i=0; i<74; i++) {effZ[i]=Z[i];}
    136  
     119for(G4int i=0; i<74; ++i) {effZ[i]=Z[i];}
     120  
    137121name [0] = "G4_A-150_TISSUE"; 
    138 G4double T0[78] = { 0.001, 0.0015, 0.002, 0.0025, 0.003, 0.004, 0.005, 0.006, 0.007, 0.008, 0.009, 0.01, 0.0125, 0.015, 0.0175, 0.02, 0.0225, 0.025, 0.0275, 0.03, 0.035, 0.04, 0.045, 0.05, 0.055, 0.06, 0.065, 0.07, 0.075, 0.08, 0.085, 0.09, 0.095, 0.1, 0.125, 0.15, 0.175, 0.2, 0.225, 0.25, 0.275, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1, 1.25, 1.5, 1.75, 2, 2.25, 2.5, 2.75, 3, 3.5, 4, 4.5, 5, 5.5, 6, 6.5, 7, 7.5, 8, 8.5, 9, 9.5, 10 };
    139  
     122G4double T0[78] = { 0.001, 0.0015, 0.002, 0.0025, 0.003, 0.004, 0.005, 0.006, 0.007, 0.008, 0.009, 0.01, 0.0125, 0.015, 0.0175, 0.02, 0.0225, 0.025, 0.0275, 0.03, 0.035, 0.04, 0.045, 0.05, 0.055, 0.06, 0.065, 0.07, 0.075, 0.08, 0.085, 0.09, 0.095, 0.1, 0.125, 0.15, 0.175, 0.2, 0.225, 0.25, 0.275, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1, 1.25, 1.5, 1.75, 2, 2.25, 2.5, 2.75, 3, 3.5, 4, 4.5, 5, 5.5, 6, 6.5, 7, 7.5, 8, 8.5, 9, 9.5, 10. };
     123 emin = T0[0]*MeV;
     124
    140125G4double e0[78] = { 168.8, 204.2, 233.8, 259.7, 283, 324.3, 360.4, 393, 422.8, 450.5, 476.5, 501, 557.1, 607.7, 654.1, 697.1, 737.4, 775.4, 811.5, 845.9, 910.3, 970, 1026, 1078, 1128, 1175, 1220, 1263, 1305, 1344, 1383, 1419, 1455, 1489, 1646, 1782, 1901, 2005, 2097, 2178, 2249, 2312, 2413, 2488, 2539, 2572, 2589, 2593, 2586, 2571, 2548, 2521, 2489, 2453, 2416, 2377, 2176, 1989, 1825, 1683, 1561, 1457, 1369, 1292, 1165, 1062, 978.5, 908.4, 848.8, 797.4, 752.4, 712.9, 677.7, 646.1, 617.7, 591.9, 568.4, 547 };
    141  
    142  for(i=0; i<78; i++) {e[0][i]=e0[i]*MeV*cm2/g;}
    143  for(i=0; i<78; i++) {kinE[i]=T0[i];}
     126AddData(T0,e0, 0);
    144127 
    145128name [1] = "G4_ACETYLENE";
    146129G4double e1[78] = { 192.2, 229.4, 260.2, 287, 311, 353.1, 389.7, 422.5, 452.4, 480.1, 506, 530.3, 585.9, 635.7, 681.2, 723.2, 762.5, 799.4, 834.3, 867.5, 929.6, 986.9, 1040, 1090, 1137, 1182, 1224, 1265, 1304, 1341, 1376, 1411, 1444, 1475, 1619, 1741, 1847, 1938, 2017, 2085, 2144, 2195, 2275, 2331, 2367, 2388, 2397, 2395, 2386, 2370, 2350, 2326, 2299, 2271, 2241, 2210, 2056, 1913, 1783, 1666, 1562, 1468, 1384, 1308, 1177, 1072, 986.8, 915.5, 855, 802.8, 757.2, 717.1, 681.4, 649.5, 620.7, 594.7, 570.9, 549.2 };
    147  
    148  for(i=0; i<78; i++) {e[1][i]=e1[i]*MeV*cm2/g;}
     130AddData(T0,e1, 1);
    149131 
    150132name [2] = "G4_ADIPOSE_TISSUE_ICRP";
    151133G4double e2[78] = { 169.4, 204.2, 233.3, 258.8, 281.8, 322.4, 358.1, 390.2, 419.7, 447.2, 472.9, 497.2, 552.9, 603.2, 649.4, 692.4, 732.7, 770.7, 806.8, 841.3, 906, 966.1, 1022, 1075, 1125, 1173, 1219, 1262, 1304, 1344, 1383, 1420, 1456, 1491, 1650, 1787, 1907, 2012, 2104, 2185, 2256, 2317, 2417, 2489, 2539, 2571, 2588, 2592, 2587, 2573, 2554, 2529, 2500, 2468, 2434, 2398, 2213, 2035, 1874, 1731, 1605, 1499, 1408, 1328, 1197, 1091, 1004, 932.2, 870.7, 817.8, 771.5, 730.8, 694.5, 662.1, 632.9, 606.4, 582.3, 560.2 };
    152  
    153  for(i=0; i<78; i++) {e[2][i]=e2[i]*MeV*cm2/g;}
     134AddData(T0,e2, 2);
    154135 
    155136name [3] = "G4_Ag";
    156137G4double e3[78] = { 31.26, 38.13, 43.91, 48.98, 53.56, 61.66, 68.79, 75.21, 81.11, 86.6, 91.74, 96.6, 107.7, 117.8, 127, 135.6, 143.6, 151.2, 158.4, 165.3, 178.2, 190.2, 201.4, 212, 222, 231.6, 240.7, 249.5, 257.9, 266, 273.9, 281.4, 288.8, 295.9, 328.8, 357.8, 383.8, 407.4, 428.8, 448.4, 466.3, 482.8, 511.8, 536.2, 556.6, 573.5, 587.3, 598.4, 607.2, 613.8, 618.5, 621.6, 623.4, 623.8, 623.3, 621.8, 604.4, 578.7, 550.8, 523.3, 497.6, 474.4, 453.6, 435, 402.7, 375.9, 353.2, 333.6, 316.9, 302, 288.8, 276.9, 266.2, 256.5, 247.7, 239.5, 232, 225.1 };
    157  
    158  for(i=0; i<78; i++) {e[3][i]=e3[i]*MeV*cm2/g;}
     138AddData(T0,e3, 3);
    159139 
    160140name [4] = "G4_AIR";
    161141G4double e4[78] = { 87.5, 108.6, 126.7, 142.7, 157.3, 183.5, 206.7, 227.9, 247.5, 265.9, 283.2, 299.6, 337.7, 372.3, 404.3, 434.3, 462.6, 489.4, 515, 539.5, 585.8, 629, 669.6, 708.1, 744.8, 779.8, 813.4, 845.7, 876.8, 906.8, 935.9, 964, 991.3, 1018, 1140, 1247, 1343, 1429, 1506, 1575, 1637, 1693, 1787, 1861, 1918, 1961, 1990, 2008, 2017, 2019, 2013, 2002, 1987, 1968, 1946, 1922, 1774, 1625, 1494, 1382, 1287, 1205, 1133, 1072, 968.6, 885.9, 818, 760.7, 711.7, 669.6, 632.7, 600.2, 571.2, 545.3, 521.9, 500.6, 481.2, 463.4 };
    162  
    163  for(i=0; i<78; i++) {e[4][i]=e4[i]*MeV*cm2/g;}
     142AddData(T0,e4, 4);
    164143 
    165144name [5] = "G4_Al";
    166145G4double e5[78] = { 55.8, 71.89, 86.05, 98.92, 110.9, 132.7, 152.5, 170.9, 188.2, 204.5, 220.1, 235.1, 270.1, 302.5, 332.8, 361.5, 388.6, 414.6, 439.4, 463.3, 508.4, 550.4, 589.6, 626.5, 661.1, 693.7, 724.3, 753.2, 780.3, 805.9, 830.1, 852.8, 874.3, 894.5, 980, 1045, 1096, 1136, 1168, 1195, 1216, 1234, 1262, 1280, 1291, 1297, 1298, 1297, 1293, 1286, 1279, 1269, 1259, 1248, 1237, 1225, 1161, 1098, 1039, 984.9, 937.6, 895.4, 856.8, 821, 756.1, 698.6, 647.8, 604.8, 567.8, 535.7, 507.4, 482.4, 460, 439.8, 421.6, 405.1, 389.9, 376 };
    167  
    168  for(i=0; i<78; i++) {e[5][i]=e5[i]*MeV*cm2/g;}
     146AddData(T0,e5, 5);
    169147 
    170148name [6] = "G4_ALUMINUM_OXIDE";
    171149G4double e6[78] = { 71.39, 88.59, 103.3, 116.4, 128.4, 149.9, 169, 186.5, 202.8, 218, 232.3, 246, 277.7, 306.6, 333.4, 358.5, 382.1, 404.6, 426, 446.5, 485, 520.9, 554.3, 585.8, 615.5, 643.5, 670, 695.2, 719.1, 741.9, 763.6, 784.3, 804, 822.9, 905.9, 974, 1031, 1080, 1122, 1159, 1191, 1220, 1267, 1304, 1332, 1353, 1368, 1378, 1383, 1385, 1384, 1381, 1376, 1370, 1362, 1352, 1308, 1253, 1187, 1115, 1044, 982.5, 928.4, 880, 801.2, 737, 683.4, 638.1, 599.1, 565.2, 535.4, 508.9, 485.3, 464, 444.8, 427.3, 411.4, 396.7 };
    172  
    173  for(i=0; i<78; i++) {e[6][i]=e6[i]*MeV*cm2/g;}
     150AddData(T0,e6, 6);
    174151 
    175152name [7] = "G4_Ar";
    176153G4double e7[78] = { 34.54, 44.56, 53.39, 61.42, 68.88, 82.53, 94.95, 106.5, 117.3, 127.6, 137.4, 146.8, 168.8, 189.3, 208.5, 226.7, 244.1, 260.8, 276.8, 292.3, 321.9, 349.8, 376.5, 401.9, 426.4, 450, 472.8, 494.9, 516.3, 537.1, 557.3, 577, 596.1, 614.8, 702.1, 780.3, 850.8, 914.4, 971.9, 1024, 1070, 1111, 1181, 1233, 1272, 1298, 1314, 1321, 1321, 1315, 1305, 1291, 1276, 1258, 1240, 1222, 1130, 1047, 974, 911.2, 856.7, 809, 767, 729.8, 666.1, 613.2, 569.7, 532.7, 501, 473.4, 449.1, 427.4, 408.3, 391, 375.4, 361.1, 348.1, 336 };
    177  
    178  for(i=0; i<78; i++) {e[7][i]=e7[i]*MeV*cm2/g;}
     154AddData(T0,e7, 7);
    179155 
    180156name [8] = "G4_Au";
    181157G4double e8[78] = { 11.5, 14.55, 17.2, 19.57, 21.76, 25.72, 29.27, 32.54, 35.59, 38.46, 41.18, 43.78, 49.83, 55.39, 60.56, 65.44, 70.06, 74.46, 78.68, 82.74, 90.45, 97.69, 104.5, 111.1, 117.3, 123.3, 129.1, 134.6, 140, 145.2, 150.3, 155.2, 160, 164.7, 186.4, 205.8, 223.5, 239.5, 254.2, 267.7, 280.1, 291.5, 311.6, 328.5, 342.6, 354.3, 363.8, 371.5, 377.5, 382.1, 385.5, 387.8, 389.1, 389.6, 389.4, 388.7, 384.4, 375.7, 362.6, 346.8, 330.5, 316.4, 304, 293, 274.1, 258.4, 245, 233.4, 223.1, 214, 205.8, 198.4, 191.6, 185.5, 179.7, 174.5, 169.6, 165 };
    182  
    183  for(i=0; i<78; i++) {e[8][i]=e8[i]*MeV*cm2/g;}
     158AddData(T0,e8, 8);
    184159 
    185160name [9] = "G4_B-100_BONE";
    186161G4double e9[78] = { 138.6, 167.7, 192, 213.3, 232.4, 266.3, 296, 322.7, 347.2, 369.9, 391.2, 411.3, 457.3, 498.8, 536.8, 572, 605, 636.1, 665.7, 693.8, 746.5, 795.4, 841, 883.9, 924.5, 963.1, 999.9, 1035, 1069, 1101, 1133, 1163, 1192, 1220, 1348, 1460, 1557, 1643, 1719, 1786, 1845, 1897, 1983, 2047, 2093, 2124, 2142, 2149, 2148, 2139, 2125, 2106, 2084, 2059, 2031, 2003, 1861, 1726, 1600, 1484, 1379, 1290, 1214, 1147, 1035, 945.3, 871.8, 810, 757.7, 712.5, 672.9, 638.1, 607, 579.2, 554.1, 531.3, 510.5, 491.5 };
    187  
    188  for(i=0; i<78; i++) {e[9][i]=e9[i]*MeV*cm2/g;}
     162AddData(T0,e9, 9);
    189163 
    190164name [10] = "G4_Be";
    191165G4double e10[78] = { 146.3, 177.1, 202.9, 225.4, 245.6, 281.3, 312.5, 340.6, 366.2, 390, 412.2, 433.2, 481.1, 524.1, 563.3, 599.7, 633.6, 665.4, 695.6, 724.2, 777.7, 827, 872.7, 915.5, 955.7, 993.7, 1030, 1064, 1096, 1128, 1157, 1186, 1213, 1239, 1356, 1453, 1534, 1602, 1659, 1706, 1745, 1776, 1821, 1846, 1856, 1855, 1845, 1829, 1809, 1785, 1759, 1732, 1703, 1674, 1645, 1617, 1499, 1406, 1326, 1254, 1189, 1129, 1075, 1024, 935.3, 858.7, 792.9, 737.6, 690, 648.7, 612.5, 580.4, 552, 526.4, 503.3, 482.4, 463.3, 445.8 };
    192  
    193  for(i=0; i<78; i++) {e[10][i]=e10[i]*MeV*cm2/g;}
     166AddData(T0,e10, 10);
    194167 
    195168name [11] = "G4_BONE_COMPACT_ICRU";
    196169G4double e11[78] = { 125.9, 152.6, 175, 194.8, 212.5, 244.1, 271.8, 296.8, 319.8, 341.1, 361.2, 380.2, 423.8, 463.1, 499.3, 533, 564.6, 594.5, 622.8, 649.9, 700.8, 748.1, 792.4, 834.2, 873.7, 911.4, 947.4, 981.9, 1015, 1047, 1078, 1107, 1136, 1164, 1291, 1401, 1498, 1584, 1660, 1727, 1787, 1839, 1926, 1991, 2039, 2072, 2092, 2103, 2105, 2100, 2089, 2075, 2056, 2035, 2011, 1986, 1846, 1705, 1576, 1460, 1358, 1271, 1196, 1130, 1020, 931.6, 859.4, 798.8, 747.4, 702.9, 664, 629.7, 599.1, 571.7, 547.1, 524.7, 504.3, 485.6 };
    197  
    198  for(i=0; i<78; i++) {e[11][i]=e11[i]*MeV*cm2/g;}
     170AddData(T0,e11, 11);
    199171 
    200172name [12] = "G4_C";
    201173G4double e12[78] = { 190.6, 225.6, 254.3, 279, 300.9, 339.2, 372.1, 401.4, 427.9, 452.3, 475, 496.2, 544.3, 586.9, 625.5, 661, 693.8, 724.6, 753.5, 780.8, 831.5, 877.9, 920.8, 960.6, 998, 1033, 1066, 1098, 1128, 1156, 1184, 1210, 1235, 1259, 1366, 1455, 1531, 1595, 1650, 1698, 1738, 1772, 1825, 1862, 1886, 1900, 1906, 1906, 1901, 1892, 1880, 1866, 1850, 1833, 1814, 1795, 1684, 1571, 1466, 1372, 1288, 1213, 1145, 1085, 981.9, 898.2, 829.6, 772, 722.9, 680.4, 643.1, 610.2, 580.8, 554.4, 530.6, 509, 489.2, 471.2 };
    202  
    203  for(i=0; i<78; i++) {e[12][i]=e12[i]*MeV*cm2/g;}
    204  
    205 name [13] = "G4_C_Graphite";
     174AddData(T0,e12, 12);
     175 
     176name [13] = "G4_GRAPHITE_POROUS";
    206177G4double e13[78] = { 192.3, 228.9, 259, 285.1, 308.3, 348.9, 384, 415.3, 443.7, 469.9, 494.2, 517, 568.9, 615.1, 657, 695.5, 731.3, 764.8, 796.3, 826.2, 881.8, 932.7, 979.8, 1024, 1065, 1104, 1141, 1175, 1209, 1240, 1271, 1300, 1327, 1354, 1473, 1574, 1658, 1731, 1793, 1845, 1890, 1929, 1987, 2027, 2051, 2063, 2065, 2060, 2049, 2034, 2015, 1993, 1969, 1944, 1917, 1891, 1751, 1620, 1502, 1400, 1310, 1231, 1161, 1099, 994.3, 909, 839.2, 780.7, 730.8, 687.6, 649.8, 616.4, 586.6, 559.8, 535.7, 513.8, 493.8, 475.5 };
    207  
    208  for(i=0; i<78; i++) {e[13][i]=e13[i]*MeV*cm2/g;}
     178AddData(T0,e13, 13);
    209179 
    210180name [14] = "G4_ETHYLENE";
    211181G4double e14[78] = { 159.8, 195.8, 226, 252.7, 276.8, 319.7, 357.4, 391.5, 422.9, 452.1, 479.5, 505.4, 565.1, 619, 668.6, 714.8, 758.1, 799.1, 838.1, 875.3, 945.4, 1011, 1072, 1130, 1185, 1237, 1288, 1336, 1383, 1428, 1471, 1514, 1555, 1594, 1779, 1945, 2094, 2230, 2354, 2468, 2571, 2666, 2830, 2961, 3060, 3130, 3172, 3189, 3185, 3164, 3129, 3086, 3038, 2986, 2931, 2876, 2578, 2306, 2084, 1907, 1763, 1642, 1539, 1450, 1303, 1185, 1089, 1010, 941.9, 883.6, 832.8, 788.1, 748.4, 712.9, 680.9, 652, 625.7, 601.7 };
    212  
    213  for(i=0; i<78; i++) {e[14][i]=e14[i]*MeV*cm2/g;}
     182AddData(T0,e14, 14);
    214183 
    215184name [15] = "G4_C-552";
    216185G4double e15[78] = { 124.1, 148.8, 169.3, 187.2, 203.3, 231.5, 256.1, 278.2, 298.4, 317.1, 334.5, 351, 388.6, 422.4, 453.2, 481.8, 508.4, 533.5, 557.3, 579.9, 622.2, 661.3, 697.8, 732, 764.3, 794.9, 824, 851.9, 878.5, 904.1, 928.7, 952.4, 975.2, 997.3, 1097, 1184, 1259, 1325, 1384, 1435, 1481, 1521, 1588, 1639, 1678, 1706, 1726, 1738, 1744, 1745, 1743, 1736, 1727, 1716, 1703, 1688, 1603, 1511, 1421, 1338, 1261, 1190, 1126, 1067, 965.5, 883.8, 816.4, 759.6, 711.1, 669.1, 632.3, 599.9, 571, 545, 521.6, 500.3, 480.9, 463.1 };
    217  
    218  for(i=0; i<78; i++) {e[15][i]=e15[i]*MeV*cm2/g;}
     186AddData(T0,e15, 15);
    219187 
    220188name [16] = "G4_CARBON_DIOXIDE";
    221189G4double e16[78] = { 93.28, 114.2, 131.9, 147.5, 161.6, 186.6, 208.6, 228.5, 246.8, 263.8, 279.8, 295, 329.8, 361.2, 390.2, 417.1, 442.4, 466.4, 489.1, 510.8, 551.8, 589.8, 625.6, 659.4, 691.5, 722.2, 751.6, 779.8, 807.1, 833.4, 858.9, 883.7, 907.7, 931.1, 1040, 1137, 1225, 1306, 1380, 1449, 1513, 1571, 1676, 1763, 1834, 1891, 1933, 1961, 1977, 1982, 1978, 1967, 1952, 1932, 1911, 1888, 1752, 1614, 1490, 1383, 1290, 1209, 1139, 1077, 973.3, 890, 821.5, 764, 714.9, 672.6, 635.5, 602.6, 573.5, 547.3, 523.7, 502.4, 482.9, 465 };
    222  
    223  for(i=0; i<78; i++) {e[16][i]=e16[i]*MeV*cm2/g;}
     190AddData(T0,e16, 16);
    224191 
    225192name [17] = "G4_CALCIUM_FLUORIDE";
    226193G4double e17[78] = { 72.78, 90.74, 106.1, 119.8, 132.3, 154.7, 174.6, 192.8, 209.7, 225.5, 240.4, 254.5, 287.2, 317, 344.6, 370.4, 394.6, 417.6, 439.5, 460.5, 499.9, 536.5, 570.8, 603.1, 633.6, 662.6, 690.1, 716.4, 741.5, 765.6, 788.6, 810.8, 832.1, 852.6, 944.4, 1022, 1088, 1145, 1194, 1237, 1275, 1308, 1361, 1401, 1431, 1453, 1467, 1476, 1481, 1481, 1479, 1474, 1466, 1458, 1447, 1436, 1352, 1256, 1166, 1086, 1016, 954.4, 900.2, 852.3, 772.1, 708.1, 655.5, 610.7, 573.3, 540.6, 511.9, 486.6, 464, 443.8, 425.4, 408.7, 393.4, 379.4 };
    227  
    228  for(i=0; i<78; i++) {e[17][i]=e17[i]*MeV*cm2/g;}
     194AddData(T0,e17, 17);
    229195 
    230196name [18] = "G4_CERIC_SULFATE";
    231197G4double e18[78] = { 99.73, 123.7, 144.1, 162.3, 178.8, 208.3, 234.6, 258.5, 280.5, 301.2, 320.6, 339.1, 381.8, 420.6, 456.5, 490, 521.6, 551.5, 580.1, 607.4, 658.9, 707, 752.2, 795, 835.7, 874.6, 911.8, 947.6, 982, 1015, 1047, 1078, 1109, 1138, 1273, 1391, 1497, 1591, 1676, 1753, 1822, 1884, 1990, 2074, 2140, 2190, 2227, 2251, 2266, 2273, 2272, 2266, 2254, 2238, 2220, 2198, 2049, 1886, 1737, 1607, 1495, 1399, 1315, 1242, 1120, 1023, 942.8, 875.6, 818.4, 769.2, 726.1, 688, 654.2, 624, 596.7, 572, 549.5, 528.9 };
    232  
    233  for(i=0; i<78; i++) {e[18][i]=e18[i]*MeV*cm2/g;}
     198AddData(T0,e18, 18);
    234199 
    235200name [19] = "G4_CELLULOSE_NITRATE";
    236201G4double e19[78] = { 157.6, 186.4, 209.9, 230.3, 248.3, 279.7, 306.8, 330.8, 352.6, 372.6, 391.2, 408.7, 448.1, 483.2, 514.9, 544.1, 571.1, 596.4, 620.3, 642.8, 684.8, 723.2, 758.8, 792, 823.2, 852.7, 880.6, 907.2, 932.6, 956.9, 980.2, 1003, 1024, 1045, 1139, 1220, 1290, 1353, 1408, 1457, 1502, 1541, 1608, 1662, 1704, 1736, 1761, 1778, 1789, 1796, 1798, 1796, 1790, 1782, 1772, 1760, 1674, 1574, 1476, 1385, 1302, 1227, 1160, 1099, 993.8, 909.3, 839.7, 781.1, 731.2, 688.1, 650.2, 616.7, 587, 560.3, 536.2, 514.4, 494.5, 476.2 };
    237  
    238  for(i=0; i<78; i++) {e[19][i]=e19[i]*MeV*cm2/g;}
     202AddData(T0,e19, 19);
    239203 
    240204name [20] = "G4_BONE_CORTICAL_ICRP";
    241205G4double e20[78] = { 109.1, 132.8, 152.8, 170.4, 186.2, 214.4, 239.3, 261.7, 282.4, 301.6, 319.7, 336.8, 376.1, 411.7, 444.5, 475, 503.6, 530.7, 556.5, 581.1, 627.4, 670.4, 710.8, 748.9, 785, 819.4, 852.4, 883.9, 914.3, 943.5, 971.7, 999, 1025, 1051, 1168, 1270, 1360, 1440, 1511, 1574, 1630, 1680, 1763, 1826, 1872, 1905, 1927, 1939, 1943, 1941, 1933, 1921, 1905, 1887, 1866, 1844, 1720, 1593, 1475, 1369, 1274, 1193, 1123, 1062, 959.2, 877.1, 809.7, 753, 704.9, 663.4, 627, 594.9, 566.3, 540.6, 517.5, 496.5, 477.4, 459.8 };
    242  
    243  for(i=0; i<78; i++) {e[20][i]=e20[i]*MeV*cm2/g;}
     206AddData(T0,e20, 20);
    244207 
    245208name [21] = "G4_CESIUM_IODIDE";
    246209G4double e21[78] = { 40.6, 48.54, 55.16, 60.95, 66.15, 75.33, 83.38, 90.64, 97.29, 103.5, 109.3, 114.8, 127.3, 138.7, 149.2, 158.9, 168, 176.7, 184.9, 192.8, 207.6, 221.3, 234.2, 246.4, 258, 269.1, 279.7, 289.9, 299.7, 309.2, 318.3, 327.1, 335.7, 344, 382.3, 415.8, 445.6, 472.1, 495.7, 516.7, 535.4, 551.8, 578.9, 599.2, 613.8, 623.8, 629.9, 633, 633.6, 632.3, 629.5, 625.5, 620.6, 615.1, 609.1, 602.8, 567.7, 533, 501.8, 474.4, 450.3, 429, 410.1, 393.3, 364.6, 340.9, 321, 304, 289.2, 275.9, 264.1, 253.6, 243.9, 235, 226.7, 218.9, 211.9, 205.4 };
    247  
    248  for(i=0; i<78; i++) {e[21][i]=e21[i]*MeV*cm2/g;}
     210AddData(T0,e21, 21);
    249211 
    250212name [22] = "G4_Cu";
    251213G4double e22[78] = { 29.51, 36.49, 42.42, 47.68, 52.45, 60.98, 68.54, 75.4, 81.74, 87.65, 93.23, 98.51, 110.7, 121.8, 132, 141.5, 150.5, 159, 167.2, 174.9, 189.5, 203.2, 216, 228.1, 239.7, 250.7, 261.3, 271.4, 281.2, 290.7, 299.8, 308.7, 317.3, 325.6, 364.2, 398.4, 429.1, 456.8, 482.1, 505.1, 526.2, 545.4, 579, 607, 630.1, 649.1, 664.4, 676.6, 686.2, 693.4, 698.8, 702.4, 704.6, 705.7, 705.7, 704.9, 692.5, 672.6, 650.3, 627.6, 606, 585.6, 566.3, 548, 514, 483.4, 455.8, 431, 408.4, 388, 369.6, 353.7, 339.1, 325.7, 313.4, 302, 291.7, 282.3 };
    252  
    253  for(i=0; i<78; i++) {e[22][i]=e22[i]*MeV*cm2/g;}
     214AddData(T0,e22, 22);
    254215 
    255216name [23] = "G4_Fe";
    256217G4double e23[78] = { 54.06, 65.42, 74.91, 83.2, 90.66, 103.8, 115.3, 125.6, 135.1, 143.8, 152, 159.8, 177.4, 193.3, 207.8, 221.3, 233.9, 245.7, 256.9, 267.6, 287.7, 306.2, 323.5, 339.8, 355.2, 369.8, 383.8, 397.1, 410, 422.3, 434.2, 445.7, 456.9, 467.6, 517.1, 560.6, 599.4, 634.3, 665.9, 694.6, 720.8, 744.8, 786.6, 821.5, 850.4, 874.1, 893.1, 908.1, 919.6, 928, 933.6, 936.8, 938, 937.3, 935.1, 931.5, 899.9, 856.7, 810.9, 766.9, 727.3, 691.9, 660.2, 631.5, 581.8, 540.1, 504.6, 473.9, 447.2, 423.6, 402.6, 383.5, 366.9, 352, 338.3, 325.7, 314.1, 303.6 };
    257  
    258  for(i=0; i<78; i++) {e[23][i]=e23[i]*MeV*cm2/g;}
     218AddData(T0,e23, 23);
    259219 
    260220name [24] = "G4_FERROUS_SULFATE";
    261221G4double e24[78] = { 99.58, 123.5, 144, 162.1, 178.6, 208.1, 234.3, 258.2, 280.2, 300.8, 320.3, 338.7, 381.4, 420.2, 456, 489.5, 521, 551, 579.5, 606.8, 658.3, 706.3, 751.5, 794.2, 834.9, 873.7, 910.9, 946.6, 981, 1014, 1046, 1077, 1108, 1137, 1271, 1390, 1495, 1590, 1675, 1751, 1820, 1882, 1988, 2072, 2138, 2188, 2225, 2250, 2265, 2271, 2271, 2264, 2253, 2237, 2218, 2197, 2048, 1886, 1738, 1609, 1497, 1401, 1317, 1244, 1122, 1025, 944.6, 877.4, 820, 770.7, 727.5, 689.3, 655.4, 625.2, 597.8, 573.1, 550.5, 529.9 };
    262  
    263  for(i=0; i<78; i++) {e[24][i]=e24[i]*MeV*cm2/g;}
     222AddData(T0,e24, 24);
    264223 
    265224name [25] = "G4_Gd";
    266225G4double e25[78] = { 38.11, 45.4, 51.41, 56.61, 61.25, 69.34, 76.36, 82.61, 88.29, 93.53, 98.41, 103, 113.4, 122.7, 131.1, 138.9, 146.1, 152.9, 159.3, 165.4, 176.7, 187.1, 196.8, 205.9, 214.4, 222.5, 230.3, 237.6, 244.7, 251.5, 258, 264.3, 270.3, 276.2, 303.1, 326.6, 347.4, 366.2, 383.1, 398.5, 412.5, 425.4, 447.8, 466.5, 482.1, 494.8, 505.1, 513.2, 519.4, 523.9, 526.9, 528.6, 529.1, 528.6, 527.3, 525.2, 505.6, 481, 456.8, 434.6, 414.6, 396.6, 380.5, 366, 340.9, 319.7, 301.6, 285.8, 272, 259.8, 248.8, 239, 230.1, 222, 214.6, 207.7, 201.4, 195.6 };
    267  
    268  for(i=0; i<78; i++) {e[25][i]=e25[i]*MeV*cm2/g;}
     226AddData(T0,e25, 25);
    269227 
    270228name [26] = "G4_Ge";
    271229G4double e26[78] = { 47.65, 57.57, 65.83, 73.05, 79.53, 90.94, 100.9, 109.9, 118, 125.6, 132.7, 139.4, 154.6, 168.3, 180.8, 192.3, 203.1, 213.3, 222.9, 232, 249.1, 264.8, 279.5, 293.2, 306.1, 318.4, 330, 341.1, 351.7, 361.8, 371.5, 380.8, 389.8, 398.4, 437.2, 469.9, 497.8, 521.7, 542.3, 560.1, 575.5, 588.9, 610.7, 627.4, 640.1, 649.9, 657.3, 662.8, 666.8, 669.6, 671.4, 672.3, 672.4, 671.9, 670.9, 669.4, 656.9, 639.5, 619.8, 599.4, 578.4, 557.6, 537.5, 518.5, 483.6, 452.9, 425.8, 401.8, 380.5, 361.5, 344.3, 328.6, 315.1, 303.1, 292.1, 282, 272.6, 263.8 };
    272  
    273  for(i=0; i<78; i++) {e[26][i]=e26[i]*MeV*cm2/g;}
     230AddData(T0,e26, 26);
    274231 
    275232name [27] = "G4_Pyrex_Glass";
    276233G4double e27[78] = { 83.85, 102.1, 117.5, 131, 143.3, 165, 184.1, 201.3, 217.2, 232, 245.9, 259, 289.2, 316.5, 341.5, 364.8, 386.7, 407.4, 427.1, 445.8, 481.1, 513.8, 544.4, 573.2, 600.6, 626.6, 651.5, 675.3, 698.1, 720.1, 741.3, 761.7, 781.5, 800.6, 888, 963.9, 1031, 1090, 1142, 1189, 1231, 1268, 1330, 1378, 1414, 1441, 1460, 1473, 1481, 1485, 1484, 1481, 1475, 1466, 1456, 1445, 1389, 1323, 1249, 1171, 1095, 1029, 971.4, 920.7, 835.9, 768, 711.5, 663.8, 622.8, 587.4, 556.1, 528.4, 503.7, 481.5, 461.4, 443.2, 426.5, 411.2 };
    277  
    278  for(i=0; i<78; i++) {e[27][i]=e27[i]*MeV*cm2/g;}
     234AddData(T0,e27, 27);
    279235 
    280236name [28] = "G4_H";
    281237G4double e28[78] = { 212, 275.4, 331.7, 383, 430.9, 518.8, 599.2, 674, 744.5, 811.5, 875.6, 937.1, 1082, 1217, 1344, 1465, 1580, 1691, 1798, 1901, 2098, 2285, 2463, 2634, 2798, 2956, 3108, 3256, 3399, 3538, 3674, 3805, 3933, 4058, 4637, 5152, 5610, 6019, 6383, 6705, 6988, 7235, 7632, 7915, 8100, 8203, 8240, 8222, 8161, 8067, 7947, 7808, 7655, 7494, 7327, 7157, 6345, 5647, 5068, 4588, 4188, 3860, 3585, 3351, 2971, 2675, 2438, 2242, 2078, 1939, 1818, 1713, 1620, 1538, 1464, 1398, 1337, 1283 };
    282  
    283  for(i=0; i<78; i++) {e[28][i]=e28[i]*MeV*cm2/g;}
    284  
    285 name [29] = "G4_HELIUM";
     238AddData(T0,e28, 28);
     239 
     240name [29] = "G4_He";
    286241G4double e29[78] = { 87.26, 110.8, 131.3, 149.8, 166.8, 197.7, 225.5, 251.1, 275, 297.5, 318.9, 339.4, 387, 430.9, 471.8, 510.4, 547, 581.9, 615.3, 647.5, 708.7, 766.1, 820.5, 872.3, 921.8, 969.3, 1015, 1059, 1102, 1143, 1183, 1221, 1259, 1296, 1465, 1614, 1748, 1867, 1975, 2071, 2156, 2233, 2361, 2460, 2535, 2588, 2624, 2644, 2652, 2650, 2639, 2621, 2598, 2571, 2540, 2507, 2323, 2139, 1976, 1832, 1706, 1593, 1493, 1402, 1249, 1130, 1033, 953.8, 886.8, 829.5, 779.8, 736.4, 697.9, 663.7, 632.9, 605.2, 580, 557 };
    287  
    288  for(i=0; i<78; i++) {e[29][i]=e29[i]*MeV*cm2/g;}
     242AddData(T0,e29, 29);
    289243 
    290244name [30] = "G4_KAPTON";
    291245G4double e30[78] = { 165.5, 197.6, 224.2, 247.2, 267.8, 304, 335.4, 363.5, 389.1, 412.8, 434.8, 455.6, 502.9, 545.2, 583.8, 619.4, 652.6, 683.8, 713.3, 741.2, 793.5, 841.6, 886.3, 928.2, 967.7, 1005, 1041, 1074, 1107, 1138, 1167, 1196, 1223, 1250, 1369, 1471, 1560, 1636, 1703, 1762, 1812, 1857, 1928, 1981, 2018, 2042, 2056, 2062, 2061, 2054, 2043, 2028, 2010, 1990, 1969, 1946, 1819, 1688, 1565, 1451, 1350, 1264, 1190, 1125, 1017, 929.8, 858.3, 798.2, 747, 702.8, 664, 629.8, 599.3, 571.9, 547.2, 524.8, 504.4, 485.7 };
    292  
    293  for(i=0; i<78; i++) {e[30][i]=e30[i]*MeV*cm2/g;}
     246AddData(T0,e30, 30);
    294247 
    295248name [31] = "G4_Kr";
    296249G4double e31[78] = { 10.15, 13.69, 16.93, 19.96, 22.84, 28.23, 33.29, 38.08, 42.66, 47.08, 51.35, 55.5, 65.43, 74.84, 83.85, 92.52, 100.9, 109.1, 117, 124.7, 139.7, 154.1, 168, 181.5, 194.6, 207.4, 219.9, 232.1, 244, 255.7, 267.2, 278.4, 289.5, 300.3, 351.9, 399.6, 443.7, 484.4, 522.1, 556.7, 588.4, 617.2, 666.6, 705.7, 735.5, 757, 771.4, 779.9, 783.4, 783, 779.4, 773.6, 765.9, 757, 747.2, 736.9, 683.7, 635.6, 595.2, 561.5, 533, 508.6, 487.3, 468.5, 439.9, 417.9, 398.8, 381.4, 364.9, 349.2, 334.2, 319.8, 306.2, 293.7, 282.8, 272.8, 263.6, 255.2 };
    297  
    298  for(i=0; i<78; i++) {e[31][i]=e31[i]*MeV*cm2/g;}
     250AddData(T0,e31, 31);
    299251 
    300252name [32] = "G4_LITHIUM_TETRABORATE";
    301253G4double e32[78] = { 132.7, 159.4, 181.6, 200.9, 218.2, 248.6, 275, 298.7, 320.4, 340.4, 359.1, 376.6, 416.8, 452.7, 485.5, 515.8, 544, 570.6, 595.8, 619.7, 664.3, 705.6, 743.9, 779.9, 813.9, 846.1, 876.8, 906.1, 934.2, 961.1, 987, 1012, 1036, 1059, 1166, 1258, 1338, 1410, 1474, 1531, 1583, 1628, 1706, 1767, 1814, 1849, 1874, 1891, 1899, 1902, 1899, 1891, 1875, 1852, 1825, 1795, 1638, 1494, 1375, 1276, 1193, 1121, 1058, 1002, 908.8, 833.2, 770.5, 717.6, 672.4, 633.2, 598.8, 568.3, 541.2, 516.9, 494.8, 474.9, 456.6, 439.9 };
    302  
    303  for(i=0; i<78; i++) {e[32][i]=e32[i]*MeV*cm2/g;}
     254AddData(T0,e32, 32);
    304255 
    305256name [33] = "G4_LITHIUM_FLUORIDE";
    306257G4double e33[78] = { 118.7, 142.6, 162.5, 179.7, 195.2, 222.4, 246, 267.2, 286.5, 304.3, 321, 336.6, 372.4, 404.4, 433.5, 460.4, 485.5, 509.1, 531.4, 552.6, 592.1, 628.5, 662.4, 694.1, 724.1, 752.4, 779.4, 805.1, 829.6, 853.2, 875.9, 897.6, 918.7, 938.9, 1031, 1110, 1179, 1240, 1294, 1341, 1383, 1421, 1483, 1530, 1566, 1592, 1610, 1621, 1627, 1627, 1624, 1618, 1609, 1598, 1585, 1571, 1483, 1387, 1296, 1214, 1140, 1074, 1015, 962.2, 872, 799.7, 739.5, 688.5, 644.8, 606.9, 573.7, 544.4, 518.3, 494.9, 473.6, 454.3, 436.7, 420.6 };
    307  
    308  for(i=0; i<78; i++) {e[33][i]=e33[i]*MeV*cm2/g;}
     258AddData(T0,e33, 33);
    309259 
    310260name [34] = "G4_M3_WAX";
    311261G4double e34[78] = { 173.6, 209, 238.5, 264.3, 287.6, 328.7, 364.7, 397.1, 426.9, 454.5, 480.4, 504.9, 561, 611.6, 658, 701.1, 741.6, 779.8, 816, 850.6, 915.4, 975.6, 1032, 1085, 1135, 1182, 1228, 1271, 1313, 1353, 1392, 1429, 1465, 1499, 1657, 1792, 1910, 2012, 2101, 2179, 2247, 2305, 2398, 2463, 2507, 2533, 2544, 2544, 2534, 2517, 2494, 2468, 2437, 2405, 2371, 2335, 2154, 1981, 1825, 1686, 1564, 1460, 1372, 1295, 1167, 1064, 980.4, 910.2, 850.4, 798.9, 753.8, 714.2, 678.9, 647.3, 618.8, 593, 569.4, 547.9 };
    312  
    313  for(i=0; i<78; i++) {e[34][i]=e34[i]*MeV*cm2/g;}
     262AddData(T0,e34, 34);
    314263 
    315264name [35] = "G4_MS20_TISSUE";
    316265G4double e35[78] = { 163.5, 196.6, 224.1, 248.2, 269.8, 308, 341.4, 371.4, 398.9, 424.4, 448.3, 470.9, 522.5, 569, 611.6, 651.1, 688, 722.9, 756, 787.5, 846.6, 901.2, 952.3, 1000, 1046, 1089, 1130, 1169, 1207, 1243, 1278, 1311, 1344, 1375, 1516, 1638, 1744, 1836, 1916, 1986, 2048, 2101, 2185, 2247, 2288, 2314, 2327, 2330, 2325, 2312, 2295, 2273, 2249, 2222, 2193, 2163, 2002, 1845, 1703, 1575, 1463, 1368, 1286, 1215, 1097, 1001, 923.2, 857.7, 802, 753.9, 711.7, 674.6, 641.6, 611.9, 585.2, 561, 539, 518.8 };
    317  
    318  for(i=0; i<78; i++) {e[35][i]=e35[i]*MeV*cm2/g;}
     266AddData(T0,e35, 35);
    319267 
    320268name [36] = "G4_METHANE";
    321269G4double e36[78] = { 197.5, 241.8, 279.3, 312.2, 342, 394.9, 441.5, 483.7, 522.4, 558.5, 592.4, 624.4, 698.1, 764.8, 826, 883.1, 936.6, 987.3, 1035, 1081, 1168, 1249, 1324, 1396, 1464, 1529, 1591, 1650, 1708, 1764, 1818, 1870, 1920, 1970, 2198, 2402, 2586, 2754, 2907, 3047, 3175, 3291, 3492, 3652, 3773, 3856, 3905, 3921, 3899, 3849, 3783, 3708, 3627, 3544, 3460, 3378, 2998, 2685, 2432, 2226, 2055, 1911, 1789, 1683, 1508, 1370, 1257, 1163, 1084, 1015, 955.9, 903.7, 857.5, 816.2, 779.1, 745.5, 714.9, 687.1 };
    322  
    323  for(i=0; i<78; i++) {e[36][i]=e36[i]*MeV*cm2/g;}
     270AddData(T0,e36, 36);
    324271 
    325272name [37] = "G4_Mo";
    326273G4double e37[78] = { 58.22, 68.98, 77.79, 85.4, 92.16, 103.9, 114.1, 123.1, 131.3, 138.8, 145.8, 152.4, 167.3, 180.5, 192.5, 203.5, 213.8, 223.4, 232.4, 241, 256.9, 271.6, 285.1, 297.8, 309.8, 321.1, 331.8, 342.1, 351.9, 361.3, 370.3, 379, 387.4, 395.5, 432.4, 464.5, 492.9, 518.2, 541, 561.6, 580.4, 597.4, 626.9, 651.2, 671.2, 687.3, 700.1, 710, 717.3, 722.3, 725.4, 726.7, 726.5, 725, 722.3, 718.8, 690.9, 655, 617.8, 582.6, 552.1, 525.7, 502.3, 481.5, 445.5, 415.5, 389.9, 367.7, 348.1, 330.6, 314.8, 300.9, 288.6, 277.3, 266.9, 257.6, 249, 241.2 };
    327  
    328  for(i=0; i<78; i++) {e[37][i]=e37[i]*MeV*cm2/g;}
     274AddData(T0,e37, 37);
    329275 
    330276name [38] = "G4_MUSCLE_WITH_SUCROSE";
    331277G4double e38[78] = { 111.7, 137.5, 159.4, 178.8, 196.5, 227.9, 255.7, 281, 304.4, 326.2, 346.7, 366.2, 411.2, 452, 489.7, 525, 558.1, 589.5, 619.5, 648.1, 702.2, 752.5, 799.9, 844.6, 887.2, 927.9, 966.8, 1004, 1040, 1075, 1108, 1141, 1172, 1203, 1343, 1467, 1576, 1674, 1762, 1841, 1912, 1975, 2081, 2165, 2230, 2277, 2310, 2331, 2342, 2344, 2339, 2329, 2313, 2293, 2270, 2244, 2074, 1896, 1739, 1607, 1494, 1398, 1314, 1241, 1120, 1022, 942.4, 875.3, 818.1, 768.9, 725.8, 687.7, 653.9, 623.7, 596.4, 571.7, 549.2, 528.6 };
    332  
    333  for(i=0; i<78; i++) {e[38][i]=e38[i]*MeV*cm2/g;}
     278AddData(T0,e38, 38);
    334279 
    335280name [39] = "G4_MUSCLE_WITHOUT_SUCROSE";
    336281G4double e39[78] = { 108.2, 133.5, 155, 174.1, 191.4, 222.4, 249.8, 274.8, 297.8, 319.3, 339.6, 358.9, 403.3, 443.7, 481, 515.9, 548.7, 579.8, 609.5, 637.9, 691.4, 741.4, 788.3, 832.7, 875, 915.3, 953.9, 991.1, 1027, 1061, 1095, 1127, 1158, 1189, 1328, 1451, 1560, 1658, 1745, 1824, 1895, 1958, 2065, 2150, 2215, 2263, 2298, 2320, 2332, 2335, 2331, 2321, 2306, 2287, 2265, 2240, 2075, 1901, 1746, 1613, 1501, 1404, 1320, 1247, 1125, 1027, 946.2, 878.8, 821.4, 772, 728.6, 690.4, 656.4, 626.1, 598.7, 573.9, 551.3, 530.6 };
    337  
    338  for(i=0; i<78; i++) {e[39][i]=e39[i]*MeV*cm2/g;}
     282AddData(T0,e39, 39);
    339283 
    340284name [40] = "G4_MUSCLE_SKELETAL_ICRP";
    341285G4double e40[78] = { 104.5, 129.2, 150.2, 168.8, 185.8, 216.1, 242.9, 267.4, 290, 311.1, 331, 349.8, 393.5, 433.1, 469.7, 503.9, 536.2, 566.7, 595.9, 623.7, 676.3, 725.4, 771.5, 815.1, 856.6, 896.2, 934.1, 970.6, 1006, 1040, 1072, 1104, 1135, 1165, 1302, 1422, 1530, 1626, 1712, 1790, 1860, 1922, 2029, 2113, 2178, 2228, 2263, 2286, 2299, 2304, 2302, 2293, 2280, 2262, 2242, 2218, 2059, 1888, 1735, 1604, 1492, 1396, 1312, 1240, 1118, 1021, 941.1, 874.1, 817, 767.9, 724.9, 686.8, 653.1, 622.9, 595.7, 571, 548.6, 528 };
    342  
    343  for(i=0; i<78; i++) {e[40][i]=e40[i]*MeV*cm2/g;}
     286AddData(T0,e40, 40);
    344287 
    345288name [41] = "G4_MUSCLE_STRIATED_ICRU";
    346289G4double e41[78] = { 104.7, 129.4, 150.5, 169.2, 186.2, 216.5, 243.4, 267.9, 290.5, 311.7, 331.6, 350.5, 394.2, 433.9, 470.6, 504.9, 537.2, 567.8, 596.9, 624.9, 677.5, 726.7, 772.8, 816.5, 858.1, 897.8, 935.8, 972.3, 1007, 1041, 1074, 1106, 1137, 1167, 1304, 1425, 1532, 1629, 1715, 1793, 1863, 1925, 2032, 2116, 2181, 2230, 2265, 2289, 2302, 2306, 2304, 2295, 2282, 2264, 2244, 2220, 2063, 1894, 1742, 1611, 1498, 1401, 1318, 1244, 1123, 1025, 944.5, 877.2, 819.9, 770.6, 727.3, 689.2, 655.3, 625, 597.7, 572.9, 550.4, 529.7 };
    347  
    348  for(i=0; i<78; i++) {e[41][i]=e41[i]*MeV*cm2/g;}
     290AddData(T0,e41, 41);
    349291 
    350292name [42] = "G4_N";
    351293G4double e42[78] = { 82.8, 103.7, 121.6, 137.7, 152.3, 178.7, 202.3, 223.8, 243.8, 262.5, 280.2, 297.1, 336.2, 372, 405.1, 436.2, 465.5, 493.4, 520.1, 545.7, 594.1, 639.3, 682, 722.5, 761, 797.9, 833.4, 867.4, 900.3, 932, 962.8, 992.5, 1021, 1049, 1179, 1293, 1395, 1486, 1567, 1640, 1706, 1765, 1864, 1940, 1999, 2041, 2069, 2086, 2093, 2091, 2083, 2069, 2051, 2030, 2005, 1978, 1819, 1660, 1522, 1406, 1308, 1224, 1151, 1088, 982.9, 898.5, 829.5, 771.1, 721.3, 678.5, 641, 608, 578.6, 552.3, 528.5, 506.9, 487.2, 469.1 };
    352  
    353  for(i=0; i<78; i++) {e[42][i]=e42[i]*MeV*cm2/g;}
     294AddData(T0,e42, 42);
    354295 
    355296name [43] = "G4_SODIUM_IODIDE";
    356297G4double e43[78] = { 35.86, 44.19, 51.24, 57.48, 63.13, 73.21, 82.12, 90.2, 97.64, 104.6, 111.1, 117.3, 131.6, 144.5, 156.4, 167.6, 178, 187.9, 197.3, 206.3, 223.3, 239.1, 253.9, 268, 281.3, 294, 306.2, 317.9, 329.2, 340.1, 350.6, 360.8, 370.6, 380.2, 424.5, 463.5, 498.4, 529.9, 558.2, 583.8, 607, 627.8, 663.4, 691.6, 713.4, 729.6, 740.9, 748.1, 751.7, 752.4, 750.7, 747, 741.7, 735.1, 727.6, 719.5, 664.4, 611.2, 569.4, 538.3, 514, 491.6, 472.1, 454, 422.9, 393.7, 370.2, 349.6, 331.4, 315.3, 301.2, 288.5, 276.8, 266.1, 256.3, 247.1, 238.9, 231.5 };
    357  
    358  for(i=0; i<78; i++) {e[43][i]=e43[i]*MeV*cm2/g;}
     298AddData(T0,e43, 43);
    359299 
    360300name [44] = "G4_Ne";
    361301G4double e44[78] = { 68.73, 83.7, 96.26, 107.3, 117.2, 134.8, 150.3, 164.2, 177, 188.8, 199.9, 210.4, 234.5, 256.2, 276.1, 294.6, 311.9, 328.3, 343.8, 358.6, 386.3, 412, 436.1, 458.8, 480.3, 500.8, 520.3, 539.1, 557.1, 574.5, 591.2, 607.5, 623.2, 638.4, 708.4, 770.3, 825.6, 875.7, 921.2, 962.8, 1001, 1036, 1098, 1150, 1194, 1230, 1260, 1285, 1304, 1319, 1330, 1338, 1343, 1344, 1344, 1341, 1296, 1229, 1160, 1095, 1035, 981.4, 932.6, 888.5, 812.1, 748.3, 695.6, 650.4, 611.3, 577, 546.8, 520, 496, 474.4, 454.8, 437, 420.7, 405.7 };
    362  
    363  for(i=0; i<78; i++) {e[44][i]=e44[i]*MeV*cm2/g;}
    364  
    365 name [45] = "G4_NYLON-6/6";
     302AddData(T0,e44, 44);
     303 
     304name [45] = "G4_NYLON-6-6";
    366305G4double e45[78] = { 167.4, 201.6, 230.3, 255.4, 278, 317.9, 352.9, 384.4, 413.4, 440.3, 465.5, 489.3, 544, 593.3, 638.6, 680.6, 720.1, 757.3, 792.7, 826.4, 889.7, 948.5, 1003, 1055, 1104, 1151, 1195, 1238, 1279, 1318, 1356, 1392, 1427, 1461, 1617, 1750, 1867, 1969, 2059, 2138, 2207, 2267, 2363, 2433, 2482, 2512, 2527, 2531, 2525, 2511, 2491, 2467, 2439, 2408, 2375, 2340, 2160, 1987, 1830, 1690, 1567, 1463, 1374, 1297, 1169, 1066, 981.3, 910.8, 850.9, 799.3, 754.1, 714.4, 679, 647.4, 618.9, 593, 569.5, 547.9 };
    367  
    368  for(i=0; i<78; i++) {e[45][i]=e45[i]*MeV*cm2/g;}
     306AddData(T0,e45, 45);
    369307 
    370308name [46] = "G4_O";
    371 G4double e46[78] = { 105.8, 117.3, 257.6, 1.139e-05, 5.976e-06, 0.005, 248.1, 71.83, 352, 3.186e-05, 2.012e-05, 0.015, 412.7, 40.96, 503.1, 6.782e-05, 5.098e-05, 0.035, 610.6, 24.07, 700.7, 0.0001156, 9.613e-05, 0.07, 820, 15.89, 884.2, 0.0001583, 0.0001354, 0.125, 1124, 8.719, 1280, 0.0002775, 0.0002641, 0.3, 1573, 4.478, 1697, 0.0004528, 0.000448, 0.65, 1818, 2.655, 1822, 0.0006468, 0.0006403, 1, 1667, 1.474, 1431, 0.00138, 0.001539, 2.75, 1038, 0.7076, 860.9, 0.003906, 0.004519, 6, 616.1, 0.3845, 556.8, 0.009419, 0.01034, 9.5, 452, 0.2295, 334.7, 0.03447, 0.04325, 27.5, 196.3, 0.09039, 156.5, 0.1784, 0.2149, 60 };
    372  
    373  for(i=0; i<78; i++) {e[46][i]=e46[i]*MeV*cm2/g;}
     309G4double e46[78] = { 1.058E+02, 1.283E+02, 1.471E+02, 1.636E+02, 1.784E+02, 2.046E+02, 2.275E+02, 2.481E+02, 2.670E+02, 2.845E+02, 3.009E+02, 3.163E+02, 3.518E+02, 3.836E+02, 4.127E+02, 4.398E+02, 4.650E+02, 4.889E+02, 5.115E+02, 5.330E+02, 5.733E+02, 6.106E+02, 6.455E+02, 6.783E+02, 7.094E+02, 7.389E+02, 7.671E+02, 7.941E+02, 8.200E+02, 8.450E+02, 8.690E+02, 8.923E+02, 9.147E+02, 9.365E+02, 1.036E+03, 1.124E+03, 1.202E+03, 1.272E+03, 1.335E+03, 1.392E+03, 1.444E+03, 1.491E+03, 1.573E+03, 1.639E+03, 1.693E+03, 1.735E+03, 1.768E+03, 1.792E+03, 1.808E+03, 1.818E+03, 1.821E+03, 1.820E+03, 1.814E+03, 1.805E+03, 1.792E+03, 1.777E+03, 1.667E+03, 1.544E+03, 1.430E+03, 1.329E+03, 1.241E+03, 1.164E+03, 1.097E+03, 1.038E+03, 9.395E+02, 8.602E+02, 7.947E+02, 7.395E+02, 6.924E+02, 6.519E+02, 6.161E+02, 5.845E+02, 5.564E+02, 5.313E+02, 5.086E+02, 4.880E+02, 4.692E+02, 4.520E+02};
     310AddData(T0,e46, 46);
    374311 
    375312name [47] = "G4_PARAFFIN";
    376313G4double e47[78] = { 193.8, 233, 265.8, 294.4, 320.3, 365.9, 405.9, 441.9, 475, 505.7, 534.5, 561.7, 624.2, 680.6, 732.3, 780.4, 825.5, 868.2, 908.6, 947.2, 1020, 1087, 1150, 1209, 1265, 1319, 1370, 1419, 1465, 1510, 1554, 1595, 1636, 1675, 1852, 2004, 2137, 2253, 2354, 2442, 2518, 2584, 2688, 2762, 2810, 2837, 2848, 2845, 2831, 2810, 2782, 2749, 2713, 2674, 2633, 2592, 2381, 2184, 2007, 1851, 1714, 1598, 1500, 1414, 1272, 1158, 1066, 988.4, 922.7, 866.1, 816.7, 773.2, 734.5, 699.9, 668.8, 640.6, 614.9, 591.4 };
    377  
    378  for(i=0; i<78; i++) {e[47][i]=e47[i]*MeV*cm2/g;}
     314AddData(T0,e47, 47);
    379315 
    380316name [48] = "G4_Pb";
    381317G4double e48[78] = { 17.96, 22.18, 25.76, 28.92, 31.8, 36.93, 41.47, 45.6, 49.4, 52.95, 56.3, 59.46, 66.77, 73.41, 79.52, 85.23, 90.6, 95.69, 100.5, 105.2, 113.9, 122, 129.7, 136.9, 143.8, 150.3, 156.6, 162.7, 168.5, 174.1, 179.5, 184.8, 189.9, 194.9, 217.7, 237.9, 256, 272.3, 287, 300.4, 312.6, 323.6, 342.6, 358.2, 370.7, 380.6, 388.3, 394.2, 398.4, 401.3, 403.1, 404, 404.1, 403.5, 402.4, 401, 392.5, 380.4, 365.3, 348.6, 332, 317.6, 304.9, 293.7, 274.4, 258.3, 244.7, 232.9, 222.5, 213.2, 205, 197.5, 190.7, 184.4, 178.7, 173.4, 168.4, 163.9 };
    382  
    383  for(i=0; i<78; i++) {e[48][i]=e48[i]*MeV*cm2/g;}
    384  
    385 name [49] = "G4_PHOTOGRAPHIC_EMULSION";
     318AddData(T0,e48, 48);
     319 
     320name [49] = "G4_PHOTO_EMULSION";
    386321G4double e49[78] = { 46.69, 57.18, 66.06, 73.91, 81.04, 93.75, 105, 115.2, 124.7, 133.5, 141.8, 149.6, 167.8, 184.3, 199.6, 213.8, 227.3, 240, 252.1, 263.8, 285.7, 306.2, 325.4, 343.6, 361, 377.5, 393.4, 408.7, 423.3, 437.5, 451.2, 464.5, 477.3, 489.8, 547, 597.3, 641.7, 681.2, 716.3, 747.6, 775.5, 800.2, 841.5, 873.5, 897.8, 915.8, 928.6, 937.1, 940, 938.4, 933.8, 927, 918.6, 909.2, 899.1, 888.5, 833.7, 781.8, 735.1, 693.7, 657.1, 624.6, 595.5, 569.4, 524.5, 487.2, 455.6, 428.5, 404.9, 383.9, 365.2, 348.6, 333.8, 320.5, 308.3, 297.2, 287, 277.8 };
    387  
    388  for(i=0; i<78; i++) {e[49][i]=e49[i]*MeV*cm2/g;}
     322AddData(T0,e49, 49);
    389323 
    390324name [50] = "G4_PLASTIC_SC_VINYLTOLUENE";
    391325G4double e50[78] = { 192.4, 229.8, 260.8, 287.8, 312, 354.4, 391.4, 424.6, 454.8, 482.8, 509, 533.7, 590, 640.5, 686.6, 729.3, 769.2, 806.7, 842.2, 876, 939.2, 997.5, 1052, 1103, 1151, 1197, 1240, 1281, 1321, 1359, 1395, 1430, 1464, 1497, 1644, 1769, 1878, 1971, 2053, 2123, 2184, 2236, 2319, 2377, 2414, 2436, 2445, 2443, 2433, 2417, 2396, 2371, 2343, 2314, 2283, 2251, 2091, 1936, 1791, 1657, 1537, 1435, 1349, 1273, 1148, 1047, 964.8, 895.9, 837.3, 786.7, 742.4, 703.5, 668.8, 637.7, 609.7, 584.3, 561.2, 540 };
    392  
    393  for(i=0; i<78; i++) {e[50][i]=e50[i]*MeV*cm2/g;}
     326AddData(T0,e50, 50);
    394327 
    395328name [51] = "G4_POLYCARBONATE";
    396329G4double e51[78] = { 146.3, 178.1, 204.7, 228.1, 249.2, 286.4, 319.1, 348.5, 375.5, 400.6, 424.1, 446.2, 497, 542.8, 584.7, 623.5, 659.9, 694.2, 726.6, 757.6, 815.5, 869.1, 919, 965.9, 1010, 1052, 1092, 1130, 1167, 1202, 1235, 1268, 1299, 1329, 1465, 1581, 1681, 1768, 1843, 1908, 1965, 2013, 2090, 2144, 2180, 2201, 2210, 2209, 2202, 2188, 2170, 2149, 2125, 2099, 2072, 2044, 1912, 1785, 1661, 1543, 1433, 1340, 1261, 1191, 1076, 982.4, 906, 842, 787.5, 740.5, 699.2, 662.9, 630.5, 601.5, 575.3, 551.6, 529.9, 510.1 };
    397  
    398  for(i=0; i<78; i++) {e[51][i]=e51[i]*MeV*cm2/g;}
     330AddData(T0,e51, 51);
    399331 
    400332name [52] = "G4_POLYETHYLENE";
    401333G4double e52[78] = { 168.2, 205.8, 237.5, 265.4, 290.7, 335.4, 374.8, 410.5, 443.2, 473.7, 502.3, 529.3, 591.4, 647.6, 699.1, 747.1, 792.1, 834.6, 874.9, 913.5, 985.9, 1053, 1116, 1175, 1232, 1285, 1336, 1385, 1432, 1478, 1521, 1564, 1604, 1644, 1825, 1983, 2122, 2246, 2355, 2453, 2539, 2615, 2740, 2833, 2899, 2940, 2962, 2967, 2958, 2938, 2908, 2871, 2829, 2782, 2732, 2681, 2418, 2183, 1987, 1826, 1691, 1577, 1480, 1396, 1257, 1145, 1053, 977.1, 912.4, 856.5, 807.8, 764.9, 726.7, 692.6, 661.8, 633.9, 608.6, 585.4 };
    402  
    403  for(i=0; i<78; i++) {e[52][i]=e52[i]*MeV*cm2/g;}
     334AddData(T0,e52, 52);
    404335 
    405336name [53] = "G4_MYLAR";
    406337G4double e53[78] = { 163.2, 195.3, 221.8, 244.9, 265.6, 301.9, 333.5, 361.8, 387.6, 411.5, 433.8, 454.8, 502.7, 545.7, 584.8, 621, 654.8, 686.6, 716.7, 745.3, 798.7, 847.9, 893.8, 936.8, 977.4, 1016, 1052, 1087, 1121, 1153, 1183, 1213, 1241, 1269, 1393, 1500, 1593, 1673, 1744, 1806, 1860, 1908, 1985, 2042, 2083, 2110, 2126, 2133, 2133, 2126, 2115, 2100, 2082, 2061, 2038, 2014, 1874, 1731, 1599, 1482, 1379, 1290, 1215, 1148, 1038, 948.5, 875.3, 813.8, 761.5, 716.3, 676.6, 641.6, 610.5, 582.5, 557.3, 534.4, 513.6, 494.5 };
    407  
    408  for(i=0; i<78; i++) {e[53][i]=e53[i]*MeV*cm2/g;}
     338AddData(T0,e53, 53);
    409339 
    410340name [54] = "G4_PLEXIGLASS";
    411341G4double e54[78] = { 118.7, 146.6, 170.3, 191.4, 210.4, 244.5, 274.7, 302.1, 327.3, 350.9, 373.1, 394.2, 442.7, 486.8, 527.4, 565.2, 600.9, 634.6, 666.7, 697.4, 755.1, 808.9, 859.3, 906.9, 952, 995, 1036, 1075, 1113, 1150, 1185, 1219, 1252, 1283, 1428, 1554, 1665, 1762, 1848, 1923, 1990, 2049, 2144, 2216, 2266, 2300, 2320, 2328, 2327, 2318, 2302, 2282, 2259, 2232, 2203, 2173, 2008, 1847, 1702, 1574, 1464, 1369, 1288, 1217, 1099, 1004, 925.6, 860.1, 804.4, 756.3, 714.1, 676.9, 643.8, 614.2, 587.4, 563.2, 541.1, 520.8 };
    412  
    413  for(i=0; i<78; i++) {e[54][i]=e54[i]*MeV*cm2/g;}
     342AddData(T0,e54, 54);
    414343 
    415344name [55] = "G4_POLYPROPYLENE";
    416345G4double e55[78] = { 193.7, 232.8, 265.4, 293.9, 319.6, 365, 404.8, 440.6, 473.4, 503.9, 532.5, 559.6, 621.6, 677.5, 728.8, 776.5, 821.2, 863.4, 903.5, 941.8, 1014, 1080, 1142, 1201, 1257, 1309, 1360, 1408, 1454, 1499, 1541, 1583, 1622, 1661, 1836, 1986, 2117, 2231, 2331, 2417, 2492, 2557, 2660, 2732, 2779, 2806, 2817, 2814, 2801, 2780, 2752, 2720, 2684, 2646, 2606, 2565, 2359, 2165, 1991, 1836, 1700, 1585, 1488, 1403, 1263, 1150, 1058, 981.3, 916.1, 860, 810.9, 767.8, 729.5, 695.1, 664.3, 636.2, 610.8, 587.5 };
    417  
    418  for(i=0; i<78; i++) {e[55][i]=e55[i]*MeV*cm2/g;}
     346AddData(T0,e55, 55);
    419347 
    420348name [56] = "G4_POLYSTYRENE";
    421349G4double e56[78] = { 153, 187.5, 216.6, 242.2, 265.3, 306.5, 342.7, 375.5, 405.6, 433.6, 460, 484.9, 542.1, 593.8, 641.3, 685.4, 726.9, 766, 803.1, 838.5, 905, 966.6, 1024, 1078, 1130, 1178, 1225, 1269, 1312, 1352, 1392, 1429, 1466, 1501, 1661, 1797, 1915, 2017, 2106, 2183, 2249, 2305, 2394, 2454, 2492, 2511, 2516, 2509, 2494, 2471, 2443, 2410, 2376, 2339, 2301, 2262, 2070, 1895, 1742, 1609, 1493, 1395, 1312, 1239, 1119, 1021, 941.4, 874.6, 817.8, 768.7, 725.7, 687.9, 654.1, 623.9, 596.6, 571.9, 549.4, 528.7 };
    422  
    423  for(i=0; i<78; i++) {e[56][i]=e56[i]*MeV*cm2/g;}
     350AddData(T0,e56, 56);
    424351 
    425352name [57] = "G4_TEFLON";
    426353G4double e57[78] = { 82.7, 99.97, 114.4, 127.1, 138.4, 158.5, 176.2, 192, 206.5, 220, 232.6, 244.5, 271.9, 296.4, 319, 339.8, 359.4, 377.8, 395.3, 412, 443.3, 472.2, 499.3, 524.7, 548.8, 571.7, 593.6, 614.5, 634.6, 653.9, 672.5, 690.4, 707.8, 724.6, 801.6, 868.9, 928.6, 981.9, 1030, 1073, 1112, 1148, 1209, 1260, 1301, 1334, 1361, 1382, 1397, 1408, 1415, 1419, 1420, 1418, 1414, 1409, 1399, 1373, 1319, 1246, 1165, 1095, 1034, 979.4, 887.4, 813.7, 752.5, 700.8, 656.5, 618.1, 584.5, 554.8, 528.3, 504.6, 483, 463.5, 445.6, 429.3 };
    427  
    428  for(i=0; i<78; i++) {e[57][i]=e57[i]*MeV*cm2/g;}
     354AddData(T0,e57, 57);
    429355 
    430356name [58] = "G4_POLYVINYL_CHLORIDE";
    431357G4double e58[78] = { 94.27, 114.4, 131.3, 146.3, 159.9, 184, 205.5, 224.9, 242.9, 259.7, 275.5, 290.5, 325.3, 357, 386.3, 413.7, 439.5, 464.1, 487.6, 510.1, 552.6, 592.4, 629.9, 665.5, 699.4, 731.8, 762.9, 792.9, 821.8, 849.7, 876.7, 902.9, 928.2, 952.9, 1067, 1167, 1255, 1335, 1405, 1468, 1525, 1574, 1657, 1719, 1764, 1795, 1814, 1823, 1824, 1818, 1807, 1792, 1774, 1753, 1731, 1708, 1591, 1482, 1385, 1299, 1222, 1153, 1092, 1037, 941.7, 862.4, 795.8, 739.8, 692.3, 651.2, 615.4, 583.7, 555.6, 530.3, 507.5, 486.9, 468, 450.8 };
    432  
    433  for(i=0; i<78; i++) {e[58][i]=e58[i]*MeV*cm2/g;}
     358AddData(T0,e58, 58);
    434359 
    435360name [59] = "G4_PROPANE";
    436361G4double e59[78] = { 194.5, 234.7, 268.4, 298, 324.7, 372, 413.6, 451.2, 485.8, 518, 548.2, 576.8, 642.6, 702.2, 756.9, 808, 855.9, 901.2, 944.4, 985.6, 1063, 1135, 1203, 1267, 1327, 1385, 1440, 1492, 1543, 1592, 1639, 1684, 1728, 1770, 1964, 2131, 2277, 2404, 2516, 2613, 2698, 2771, 2887, 2969, 3022, 3053, 3065, 3061, 3046, 3021, 2990, 2953, 2912, 2868, 2822, 2775, 2564, 2372, 2191, 2022, 1868, 1739, 1629, 1534, 1377, 1252, 1150, 1065, 993, 931.1, 877.2, 829.9, 787.8, 750.2, 716.4, 685.8, 658, 632.5 };
    437  
    438  for(i=0; i<78; i++) {e[59][i]=e59[i]*MeV*cm2/g;}
     362AddData(T0,e59, 59);
    439363 
    440364name [60] = "G4_Pt";
    441365G4double e60[78] = { 14.45, 17.87, 20.78, 23.37, 25.71, 29.9, 33.61, 36.99, 40.1, 43.01, 45.75, 48.35, 54.36, 59.81, 64.84, 69.54, 73.97, 78.17, 82.17, 86, 93.22, 99.96, 106.3, 112.3, 118, 123.5, 128.7, 133.8, 138.7, 143.4, 147.9, 152.4, 156.7, 160.8, 180.3, 197.6, 213.3, 227.7, 240.9, 253, 264.3, 274.7, 293.2, 309, 322.4, 333.7, 343.1, 350.7, 356.8, 361.6, 365.1, 367.6, 369.1, 369.8, 369.9, 369.3, 364.7, 357, 347.3, 336.6, 325.5, 314.4, 303.6, 293.2, 274.3, 258.5, 245.1, 233.4, 223.1, 214, 205.8, 198.4, 191.6, 185.4, 179.7, 174.4, 169.5, 164.9 };
    442  
    443  for(i=0; i<78; i++) {e[60][i]=e60[i]*MeV*cm2/g;}
     366AddData(T0,e60, 60);
    444367 
    445368name [61] = "G4_Si";
    446369G4double e61[78] = { 47.32, 61.63, 74.34, 85.98, 96.82, 116.8, 135.1, 152.1, 168.2, 183.4, 198.1, 212.1, 245.3, 276.1, 305.2, 332.7, 359.1, 384.4, 408.7, 432.2, 477, 519.3, 559.4, 597.5, 633.9, 668.6, 701.9, 733.7, 764.3, 793.5, 821.6, 848.5, 874.4, 899.1, 1008, 1097, 1168, 1225, 1270, 1307, 1336, 1359, 1390, 1408, 1416, 1417, 1413, 1405, 1395, 1383, 1370, 1356, 1341, 1326, 1310, 1295, 1218, 1146, 1081, 1023, 970.6, 923.9, 881.4, 842.4, 773.1, 713.1, 661.2, 617.4, 579.7, 547, 518.2, 492.7, 470, 449.5, 430.9, 414, 398.6, 384.4 };
    447  
    448  for(i=0; i<78; i++) {e[61][i]=e61[i]*MeV*cm2/g;}
     370AddData(T0,e61, 61);
    449371 
    450372name [62] = "G4_SILICON_DIOXIDE";
    451373G4double e62[78] = { 68.9, 85.1, 98.85, 111, 122.1, 141.8, 159.3, 175.1, 189.8, 203.4, 216.3, 228.5, 256.6, 282.1, 305.7, 327.6, 348.3, 367.9, 386.5, 404.4, 437.9, 469.2, 498.5, 526.3, 552.6, 577.7, 601.7, 624.7, 646.9, 668.2, 688.8, 708.7, 728, 746.7, 832.2, 906.8, 972.6, 1031, 1083, 1129, 1170, 1207, 1268, 1315, 1351, 1377, 1396, 1409, 1417, 1421, 1421, 1419, 1414, 1406, 1397, 1387, 1349, 1301, 1237, 1163, 1087, 1021, 964, 913.7, 829.4, 762.2, 706.3, 659, 618.4, 583.3, 552.3, 524.9, 500.4, 478.4, 458.5, 440.4, 423.9, 408.7 };
    452  
    453  for(i=0; i<78; i++) {e[62][i]=e62[i]*MeV*cm2/g;}
     374AddData(T0,e62, 62);
    454375 
    455376name [63] = "G4_STILBENE";
    456377G4double e63[78] = { 192, 228.9, 259.4, 286, 309.7, 351.2, 387.4, 419.7, 449.2, 476.4, 501.9, 525.8, 580.4, 629.2, 673.8, 714.9, 753.3, 789.4, 823.5, 856, 916.5, 972.3, 1024, 1073, 1119, 1162, 1203, 1243, 1280, 1316, 1351, 1384, 1416, 1446, 1585, 1703, 1805, 1892, 1968, 2034, 2090, 2139, 2215, 2268, 2303, 2323, 2331, 2330, 2321, 2307, 2287, 2265, 2240, 2212, 2184, 2155, 1995, 1841, 1703, 1582, 1477, 1385, 1305, 1233, 1113, 1015, 936, 869.6, 813, 764.1, 721.3, 683.7, 650.1, 620, 592.9, 568.3, 545.9, 525.4 };
    457  
    458  for(i=0; i<78; i++) {e[63][i]=e63[i]*MeV*cm2/g;}
     378AddData(T0,e63, 63);
    459379 
    460380name [64] = "G4_Ti";
    461381G4double e64[78] = { 59.24, 72.81, 84.28, 94.41, 103.6, 119.9, 134.3, 147.4, 159.4, 170.6, 181.1, 191.1, 214, 234.7, 253.8, 271.6, 288.3, 304.1, 319.1, 333.5, 360.5, 385.5, 409, 431.2, 452.2, 472.2, 491.4, 509.7, 527.3, 544.3, 560.6, 576.4, 591.7, 606.5, 674.2, 733.1, 785, 831, 871.7, 907.9, 940, 968.3, 1015, 1051, 1077, 1095, 1106, 1112, 1114, 1112, 1107, 1100, 1092, 1082, 1071, 1059, 995.6, 933.7, 877.6, 827.9, 785.2, 747.8, 714.5, 684.4, 631.9, 587.1, 548.3, 514.3, 484.2, 457.3, 433.4, 412.5, 393.7, 376.7, 361.5, 347.6, 334.9, 323.2 };
    462  
    463  for(i=0; i<78; i++) {e[64][i]=e64[i]*MeV*cm2/g;}
     382AddData(T0,e64, 64);
    464383 
    465384name [65] = "G4_Sn";
    466385G4double e65[78] = { 27.39, 33.96, 39.55, 44.52, 49.04, 57.11, 64.28, 70.8, 76.82, 82.45, 87.76, 92.79, 104.4, 115, 124.8, 133.9, 142.5, 150.6, 158.4, 165.8, 179.8, 192.9, 205.2, 216.8, 227.8, 238.4, 248.4, 258.1, 267.4, 276.4, 285.1, 293.5, 301.6, 309.5, 345.7, 377.3, 405.3, 430.1, 452.1, 471.8, 489.3, 504.8, 530.7, 550.9, 566.3, 577.9, 586.3, 592.2, 596.1, 598.4, 599.3, 599.1, 598.1, 596.4, 594.2, 591.5, 573.8, 552.8, 531.2, 510.1, 488.3, 467, 447, 428.6, 396.3, 369.4, 346.8, 327.7, 311.4, 297.1, 283.9, 271.9, 260.8, 250.6, 241.7, 233.6, 226, 218.9 };
    467  
    468  for(i=0; i<78; i++) {e[65][i]=e65[i]*MeV*cm2/g;}
     386AddData(T0,e65, 65);
    469387 
    470388name [66] = "G4_TISSUE_METHANE";
    471389G4double e66[78] = { 135.1, 165.6, 191.3, 213.9, 234.4, 270.7, 302.8, 331.8, 358.4, 383.2, 406.5, 428.6, 479.3, 525.2, 567.4, 606.7, 643.6, 678.5, 711.7, 743.4, 803.1, 858.6, 910.7, 960.1, 1007, 1052, 1095, 1136, 1176, 1214, 1251, 1287, 1322, 1356, 1514, 1655, 1783, 1899, 2006, 2104, 2193, 2275, 2418, 2535, 2626, 2693, 2737, 2760, 2764, 2752, 2728, 2695, 2655, 2612, 2566, 2519, 2278, 2060, 1878, 1727, 1602, 1494, 1403, 1323, 1191, 1085, 998.2, 926, 864.6, 811.7, 765.6, 724.9, 688.8, 656.5, 627.4, 601.1, 577.1, 555.2 };
    472  
    473  for(i=0; i<78; i++) {e[66][i]=e66[i]*MeV*cm2/g;}
     390AddData(T0,e66, 66);
    474391 
    475392name [67] = "G4_TISSUE_PROPANE";
    476393G4double e67[78] = { 149.7, 181.5, 208.2, 231.7, 252.8, 290.4, 323.5, 353.4, 380.9, 406.5, 430.5, 453.3, 505.7, 553, 596.6, 637.2, 675.4, 711.5, 745.8, 778.6, 840.4, 897.8, 951.6, 1003, 1051, 1097, 1141, 1183, 1224, 1263, 1301, 1337, 1372, 1407, 1563, 1701, 1822, 1929, 2024, 2109, 2185, 2252, 2362, 2446, 2507, 2549, 2573, 2583, 2581, 2569, 2550, 2524, 2494, 2461, 2426, 2389, 2211, 2043, 1887, 1744, 1616, 1507, 1415, 1334, 1201, 1094, 1006, 933.3, 871.4, 818.1, 771.5, 730.5, 694.1, 661.5, 632.1, 605.6, 581.4, 559.3 };
    477  
    478  for(i=0; i<78; i++) {e[67][i]=e67[i]*MeV*cm2/g;}
     394AddData(T0,e67, 67);
    479395 
    480396name [68] = "G4_TOLUENE";
    481397G4double e68[78] = { 192.5, 230, 261, 288.1, 312.3, 354.9, 392, 425.3, 455.6, 483.7, 510, 534.8, 591.3, 642.1, 688.4, 731.3, 771.4, 809.1, 844.8, 878.8, 942.4, 1001, 1056, 1107, 1155, 1201, 1245, 1287, 1327, 1365, 1401, 1437, 1471, 1504, 1652, 1779, 1888, 1983, 2065, 2136, 2197, 2250, 2333, 2392, 2430, 2452, 2461, 2459, 2449, 2433, 2411, 2386, 2358, 2328, 2296, 2264, 2109, 1960, 1817, 1683, 1560, 1456, 1368, 1291, 1163, 1060, 976.6, 906.6, 847.1, 795.7, 750.8, 711.3, 676.1, 644.6, 616.2, 590.5, 567, 545.6 };
    482  
    483  for(i=0; i<78; i++) {e[68][i]=e68[i]*MeV*cm2/g;}
     398AddData(T0,e68, 68);
    484399 
    485400name [69] = "G4_U";
    486401G4double e69[78] = { 13.2, 16.72, 19.77, 22.52, 25.04, 29.61, 33.73, 37.51, 41.03, 44.35, 47.5, 50.51, 57.52, 63.96, 69.97, 75.62, 80.99, 86.11, 91.01, 95.73, 104.7, 113.1, 121.1, 128.7, 136, 143, 149.8, 156.3, 162.6, 168.8, 174.7, 180.5, 186.2, 191.7, 217.4, 240.5, 261.5, 280.8, 298.5, 314.8, 329.8, 343.7, 368, 388.4, 405.3, 419, 429.8, 438.1, 444.2, 448.4, 450.8, 451.8, 451.6, 450.3, 448.2, 445.4, 420, 390.1, 362.9, 339.6, 319.8, 303.1, 288.9, 276.7, 256.9, 241.7, 229.4, 218.6, 209.1, 200.6, 193, 186.1, 179.8, 174, 168.6, 163.7, 159.1, 154.8 };
    487  
    488  for(i=0; i<78; i++) {e[69][i]=e69[i]*MeV*cm2/g;}
     402AddData(T0,e69, 69);
    489403 
    490404name [70] = "G4_W";
    491405G4double e70[78] = { 20.75, 25.23, 28.99, 32.29, 35.26, 40.51, 45.11, 49.26, 53.06, 56.59, 59.9, 63.02, 70.18, 76.63, 82.54, 88.02, 93.16, 98.01, 102.6, 107, 115.2, 122.9, 130, 136.7, 143.1, 149.2, 155, 160.6, 165.9, 171.1, 176.1, 180.9, 185.6, 190.1, 211.1, 229.6, 246.2, 261.3, 275.1, 287.7, 299.3, 310, 328.8, 344.7, 358.1, 369.2, 378.3, 385.6, 391.3, 395.6, 398.7, 400.6, 401.7, 401.9, 401.4, 400.4, 389.5, 374.8, 359.5, 344.8, 331, 318.3, 306.5, 295.7, 276.7, 260.8, 247.3, 235.5, 225.2, 216.1, 207.8, 200.3, 193.5, 187.3, 181.5, 176.2, 171.3, 166.7 };
    492  
    493  for(i=0; i<78; i++) {e[70][i]=e70[i]*MeV*cm2/g;}
     406AddData(T0,e70, 70);
    494407 
    495408name [71] = "G4_WATER";
    496409G4double e71[78] = { 98.91, 122.7, 143.1, 161.1, 177.5, 206.9, 233, 256.8, 278.8, 299.3, 318.6, 337, 379.5, 418.1, 453.8, 487.1, 518.6, 548.3, 576.7, 603.9, 655.2, 703, 748, 790.5, 831, 869.6, 906.6, 942.2, 976.4, 1009, 1041, 1072, 1102, 1131, 1265, 1383, 1488, 1582, 1666, 1743, 1811, 1873, 1978, 2062, 2128, 2178, 2215, 2240, 2255, 2262, 2262, 2256, 2245, 2230, 2211, 2190, 2050, 1896, 1752, 1624, 1511, 1414, 1329, 1255, 1132, 1034, 952.7, 884.8, 826.9, 777.1, 733.4, 694.9, 660.7, 630.1, 602.5, 577.6, 554.8, 534 };
    497  
    498  for(i=0; i<78; i++) {e[71][i]=e71[i]*MeV*cm2/g;}
     410AddData(T0,e71, 71);
    499411 
    500412name [72] = "G4_WATER_VAPOR";
    501413G4double e72[78] = { 126.3, 154.7, 178.7, 199.8, 218.8, 252.7, 282.5, 309.5, 334.3, 357.3, 379, 399.5, 446.7, 489.3, 528.5, 565, 599.2, 631.6, 662.4, 691.9, 747.3, 798.8, 847.2, 892.9, 936.3, 977.8, 1018, 1056, 1093, 1128, 1163, 1196, 1228, 1260, 1405, 1535, 1652, 1758, 1855, 1942, 2022, 2094, 2216, 2309, 2377, 2422, 2446, 2455, 2453, 2446, 2436, 2423, 2409, 2392, 2371, 2346, 2169, 1971, 1797, 1653, 1537, 1437, 1351, 1275, 1149, 1049, 965.8, 896.6, 837.6, 786.9, 742.5, 703.3, 668.6, 637.5, 609.5, 584.2, 561.1, 539.9 };
    502  
    503  for(i=0; i<78; i++) {e[72][i]=e72[i]*MeV*cm2/g;}
     414AddData(T0,e72, 72);
    504415 
    505416name [73] = "G4_Xe";
    506417G4double e73[78] = { 18.11, 23.3, 27.86, 31.99, 35.83, 42.84, 49.2, 55.1, 60.63, 65.87, 70.87, 75.65, 86.89, 97.3, 107.1, 116.3, 125.1, 133.5, 141.7, 149.5, 164.4, 178.6, 192, 204.9, 217.3, 229.2, 240.7, 251.8, 262.6, 273.1, 283.4, 293.3, 303, 312.5, 356.7, 396.5, 432.5, 465.2, 494.9, 521.8, 546.1, 567.9, 604.7, 633.2, 654.5, 669.3, 678.8, 683.6, 684.6, 682.5, 678, 671.7, 663.9, 655.1, 645.6, 635.6, 584.6, 538.7, 500.4, 468.8, 446.7, 430.5, 417.1, 405.3, 383.9, 364, 344.9, 326.8, 309.7, 294.6, 281.3, 269.5, 258.7, 248.8, 239.6, 231.1, 223.2, 216.2 };
    507  
    508  for(i=0; i<78; i++) {e[73][i]=e73[i]*MeV*cm2/g;}
     418AddData(T0,e73, 73);
    509419}
     420
     421void G4ASTARStopping::AddData(G4double* ekin, G4double* s, G4int idx)
     422{
     423sdata[idx] = new G4LPhysicsFreeVector(78, ekin[0]*MeV, ekin[77]*MeV);
     424const G4double fac = MeV*cm2/g;
     425for(size_t i=0; i<78; ++i) { sdata[idx]->PutValues(i, ekin[i]*MeV, s[i]*fac); }
     426sdata[idx]->SetSpline(true);
     427}
  • trunk/source/processes/electromagnetic/standard/src/G4BetheBlochModel.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4BetheBlochModel.cc,v 1.36 2009/12/03 17:26:40 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4BetheBlochModel.cc,v 1.37 2010/05/27 10:25:59 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    145145                                              G4double kineticEnergy)
    146146{
    147   // this method is called only for ions
     147  // this method is called only for ions, so no check if it is an ion
    148148  return corr->GetParticleCharge(p,mat,kineticEnergy);
     149}
     150
     151//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     152
     153void G4BetheBlochModel::SetupParameters()
     154{
     155  mass = particle->GetPDGMass();
     156  spin = particle->GetPDGSpin();
     157  G4double q = particle->GetPDGCharge()/eplus;
     158  chargeSquare = q*q;
     159  ratio = electron_mass_c2/mass;
     160  G4double magmom =
     161    particle->GetPDGMagneticMoment()*mass/(0.5*eplus*hbar_Planck*c_squared);
     162  magMoment2 = magmom*magmom - 1.0;
     163  formfact = 0.0;
     164  if(particle->GetLeptonNumber() == 0) {
     165    G4double x = 0.8426*GeV;
     166    if(spin == 0.0 && mass < GeV) {x = 0.736*GeV;}
     167    else if(mass > GeV) {
     168      x /= nist->GetZ13(mass/proton_mass_c2);
     169      //        tlimit = 51.2*GeV*A13[iz]*A13[iz];
     170    }
     171    formfact = 2.0*electron_mass_c2/(x*x);
     172    tlimit   = 2.0/formfact;
     173  }
    149174}
    150175
     
    170195
    171196    // +term for spin=1/2 particle
    172     if( 0.5 == spin ) cross += 0.5*(maxEnergy - cutEnergy)/energy2;
     197    if( 0.5 == spin ) { cross += 0.5*(maxEnergy - cutEnergy)/energy2; }
    173198
    174199    // High order correction different for hadrons and ions
     
    225250{
    226251  G4double tmax      = MaxSecondaryEnergy(p, kineticEnergy);
    227   G4double cutEnergy = min(cut,tmax);
     252  G4double cutEnergy = std::min(cut,tmax);
    228253
    229254  G4double tau   = kineticEnergy/mass;
     
    234259  G4double eexc  = material->GetIonisation()->GetMeanExcitationEnergy();
    235260  G4double eexc2 = eexc*eexc;
    236   //G4double cden  = material->GetIonisation()->GetCdensity();
    237   //G4double mden  = material->GetIonisation()->GetMdensity();
    238   //G4double aden  = material->GetIonisation()->GetAdensity();
    239   //G4double x0den = material->GetIonisation()->GetX0density();
    240   //G4double x1den = material->GetIonisation()->GetX1density();
    241261
    242262  G4double eDensity = material->GetElectronDensity();
     
    252272  // density correction
    253273  G4double x = log(bg2)/twoln10;
    254   //if ( x >= x0den ) {
    255   //  dedx -= twoln10*x - cden ;
    256   //  if ( x < x1den ) dedx -= aden*pow((x1den-x),mden) ;
    257   //}
    258274  dedx -= material->GetIonisation()->DensityCorrection(x);
    259275
     
    277293
    278294//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    279 /*
    280 void G4BetheBlochModel::CorrectionsAlongStep(const G4MaterialCutsCouple*,
    281                                              const G4DynamicParticle*,
    282                                              G4double&,
    283                                              G4double&,
    284                                              G4double)
    285 {}
    286 */
    287295
    288296void G4BetheBlochModel::CorrectionsAlongStep(const G4MaterialCutsCouple* couple,
  • trunk/source/processes/electromagnetic/standard/src/G4BraggModel.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4BraggModel.cc,v 1.23 2009/11/10 19:25:47 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4BraggModel.cc,v 1.26 2010/06/04 09:08:43 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    9090  theZieglerFactor = eV*cm2*1.0e-15;
    9191  theElectron = G4Electron::Electron();
     92
     93  corr = G4LossTableManager::Instance()->EmCorrections();
    9294}
    9395
     
    100102
    101103G4double G4BraggModel::MinEnergyCut(const G4ParticleDefinition*,
    102                                     const G4MaterialCutsCouple* couple)
    103 {
    104   return couple->GetMaterial()->GetIonisation()->GetMeanExcitationEnergy();
     104                                    const G4MaterialCutsCouple*)
     105{
     106  return 0.1*keV;
     107  // return couple->GetMaterial()->GetIonisation()->GetMeanExcitationEnergy();
    105108}
    106109
     
    110113                              const G4DataVector&)
    111114{
    112   if(p != particle) SetParticle(p);
     115  if(p != particle) { SetParticle(p); }
    113116
    114117  // always false before the run
     
    120123    G4String pname = particle->GetParticleName();
    121124    if(particle->GetParticleType() == "nucleus" &&
    122        pname != "deuteron" && pname != "triton") isIon = true;
    123 
    124     corr = G4LossTableManager::Instance()->EmCorrections();
     125       pname != "deuteron" && pname != "triton") { isIon = true; }
    125126
    126127    fParticleChange = GetParticleChangeForLoss();
     
    146147                                         G4double kineticEnergy)
    147148{
    148   // this method is called only for ions
     149  // this method is called only for ions, so no check if it is an ion
    149150  return corr->GetParticleCharge(p,mat,kineticEnergy);
    150151}
     
    161162  G4double tmax      = MaxSecondaryEnergy(p, kineticEnergy);
    162163  G4double maxEnergy = std::min(tmax,maxKinEnergy);
    163   if(cutEnergy < tmax) {
     164  if(cutEnergy < maxEnergy) {
    164165
    165166    G4double energy  = kineticEnergy + mass;
     
    215216  G4double tkin  = kineticEnergy/massRate;
    216217  G4double dedx  = 0.0;
    217   if(tkin > lowestKinEnergy) dedx = DEDX(material, tkin);
    218   else      dedx = DEDX(material, lowestKinEnergy)*sqrt(tkin/lowestKinEnergy);
     218  if(tkin > lowestKinEnergy) { dedx = DEDX(material, tkin); }
     219  else { dedx = DEDX(material, lowestKinEnergy)*sqrt(tkin/lowestKinEnergy); }
    219220
    220221  if (cutEnergy < tmax) {
     
    240241
    241242//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    242 /*
    243 void G4BraggModel::CorrectionsAlongStep(const G4MaterialCutsCouple* couple,
    244                                         const G4DynamicParticle* dp,
    245                                         G4double& eloss,
    246                                         G4double&,
    247                                         G4double length)
    248 {
    249   if(nuclearStopping) {
    250 
    251     G4double preKinEnergy = dp->GetKineticEnergy();
    252     G4double e = preKinEnergy - eloss*0.5;
    253     if(e < 0.0) e = preKinEnergy*0.5;
    254     G4double nloss = length*corr->NuclearDEDX(dp->GetDefinition(),
    255                                               couple->GetMaterial(),
    256                                               e,false);
    257 
    258     // too big energy loss
    259     if(eloss + nloss > preKinEnergy) {
    260       nloss *= (preKinEnergy/(eloss + nloss));
    261       eloss = preKinEnergy;
    262     } else {
    263       eloss += nloss;
    264     }
    265    
    266     G4cout << "G4ionIonisation::CorrectionsAlongStep: e= " << preKinEnergy
    267            << " de= " << eloss << " NIEL= " << nloss
    268            << " dynQ= " << dp->GetCharge()/eplus << G4endl;
    269    
    270     fParticleChange->ProposeNonIonizingEnergyDeposit(nloss);
    271   }
    272 }
    273 */
    274 
    275 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    276243
    277244void G4BraggModel::SampleSecondaries(vector<G4DynamicParticle*>* vdp,
     
    283250  G4double tmax = MaxSecondaryKinEnergy(dp);
    284251  G4double xmax = std::min(tmax, maxEnergy);
    285   if(xmin >= xmax) return;
     252  if(xmin >= xmax) { return; }
    286253
    287254  G4double kineticEnergy = dp->GetKineticEnergy();
     
    343310                                          G4double kinEnergy)
    344311{
    345   if(pd != particle) SetParticle(pd);
     312  if(pd != particle) { SetParticle(pd); }
    346313  G4double tau  = kinEnergy/mass;
    347314  G4double tmax = 2.0*electron_mass_c2*tau*(tau + 2.) /
     
    605572  G4int iNist = pstar.GetIndex(material);
    606573
    607   if( iNist >= 0 ) {
     574  if( iNist >= 0 && kineticEnergy <= 2.01*MeV) {
    608575    return pstar.GetElectronicDEDX(iNist, kineticEnergy)*material->GetDensity();
    609576
  • trunk/source/processes/electromagnetic/standard/src/G4CoulombScattering.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4CoulombScattering.cc,v 1.25 2009/10/28 10:14:13 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4CoulombScattering.cc,v 1.28 2010/05/25 18:41:12 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    5555#include "G4Electron.hh"
    5656#include "G4Proton.hh"
     57#include "G4LossTableManager.hh"
    5758
    5859//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    6465    isInitialised(false)
    6566{
     67  //  G4cout << "G4CoulombScattering constructor "<< G4endl;
    6668  SetBuildTableFlag(true);
    6769  SetStartFromNullFlag(false);
     
    9395void G4CoulombScattering::InitialiseProcess(const G4ParticleDefinition* p)
    9496{
     97  //G4cout << "### G4CoulombScattering::InitialiseProcess : "
     98  //     << p->GetParticleName() << G4endl;
     99  G4double a =
     100    G4LossTableManager::Instance()->FactorForAngleLimit()*CLHEP::hbarc/CLHEP::fermi;
     101  q2Max = 0.5*a*a;
     102 
    95103  // second initialisation
    96104  if(isInitialised) {
     
    98106    mod->SetPolarAngleLimit(PolarAngleLimit());
    99107    mod = GetModelByIndex(1);
    100     if(mod) mod->SetPolarAngleLimit(PolarAngleLimit());
     108    if(mod) { mod->SetPolarAngleLimit(PolarAngleLimit()); }
    101109
    102110    // first initialisation
     
    106114    G4double mass = p->GetPDGMass();
    107115    G4String name = p->GetParticleName();
     116    //G4cout << name << "  type: " << p->GetParticleType()
     117    //<< " mass= " << mass << G4endl;
    108118    if (mass > GeV || p->GetParticleType() == "nucleus") {
    109119      SetBuildTableFlag(false);
    110       verboseLevel = 0;
     120      if(name != "GenericIon") { SetVerboseLevel(0); }
    111121    } else {
    112122      if(name != "e-" && name != "e+" &&
    113123         name != "mu+" && name != "mu-" && name != "pi+" &&
    114          name != "kaon+" && name != "proton" ) verboseLevel = 0;
     124         name != "kaon+" && name != "proton" ) { SetVerboseLevel(0); }
    115125    }
    116126
     
    156166  else                              G4cout << thEnergy;
    157167
    158   if(q2Max < DBL_MAX) G4cout << "; q2Max(GeV^2)= " << q2Max/(GeV*GeV);
     168  if(q2Max < DBL_MAX) { G4cout << "; pLimit(GeV^1)= " << sqrt(q2Max)/GeV; }
    159169  G4cout << G4endl;
    160170}
  • trunk/source/processes/electromagnetic/standard/src/G4CoulombScatteringModel.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4CoulombScatteringModel.cc,v 1.44 2009/12/03 09:59:07 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4CoulombScatteringModel.cc,v 1.49 2010/05/27 14:22:05 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    4747// 09.06.08 V.Ivanchenko SelectIsotope is moved to the base class
    4848// 16.06.09 Consolandi rows 109, 111-112, 183, 185-186
     49// 27.05.10 V.Ivanchenko added G4WentzelOKandVIxSection class to
     50//              compute cross sections and sample scattering angle
    4951//
    5052//
     
    6264#include "G4IonTable.hh"
    6365#include "G4Proton.hh"
     66#include "G4NucleiProperties.hh"
    6467
    6568//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    8689                                G4double)
    8790{
    88   SetupParticle(p);
    89   if(kinEnergy < lowEnergyLimit) return 0.0;
    90   SetupKinematic(kinEnergy, cutEnergy);
    91 
    92   // save lab system kinematics
    93   G4double xtkin = tkin;
    94   G4double xmom2 = mom2;
    95   G4double xinvb = invbeta2;
    96 
    97   // CM system
    98   iz            = G4int(Z);
    99   G4double m2   = fNistManager->GetAtomicMassAmu(iz)*amu_c2;
    100   G4double etot = tkin + mass;
    101   G4double ptot = sqrt(mom2);
    102 
    103   G4double m12  = mass*mass;
    104   G4double momCM= ptot*m2/sqrt(m12 + m2*m2 + 2.0*etot*m2);
    105 
    106   mom2 = momCM*momCM;
    107   tkin = sqrt(mom2 + m12) - mass;
    108 
    109   //invbeta2 = 1.0 +  m12/mom2;
    110   //  G4double fm = m2/(mass + m2); 
    111 
    112   // 03.09.2009 C.Consaldi
    113   G4double Ecm=sqrt(m12 + m2*m2 + 2.0*etot*m2);
    114   G4double mu_rel=mass*m2/Ecm;
    115 
    116   invbeta2 = 1.0 +  mu_rel*mu_rel/mom2;
    117   //
    118 
    119   SetupTarget(Z, tkin);
    120 
    121   G4double xsec = CrossSectionPerAtom();
    122 
    123   // restore Lab system kinematics
    124   tkin = xtkin;
    125   mom2 = xmom2;
    126   invbeta2 = xinvb;
    127 
     91  //G4cout << "### G4CoulombScatteringModel::ComputeCrossSectionPerAtom  for "
     92  //     << p->GetParticleName()<<" Z= "<<Z<<" e(MeV)= "<< kinEnergy/MeV
     93  //     <<" cut(MeV)= " << cutEnergy<< G4endl;
     94  G4double xsec = 0.0;
     95  if(p != particle) { SetupParticle(p); }
     96  if(kinEnergy < lowEnergyLimit) { return 0.0; }
     97  DefineMaterial(CurrentCouple());
     98
     99  // Lab system
     100  G4int iz = G4int(Z);
     101  G4double etot = kinEnergy + mass;
     102  G4double m2 = fNistManager->GetAtomicMassAmu(iz)*amu_c2;
     103
     104  // 03.09.2009 C.Consaldi suggested to use relativistic reduced mass
     105  //            from publucation
     106  // A.P. Martynenko, R.N. Faustov, Teoret. mat. Fiz. 64 (1985) 179
     107  G4double Ecm  = sqrt(mass*mass + m2*m2 + 2.0*etot*m2);
     108  G4double mu_rel = mass*m2/Ecm;
     109  G4double tkin = Ecm - mu_rel;
     110  wokvi->SetRelativisticMass(mu_rel);
     111 
     112  cosTetMinNuc = wokvi->SetupKinematic(tkin, currentMaterial);
     113  if(cosThetaMax < cosTetMinNuc) {
     114    cosTetMinNuc = wokvi->SetupTarget(iz, cutEnergy);
     115    cosTetMaxNuc = cosThetaMax;
     116    if(iz == 1 && cosTetMaxNuc < 0.0 && particle == theProton) {
     117      cosTetMaxNuc = 0.0;
     118    }
     119    xsec =  wokvi->ComputeNuclearCrossSection(cosTetMinNuc, cosTetMaxNuc);
     120    elecRatio = wokvi->ComputeElectronCrossSection(cosTetMinNuc, cosThetaMax);
     121    xsec += elecRatio;
     122    if(xsec > 0.0) { elecRatio /= xsec; } 
     123  }
     124  /*
     125  G4cout << "e(MeV)= " << kinEnergy/MeV << " xsec(b)= " << xsec/barn 
     126         << "cosTetMinNuc= " << cosTetMinNuc
     127         << " cosTetMaxNuc= " << cosTetMaxNuc
     128         << " cosTetMaxElec= " << cosTetMaxElec
     129         << " screenZ= " << screenZ
     130         << " formfactA= " << formfactA << G4endl;
     131  */
    128132  return xsec;
    129133}
     
    139143{
    140144  G4double kinEnergy = dp->GetKineticEnergy();
    141   if(kinEnergy < lowEnergyLimit) return;
     145  if(kinEnergy < lowEnergyLimit) { return; }
    142146  DefineMaterial(couple);
    143147  SetupParticle(dp->GetDefinition());
    144   SetupKinematic(kinEnergy, cutEnergy);
    145148
    146149  // Choose nucleus
    147150  currentElement = SelectRandomAtom(couple,particle,
    148                                     kinEnergy,ecut,kinEnergy);
    149 
    150   G4double Z  = currentElement->GetZ();
    151   iz          = G4int(Z);
    152   G4int ia    = SelectIsotopeNumber(currentElement);
    153   G4double m2 = theParticleTable->GetIonTable()->GetNucleusMass(iz, ia);
    154 
    155   // CM system
    156   G4double etot = tkin + mass;
    157   G4double ptot = sqrt(mom2);
    158 
    159   G4double momCM= ptot*m2/sqrt(mass*mass + m2*m2 + 2.0*etot*m2);
    160   mom2 = momCM*momCM;
    161   G4double m12 = mass*mass;
    162   G4double eCM = sqrt(mom2 + m12);
    163 
    164   // a correction for heavy projectile
    165   //  G4double fm = m2/(mass + m2);
    166   //  invbeta2 = 1.0 +  m12*fm*fm/mom2;
    167 
    168   // 03.09.2009 C.Consaldi
    169   G4double Ecm=sqrt(m12 + m2*m2 + 2.0*etot*m2);
    170   G4double mu_rel=mass*m2/Ecm;
    171 
    172   invbeta2 = 1.0 +  mu_rel*mu_rel/mom2;
    173   //
    174 
    175   // sample scattering angle in CM system
    176   SetupTarget(Z, eCM - mass);
    177 
    178   G4double cost = SampleCosineTheta();
    179   G4double z1   = 1.0 - cost;
    180   if(z1 < 0.0) return;
    181   G4double sint = sqrt(z1*(1.0 + cost));
    182   G4double phi  = twopi * G4UniformRand();
     151                                    kinEnergy,cutEnergy,kinEnergy);
     152
     153  G4double Z = currentElement->GetZ();
     154  G4int iz = G4int(Z);
     155  G4int ia = SelectIsotopeNumber(currentElement);
     156  G4double targetMass = G4NucleiProperties::GetNuclearMass(ia, iz);
     157 
     158  if(ComputeCrossSectionPerAtom(particle,kinEnergy, Z,
     159                                kinEnergy, cutEnergy, kinEnergy) == 0.0)
     160    { return; }
     161
     162  G4ThreeVector newDirection =
     163    wokvi->SampleSingleScattering(cosTetMinNuc, cosTetMaxNuc, elecRatio);
    183164
    184165  // kinematics in the Lab system
    185   G4double bet  = ptot/(etot + m2);
     166  G4double etot = mass + kinEnergy;
     167  G4double ptot = sqrt(kinEnergy*(etot + mass));
     168  G4double bet  = ptot/(etot + targetMass);
    186169  G4double gam  = 1.0/sqrt((1.0 - bet)*(1.0 + bet));
    187   G4double pzCM = momCM*cost;
    188 
    189   G4ThreeVector v1(momCM*cos(phi)*sint,momCM*sin(phi)*sint,gam*(pzCM + bet*eCM));
     170  G4double eCM  = sqrt(mass*mass + targetMass*targetMass + 2*targetMass*etot);
     171  G4double pCM  = ptot*targetMass/eCM;
     172  G4double e1   = sqrt(mass*mass + pCM*pCM);
     173
     174  newDirection *= pCM;
     175
     176  G4ThreeVector v1(newDirection.x(),newDirection.y(),gam*(newDirection.z() + bet*e1));
     177  G4double finalT = gam*(e1 + bet*newDirection.z()) - mass;
     178  newDirection = v1.unit();
     179
    190180  G4ThreeVector dir = dp->GetMomentumDirection();
    191   G4ThreeVector newDirection = v1.unit();
    192181  newDirection.rotateUz(dir);   
    193182  fParticleChange->ProposeMomentumDirection(newDirection);   
    194 
    195  //   G4double elab = gam*(eCM + bet*pzCM);
    196 
    197  // G4double Ecm  = sqrt(mass*mass + m2*m2 + 2.0*etot*m2);
    198   G4double elab = etot - m2*(ptot/Ecm)*(ptot/Ecm)*(1.-cost) ;
    199 
    200183 
    201   G4double finalT = elab - mass;
    202   if(finalT < 0.0) finalT = 0.0;
     184  // recoil
     185  G4double trec = kinEnergy - finalT;
     186  if(finalT <= lowEnergyLimit) {
     187    trec = kinEnergy; 
     188    finalT = 0.0;
     189  }
     190   
    203191  fParticleChange->SetProposedKineticEnergy(finalT);
    204192
    205   // recoil
    206   G4double erec = kinEnergy - finalT;
     193  //  G4cout << "sint= " << sint << " Erec(eV)= " << erec/eV << G4endl;
    207194
    208195  G4double tcut = recoilThreshold;
    209196  if(pCuts) { tcut= std::max(tcut,(*pCuts)[currentMaterialIndex]); }
    210 
    211   if(erec > tcut) {
     197  /* 
     198  G4cout << "sint= " << sint << " Erec(eV)= " << erec/eV
     199         << " tcut(eV)= " << tcut/eV << " th(eV)= " << recoilThreshold/eV
     200         << " cut(eV)= " << (*pCuts)[currentMaterialIndex]/eV
     201         << "  "  << fvect->size()
     202         << G4endl;
     203  */
     204  if(trec > tcut) {
    212205    G4ParticleDefinition* ion = theParticleTable->FindIon(iz, ia, 0, iz);
    213206    G4double plab = sqrt(finalT*(finalT + 2.0*mass));
    214207    G4ThreeVector p2 = (ptot*dir - plab*newDirection).unit();
    215     G4DynamicParticle* newdp  = new G4DynamicParticle(ion, p2, erec);
     208    G4DynamicParticle* newdp  = new G4DynamicParticle(ion, p2, trec);
    216209    fvect->push_back(newdp);
    217   } else if(erec > 0.0) {
    218     fParticleChange->ProposeLocalEnergyDeposit(erec);
    219     fParticleChange->ProposeNonIonizingEnergyDeposit(erec);
     210  } else if(trec > 0.0) {
     211    fParticleChange->ProposeLocalEnergyDeposit(trec);
     212    fParticleChange->ProposeNonIonizingEnergyDeposit(trec);
    220213  }
    221214}
  • trunk/source/processes/electromagnetic/standard/src/G4GoudsmitSaundersonMscModel.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4GoudsmitSaundersonMscModel.cc,v 1.20 2009/12/16 17:50:11 gunter Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4GoudsmitSaundersonMscModel.cc,v 1.24 2010/05/17 15:11:30 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    5151//                     assuming the case of lambdan<1 as single scattering regime
    5252//                     tuning theta sampling for theta below the screening angle
     53// 08.02.2010 O.Kadri: bugfix in compound xsection calculation and small angle computation
     54//                     adding a rejection condition to hard collision angular sampling
     55//                     ComputeTruePathLengthLimit was taken from G4WentzelVIModel
     56// 26.03.2010 O.Kadri: direct xsection calculation not inverse of the inverse
     57//                     angular sampling without large angle rejection method
     58//                     longitudinal displacement is computed exactly from <z>
     59// 12.05.2010 O.Kadri: exchange between target and projectile has as a condition the particle type (e-/e-)
     60//                     some cleanup to minimize time consuming (adding lamdan12 & Qn12, changing the error to 1.0e-12 for scrA)
    5361//
    5462//
     
    6068//Ref.4:Bielajew et al.,".....", NIMB 173 (2001) 332-343;
    6169//Ref.5:F. Salvat et al.,"ELSEPA--Dirac partial ...molecules", Comp.Phys.Comm.165 (2005) pp 157-190;
    62 //Ref.6:G4UrbanMscModel G4_v9.1Ref09;
    63 //Ref.7:G4eCoulombScatteringModel G4_v9.1Ref09.
    64 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    65 
     70//Ref.6:G4UrbanMscModel G4 9.2;
     71//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    6672#include "G4GoudsmitSaundersonMscModel.hh"
    6773#include "G4GoudsmitSaundersonTable.hh"
     
    7783#include "G4PhysicsTable.hh"
    7884#include "Randomize.hh"
    79 #include "G4Poisson.hh"
    8085
    8186using namespace std;
     
    128133                       G4double kineticEnergy,G4double Z, G4double, G4double, G4double)
    129134
    130   //Build cross section table : Taken from Ref.7
    131135  G4double cs=0.0;
    132136  G4double kinEnergy = kineticEnergy;
     
    134138  if(kinEnergy>highKEnergy)kinEnergy=highKEnergy;
    135139
    136   G4double value0,value1;
    137   CalculateIntegrals(p,Z,kinEnergy,value0,value1);
     140  G4double cs0;
     141  CalculateIntegrals(p,Z,kinEnergy,cs0,cs);
    138142 
    139   if(value1 > 0.0) cs = 1./value1;
    140 
    141143  return cs;
    142144
     
    148150{   
    149151  G4double kineticEnergy = dynParticle->GetKineticEnergy();
    150   if((kineticEnergy <= 0.0) || (tPathLength <= tlimitminfix)) return ;
    151 
    152   G4double cosTheta1,sinTheta1,cosTheta2,sinTheta2;
    153   G4double phi1,phi2,cosPhi1=1.0,sinPhi1=0.0,cosPhi2=1.0,sinPhi2=0.0;
    154   G4double q1,Gamma,Eta,delta,nu,nu0,nu1,nu2;
     152  if((kineticEnergy <= 0.0) || (tPathLength <= tlimitminfix)||
     153     (tPathLength/tausmall < lambda1)) return ;
    155154
    156155  ///////////////////////////////////////////
    157   // Effective energy and path-length from Eq. 4.7.15+16 of Ref.4
     156  // Effective energy
    158157  G4double  eloss = theManager->GetEnergy(particle,tPathLength,currentCouple);
    159   if(eloss>0.5*kineticEnergy)eloss=kineticEnergy-eloss;//exchange possibility between target atomic e- and incident particle
     158  if(eloss>0.5*kineticEnergy)
     159   {if((dynParticle->GetCharge())==-eplus)eloss=kineticEnergy-eloss;//exchange between target and projectile if they are electrons
     160    else eloss=0.5*kineticEnergy;
     161   }
    160162  G4double ee       = kineticEnergy - 0.5*eloss;
    161163  G4double ttau     = ee/electron_mass_c2;
     
    166168  kineticEnergy *= (1 - cst1);
    167169  ///////////////////////////////////////////
    168   // additivity rule for mixture and compound xsection calculation
     170  // additivity rule for mixture and compound xsection's
    169171  const G4Material* mat = currentCouple->GetMaterial();
     172  const G4ElementVector* theElementVector = mat->GetElementVector();
     173  const G4double* theAtomNumDensityVector = mat->GetVecNbOfAtomsPerVolume();
    170174  G4int nelm = mat->GetNumberOfElements();
    171   const G4ElementVector* theElementVector = mat->GetElementVector();
    172   const G4double* theFraction = mat->GetFractionVector();
    173   G4double atomPerVolume = mat->GetTotNbOfAtomsPerVolume();
    174   G4double llambda0=0.,llambda1=0.;
     175  G4double s0,s1;
     176  lambda0=0.;
    175177  for(G4int i=0;i<nelm;i++)
    176     {
    177       G4double l0,l1;
    178       CalculateIntegrals(particle,(*theElementVector)[i]->GetZ(),kineticEnergy,l0,l1);
    179       llambda0 += (theFraction[i]/l0);
    180       llambda1 += (theFraction[i]/l1);
     178    {
     179      CalculateIntegrals(particle,(*theElementVector)[i]->GetZ(),kineticEnergy,s0,s1);
     180      lambda0 += (theAtomNumDensityVector[i]*s0);
    181181    }
    182   if(llambda0>DBL_MIN) llambda0 =1./llambda0;
    183   if(llambda1>DBL_MIN) llambda1 =1./llambda1;
     182  if(lambda0>DBL_MIN) lambda0 =1./lambda0;
     183
     184// Newton-Raphson root's finding method of scrA from:
     185// Sig1(PWA)/Sig0(PWA)=g1=2*scrA*((1+scrA)*log(1+1/scrA)-1)
    184186  G4double g1=0.0;
    185   if(llambda1>DBL_MIN) g1 = llambda0/llambda1;
    186 
    187   G4double x1,x0;
    188   x0=g1/2.;
     187  if(lambda1>DBL_MIN) g1 = lambda0/lambda1;
     188
     189  G4double logx0,x1,delta;
     190  G4double x0=g1/2.;
    189191  do
    190192    { 
    191       x1 = x0-(x0*((1.+x0)*log(1.+1./x0)-1.0)-g1/2.)/( (1.+2.*x0)*log(1.+1./x0)-2.0);// x1=x0-f(x0)/f'(x0)
     193      logx0=std::log(1.+1./x0);
     194      x1 = x0-(x0*((1.+x0)*logx0-1.0)-g1/2.)/( (1.+2.*x0)*logx0-2.0);
    192195      delta = std::abs( x1 - x0 );   
    193       x0 = x1;  // new approximation becomes the old approximation for the next iteration
    194     } while (delta > 1e-10);
     196      x0 = x1;
     197    } while (delta > 1.0e-12);
    195198  G4double scrA = x1;
    196199
    197   G4double us=0.0,vs=0.0,ws=1.0,x_coord=0.0,y_coord=0.0,z_coord=1.0;
    198200  G4double lambdan=0.;
    199   G4bool mscatt=false,noscatt=false;
    200 
    201   if(llambda0>0.)lambdan=atomPerVolume*tPathLength/llambda0;
    202   if((lambdan<=1.0e-12))return;
    203 
     201
     202  if(lambda0>0.)lambdan=tPathLength/lambda0;
     203  if(lambdan<=1.0e-12)return;
     204  G4double lambdan12=0.5*lambdan;
     205  Qn1 = lambdan *g1;//2.* lambdan *scrA*((1.+scrA)*log(1.+1./scrA)-1.);
     206  Qn12 = 0.5*Qn1;
     207 
     208  G4double cosTheta1,sinTheta1,cosTheta2,sinTheta2;
     209  G4double cosPhi1=1.0,sinPhi1=0.0,cosPhi2=1.0,sinPhi2=0.0;
     210  G4double us=0.0,vs=0.0,ws=1.0,wss=0.,x_coord=0.0,y_coord=0.0,z_coord=1.0;
     211 
    204212  G4double epsilon1=G4UniformRand();
    205   G4double expn = exp(-lambdan);
    206   if((epsilon1<expn)||insideskin)// no scattering
    207     {noscatt=true;}
    208   else if((epsilon1<((1.+lambdan)*expn)||(lambdan<1.)))
    209     {
    210       mscatt=false;
    211       ws=G4UniformRand();
    212       ws= 1.-2.*scrA*ws/(1.-ws + scrA);
    213       if(acos(ws)<sqrt(scrA))//small angle approximation for theta less than screening angle
    214       {G4int i=0;
    215       do{i++;
    216       ws=1.+0.5*atomPerVolume*tPathLength*log(G4UniformRand())/llambda1;
    217       }while((fabs(ws)>1.)&&(i<20));//i<20 to avoid time consuming during the run
    218       if(i==19)ws=cos(sqrt(scrA));
    219       }
    220       G4double phi0=twopi*G4UniformRand();
    221       us=sqrt(1.-ws*ws)*cos(phi0);
    222       vs=sqrt(1.-ws*ws)*sin(phi0);
    223       G4double rr=G4UniformRand();
    224       x_coord=(rr*us);
    225       y_coord=(rr*vs);
    226       z_coord=((1.-rr)+rr*ws);
    227     }
    228   else
    229     {
    230       mscatt=true;
     213  G4double expn = std::exp(-lambdan);
     214  if(epsilon1<expn)// no scattering
     215    {return;}
     216  else if((epsilon1<((1.+lambdan)*expn))||(lambdan<1.))//single scattering (Rutherford DCS's)
     217    {
     218
     219      G4double xi=G4UniformRand();
     220      xi= 2.*scrA*xi/(1.-xi + scrA);   
     221      if(xi<0.)xi=0.;
     222      else if(xi>2.)xi=2.;
     223      ws=1.-xi;
     224      wss=std::sqrt(xi*(2.-xi));     
     225      G4double phi0=CLHEP::twopi*G4UniformRand();
     226      us=wss*cos(phi0);
     227      vs=wss*sin(phi0);
     228    }
     229  else // multiple scattering
     230    {
    231231      // Ref.2 subsection 4.4 "The best solution found"
    232232      // Sample first substep scattering angle
    233       SampleCosineTheta(0.5*lambdan,scrA,cosTheta1,sinTheta1);
    234       phi1  = twopi*G4UniformRand();
     233      SampleCosineTheta(lambdan12,scrA,cosTheta1,sinTheta1);
     234      G4double phi1  = CLHEP::twopi*G4UniformRand();
    235235      cosPhi1 = cos(phi1);
    236236      sinPhi1 = sin(phi1);
    237237
    238238      // Sample second substep scattering angle
    239       SampleCosineTheta(0.5*lambdan,scrA,cosTheta2,sinTheta2);
    240       phi2  = twopi*G4UniformRand();
     239      SampleCosineTheta(lambdan12,scrA,cosTheta2,sinTheta2);
     240      G4double phi2  = CLHEP::twopi*G4UniformRand();
    241241      cosPhi2 = cos(phi2);
    242242      sinPhi2 = sin(phi2);
    243243
    244       // Scattering direction
     244      // Overall scattering direction
    245245      us = sinTheta2*(cosTheta1*cosPhi1*cosPhi2 - sinPhi1*sinPhi2) + cosTheta2*sinTheta1*cosPhi1;
    246246      vs = sinTheta2*(cosTheta1*sinPhi1*cosPhi2 + cosPhi1*sinPhi2) + cosTheta2*sinTheta1*sinPhi1;
    247247      ws = cosTheta1*cosTheta2 - sinTheta1*sinTheta2*cosPhi2;
     248      G4double sqrtA=sqrt(scrA);
     249      if(acos(ws)<sqrtA)//small angle approximation for theta less than screening angle
     250      {
     251       G4int i=0;
     252       do{i++;
     253       ws=1.+Qn12*log(G4UniformRand());
     254       }while((fabs(ws)>1.)&&(i<20));//i<20 to avoid time consuming during the run
     255       if(i>=19)ws=cos(sqrtA);
     256
     257       wss=std::sqrt((1.-ws)*(1.0+ws));     
     258       us=wss*cos(phi1);
     259       vs=wss*sin(phi1);
     260     }
    248261    }
    249262   
     
    253266  fParticleChange->ProposeMomentumDirection(newDirection);
    254267 
    255   if((safety > tlimitminfix)&&(latDisplasment))
    256     { 
    257 
    258       if(mscatt)
    259         {
    260           if(scrA<DBL_MIN)scrA=DBL_MIN;
    261           if(llambda1<DBL_MIN)llambda1=DBL_MIN;
    262           q1 = 2.*scrA*((1. + scrA)*log(1. + 1./scrA) - 1.);
    263           if(q1<DBL_MIN)q1=DBL_MIN;
    264           Gamma  = 6.*scrA*(1. + scrA)*((1. + 2.*scrA)*log(1. + 1./scrA) - 2.)/q1;
    265           Eta    = atomPerVolume*tPathLength/llambda1;     
    266           delta  = 0.90824829 - Eta*(0.102062073-Gamma*0.026374715);
    267 
    268           nu = G4UniformRand();
    269           nu = std::sqrt(nu);
    270           nu0 = (1.0 - nu)/2.;
    271           nu1 = nu*delta;
    272           nu2 = nu*(1.0-delta);
    273           x_coord=(nu1*sinTheta1*cosPhi1+nu2*sinTheta2*(cosPhi1*cosPhi2-cosTheta1*sinPhi1*sinPhi2)+nu0*us);
    274           y_coord=(nu1*sinTheta1*sinPhi1+nu2*sinTheta2*(sinPhi1*cosPhi2+cosTheta1*cosPhi1*sinPhi2)+nu0*vs);
    275           z_coord=(nu0+nu1*cosTheta1+nu2*cosTheta2+ nu0*ws)  ;
    276         }
    277 
     268  if((safety > tlimitminfix)&&latDisplasment)
     269    {
     270      if(Qn1<0.02)// corresponding to error less than 1% in the exact formula of <z>
     271      z_coord = 1.0 - Qn1*(0.5 - Qn1/6.);
     272      else z_coord = (1.-std::exp(-Qn1))/Qn1;
     273
     274      G4double rr=std::sqrt((1.- z_coord*z_coord)/(1.-ws*ws));
     275      x_coord = rr*us;
     276      y_coord = rr*vs;
    278277      // displacement is computed relatively to the end point
    279       if(!noscatt)z_coord -= 1.0;//for noscatt zcoord z_coord !=0.
    280       G4double rr = sqrt(x_coord*x_coord+y_coord*y_coord+z_coord*z_coord);
     278      z_coord -= 1.0;
     279      rr = std::sqrt(x_coord*x_coord+y_coord*y_coord+z_coord*z_coord);
    281280      G4double r  = rr*zPathLength;
    282281      /*
     
    287286             << G4endl;
    288287      */
     288      if(tPathLength<=zPathLength)return;
    289289      if(r > tlimitminfix) {
    290290
    291         G4ThreeVector latDirection(x_coord/rr,y_coord/rr,z_coord/rr);
    292         latDirection.rotateUz(oldDirection);
    293 
    294         ComputeDisplacement(fParticleChange, latDirection, r, safety);
     291        G4ThreeVector Direction(x_coord/rr,y_coord/rr,z_coord/rr);
     292        Direction.rotateUz(oldDirection);
     293
     294        ComputeDisplacement(fParticleChange, Direction, r, safety);
    295295      }     
    296296    }
     
    303303                                                G4double &cost, G4double &sint)
    304304{
    305   G4double u,Qn1,r1,tet;
    306305  G4double xi=0.;
    307   Qn1=2.* lambdan *scrA*((1.+scrA)*log(1.+1./scrA)-1.);
    308 
    309 if (Qn1<0.001)xi=-0.5*Qn1*log(G4UniformRand());
    310 else if(Qn1>0.5)xi=2.*G4UniformRand();//isotropic distribution
    311 else
    312 {
    313       // procedure described by Benedito in Ref.1
     306 
     307  if (Qn12<0.001) 
     308  {G4double r1,tet;
    314309      do{
    315         r1=G4UniformRand();
    316         u=GSTable->SampleTheta(lambdan,scrA,G4UniformRand());
    317         xi = 2.*u;
    318         tet=acos(1.-xi);
     310        r1=G4UniformRand();
     311        xi=-Qn12*log(G4UniformRand());
     312        tet=acos(1.-xi);
    319313      }while(tet*r1*r1>sin(tet));
    320 }
     314  }
     315  else if(Qn12>0.5)xi=2.*G4UniformRand();
     316  else xi=2.*(GSTable->SampleTheta(lambdan,scrA,G4UniformRand()));
     317
    321318
    322319  if(xi<0.)xi=0.;
    323   if(xi>2.)xi=2.;
     320  else if(xi>2.)xi=2.;
     321
    324322  cost=(1. - xi);
    325323  sint=sqrt(xi*(2.-xi));
     
    333331void
    334332G4GoudsmitSaundersonMscModel::CalculateIntegrals(const G4ParticleDefinition* p,G4double Z,
    335                                                  G4double kinEnergy,G4double &Lam0,
    336                                                  G4double &Lam1)
     333                                                 G4double kinEnergy,G4double &Sig0,
     334                                                 G4double &Sig1)
    337335{
    338   G4double summ00=0.0;
    339   G4double summ10=0.0;
    340336  G4double x1,x2,y1,y2,acoeff,bcoeff;
    341337  G4double kineticE = kinEnergy;
     
    343339  if(kineticE>highKEnergy)kineticE=highKEnergy;
    344340  kineticE /= eV;
    345   G4double logE=log(kineticE);
     341  G4double logE=std::log(kineticE);
    346342 
    347343  G4int  iZ = G4int(Z);
     
    349345
    350346  G4int enerInd=0;
    351   for(G4int i=1;i<106;i++)
     347  for(G4int i=0;i<105;i++)
    352348  {
    353349  if((logE>=ener[i])&&(logE<ener[i+1])){enerInd=i;break;}
     
    364360        acoeff=(y2-y1)/(x2*x2-x1*x1);
    365361        bcoeff=y2-acoeff*x2*x2;
    366         summ00=acoeff*logE*logE+bcoeff;
    367         summ00 =exp(summ00);
     362        Sig0=acoeff*logE*logE+bcoeff;
     363        Sig0 =std::exp(Sig0);
    368364        y1=FTCSE[iZ-1][enerInd];
    369365        y2=FTCSE[iZ-1][enerInd+1];
    370366        acoeff=(y2-y1)/(x2*x2-x1*x1);
    371367        bcoeff=y2-acoeff*x2*x2;
    372         summ10=acoeff*logE*logE+bcoeff;
    373         summ10 =exp(summ10);
     368        Sig1=acoeff*logE*logE+bcoeff;
     369        Sig1=std::exp(Sig1);
    374370      }
    375371    else  //Interpolation of the form y=ax+b
     
    379375        y1=TCSE[iZ-1][104];
    380376        y2=TCSE[iZ-1][105];
    381         summ00=(y2-y1)*(logE-x1)/(x2-x1)+y1;
    382         summ00 =exp(summ00);
     377        Sig0=(y2-y1)*(logE-x1)/(x2-x1)+y1;
     378        Sig0=std::exp(Sig0);
    383379        y1=FTCSE[iZ-1][104];
    384380        y2=FTCSE[iZ-1][105];
    385         summ10=(y2-y1)*(logE-x1)/(x2-x1)+y1;
    386         summ10 =exp(summ10);
     381        Sig1=(y2-y1)*(logE-x1)/(x2-x1)+y1;
     382        Sig1=std::exp(Sig1);
    387383      }
    388384    }
     
    397393        acoeff=(y2-y1)/(x2*x2-x1*x1);
    398394        bcoeff=y2-acoeff*x2*x2;
    399         summ00=acoeff*logE*logE+bcoeff;
    400         summ00 =exp(summ00);
     395        Sig0=acoeff*logE*logE+bcoeff;
     396        Sig0 =std::exp(Sig0);
    401397        y1=FTCSP[iZ-1][enerInd];
    402398        y2=FTCSP[iZ-1][enerInd+1];
    403399        acoeff=(y2-y1)/(x2*x2-x1*x1);
    404400        bcoeff=y2-acoeff*x2*x2;
    405         summ10=acoeff*logE*logE+bcoeff;
    406         summ10 =exp(summ10);
     401        Sig1=acoeff*logE*logE+bcoeff;
     402        Sig1=std::exp(Sig1);
    407403      }
    408404    else
     
    412408        y1=TCSP[iZ-1][104];
    413409        y2=TCSP[iZ-1][105];
    414         summ00=(y2-y1)*(logE-x1)/(x2-x1)+y1;
    415         summ00 =exp(summ00);
     410        Sig0=(y2-y1)*(logE-x1)/(x2-x1)+y1;
     411        Sig0 =std::exp(Sig0);
    416412        y1=FTCSP[iZ-1][104];
    417413        y2=FTCSP[iZ-1][105];
    418         summ10=(y2-y1)*(logE-x1)/(x2-x1)+y1;
    419         summ10 =exp(summ10);
     414        Sig1=(y2-y1)*(logE-x1)/(x2-x1)+y1;
     415        Sig1=std::exp(Sig1);
    420416      }
    421417    }
    422418   
    423   summ00 *=barn;
    424   summ10 *=barn;
    425 
    426   Lam0=1./((1.+1./Z)*summ00);
    427   Lam1=1./((1.+1./Z)*summ10);
    428 
    429 }
    430 
    431 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    432 //t->g->t step transformations taken from Ref.6
     419  Sig0 *= barn;
     420  Sig1 *= barn;
     421
     422}
     423
     424//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     425//t->g->t step transformations taken from Ref.6
    433426
    434427G4double
     
    635628
    636629//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    637 
     630// taken from Ref.6
    638631G4double G4GoudsmitSaundersonMscModel::ComputeGeomPathLength(G4double)
    639632{
     
    688681  if(samplez) {
    689682
    690     const G4double  ztmax = 0.99, onethird = 1./3. ;
     683    const G4double  ztmax = 0.99;
    691684    G4double zt = zmean/tPathLength ;
    692685
     
    694687
    695688      G4double u,cz1;
    696       if(zt >= onethird) {
     689      if(zt >= 0.333333333) {
    697690
    698691        G4double cz = 0.5*(3.*zt-1.)/(1.-zt) ;
     
    719712
    720713//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    721 
     714// taken from Ref.6
    722715G4double
    723716G4GoudsmitSaundersonMscModel::ComputeTrueStepLength(G4double geomStepLength)
  • trunk/source/processes/electromagnetic/standard/src/G4GoudsmitSaundersonTable.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4GoudsmitSaundersonTable.cc,v 1.4 2009/08/28 16:36:52 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4GoudsmitSaundersonTable.cc,v 1.7 2010/05/17 15:11:30 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    3939// Modifications:
    4040// 04.03.2009 V.Ivanchenko cleanup and format according to Geant4 EM style
    41 // 26.08.2009 O.Kadri: avoiding unuseful calculations and optimizing the root finding parameter error's
    42 //                     within SampleTheta method
    43 //
     41// 26.08.2009 O.Kadri: avoiding unuseful calculations and optimizing the root
     42//                     finding parameter error's within SampleTheta method
     43// 08.02.2010 O.Kadri: reduce delared variables; reduce error of finding root
     44//                     in secant method
     45// 26.03.2010 O.Kadri: minimum of used arrays in computation within the dichotomie
     46//                     finding method the error was the lowest value of uvalues
     47// 12.05.2010 O.Kadri: changing of sqrt((b-a)*(b-a)) with fabs(b-a)
     48//
     49
    4450//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    4551 
     
    200206  //Benedito's procedure
    201207  G4double A[11],ThisPDF[320],ThisCPDF[320];
    202   G4double PDF1[320],PDF2[320],PDF3[320],PDF4[320],CPDF1[320],CPDF2[320],CPDF3[320],CPDF4[320];
    203   G4double coeff,Ckj,CkjPlus1,CkPlus1j,CkPlus1jPlus1,aa,b,m,F;
    204   G4int Ind0,Ind1,Ind2,Ind3,KIndex=0,JIndex=0,IIndex=0;
     208  G4double coeff,Ckj,CkjPlus1,CkPlus1j,CkPlus1jPlus1,a,b,m,F;
     209  G4int Ind0,KIndex=0,JIndex=0,IIndex=0;
     210
    205211
    206212  ///////////////////////////////////////////////////////////////////////////
     
    220226  // Calculate Interpolated PDF and CPDF arrays
    221227  Ind0=320*(11*KIndex+JIndex);
    222   Ind1=320*(11*KIndex+JIndex+1);
    223   Ind2=320*(11*(KIndex+1)+JIndex);
    224   Ind3=320*(11*(KIndex+1)+JIndex+1);
    225228  for(G4int i=0 ; i<320 ;i++){
    226     PDF1[i]=PDF[Ind0+i];PDF2[i]=PDF[Ind1+i];   
    227     PDF3[i]=PDF[Ind2+i];PDF4[i]=PDF[Ind3+i];   
    228     CPDF1[i]=CPDF[Ind0+i];CPDF2[i]=CPDF[Ind1+i];   
    229     CPDF3[i]=CPDF[Ind2+i];CPDF4[i]=CPDF[Ind3+i]; 
    230     ThisPDF[i]=Ckj*PDF1[i]+CkjPlus1*PDF2[i]+CkPlus1j*PDF3[i]+CkPlus1jPlus1*PDF4[i];
    231     ThisCPDF[i]=Ckj*CPDF1[i]+CkjPlus1*CPDF2[i]+CkPlus1j*CPDF3[i]+CkPlus1jPlus1*CPDF4[i]; 
     229    ThisPDF[i]=Ckj*PDF[Ind0]+CkjPlus1*PDF[Ind0+320]+CkPlus1j*PDF[Ind0+3520]+CkPlus1jPlus1*PDF[Ind0+3840];
     230    ThisCPDF[i]=Ckj*CPDF[Ind0]+CkjPlus1*CPDF[Ind0+320]+CkPlus1j*CPDF[Ind0+3520]+CkPlus1jPlus1*CPDF[Ind0+3840]; 
    232231  // Find u Index using secant method
    233   if((i!=0)&&((rndm>=ThisCPDF[i-1])&&(rndm<ThisCPDF[i])))  {IIndex=i-1;break;}
     232    if((i!=0)&&((rndm>=ThisCPDF[i-1])&&(rndm<ThisCPDF[i])))  {IIndex=i-1;break;}
     233    Ind0++;
    234234  }
    235235
    236236  ///////////////////////////////////////////////////////////////////////////
    237237  //CPDF^-1(rndm)=x ==> CPDF(x)=rndm;
    238   aa=uvalues[IIndex];
     238  a=uvalues[IIndex];
    239239  b=uvalues[IIndex+1];
    240240 
    241241  do{
    242     m=0.5*(aa+b);
     242    m=0.5*(a+b);
    243243    F=(ThisCPDF[IIndex]+(m-uvalues[IIndex])*ThisPDF[IIndex]
    244244       +((m-uvalues[IIndex])*(m-uvalues[IIndex])*(ThisPDF[IIndex+1]-ThisPDF[IIndex]))
    245245       /(2.*(uvalues[IIndex+1]-uvalues[IIndex])))-rndm;
    246246    if(F>0.)b=m;
    247     else aa=m;
    248   } while(sqrt((b-aa)*(b-aa))>1.0e-6);
     247    else a=m;
     248  } while(fabs(b-a)>1.0e-9);
    249249
    250250  return m;
  • trunk/source/processes/electromagnetic/standard/src/G4MollerBhabhaModel.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4MollerBhabhaModel.cc,v 1.35 2009/11/09 19:16:13 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4MollerBhabhaModel.cc,v 1.38 2010/04/06 17:10:16 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    9292
    9393G4double G4MollerBhabhaModel::MinEnergyCut(const G4ParticleDefinition*,
    94                                            const G4MaterialCutsCouple* couple)
    95 {
    96   G4double electronDensity = couple->GetMaterial()->GetElectronDensity();
    97   G4double Zeff  = electronDensity/couple->GetMaterial()->GetTotNbOfAtomsPerVolume();
    98   return 0.25*sqrt(Zeff)*keV;
     94                                           const G4MaterialCutsCouple* /*couple*/)
     95{
     96  //  G4double electronDensity = couple->GetMaterial()->GetElectronDensity();
     97  //G4double Zeff  = electronDensity/couple->GetMaterial()->GetTotNbOfAtomsPerVolume();
     98  //return 0.25*sqrt(Zeff)*keV;
     99  //return couple->GetMaterial()->GetIonisation()->GetMeanExcitationEnergy();
     100  return 0.1*keV;
    99101}
    100102
  • trunk/source/processes/electromagnetic/standard/src/G4PAIModel.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PAIModel.cc,v 1.51 2009/08/12 21:28:50 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4PAIModel.cc,v 1.52 2010/06/03 07:28:39 grichine Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    3232// File name:     G4PAIModel.cc
    3333//
    34 // Author: Vladimir.Grichine@cern.ch on base of Vladimir Ivanchenko code
     34// Author: Vladimir.Grichine@cern.ch on base of Vladimir Ivanchenko model interface
    3535//
    3636// Creation date: 05.10.2003
     
    148148                            const G4DataVector&)
    149149{
     150  G4cout<<"G4PAIModel::Initialise for "<<p->GetParticleName()<<G4endl;
    150151  if(isInitialised) return;
    151152  isInitialised = true;
  • trunk/source/processes/electromagnetic/standard/src/G4PAIPhotonModel.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PAIPhotonModel.cc,v 1.23 2009/07/26 15:51:01 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4PAIPhotonModel.cc,v 1.24 2010/06/03 07:28:39 grichine Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    161161                                   const G4DataVector&)
    162162{
     163  G4cout<<"G4PAIPhotonModel::Initialise for "<<p->GetParticleName()<<G4endl;
    163164  if(isInitialised) return;
    164165  isInitialised = true;
  • trunk/source/processes/electromagnetic/standard/src/G4PSTARStopping.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PSTARStopping.cc,v 1.8 2008/11/24 18:28:09 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4PSTARStopping.cc,v 1.14 2010/04/26 17:40:34 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929//---------------------------------------------------------------------------
     
    3939// Contract:            CSMAN-5288
    4040//
    41 // Modifications:
     41// Modifications: 
     42// 25.04.2010 V.Ivanchenko introduce G4LPhysicsFreeVector
     43// 26.04.2010 A.Ivanchenko fixed data for G4_PROPANE and G4_Pt,
     44//                         checked all data
    4245//
    4346//----------------------------------------------------------------------------
     
    5356G4PSTARStopping::G4PSTARStopping()
    5457{
    55   currentE = 0.0;
    5658  currentMaterial = 0;
    57   index = 0;
    5859  matIndex = -1;
     60
     61  name.resize(74,"");
     62  sdata.resize(74,0);
     63
    5964  Initialise();
    6065}
     
    6368
    6469G4PSTARStopping::~G4PSTARStopping()
    65 {}
     70{
     71  for(size_t i=0; i<74; ++i) { delete sdata[i]; }
     72}
    6673
    6774//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    7178  if (mat == currentMaterial) return matIndex;
    7279  G4String matName = mat->GetName();
    73   for (G4int i=0; i<74; i++){
     80  for (G4int i=0; i<74; ++i){
    7481    if (matName == name[i]){
    7582      matIndex = i;
     
    8592G4double G4PSTARStopping::GetElectronicDEDX(G4int i, G4double energy)
    8693{
    87   if (matIndex == i && energy == currentE) return res;       
    88 
     94  G4double res = 0.0;
    8995  if (i<0 || i>73){
    9096    G4cout << "### G4PSTARStopping WARNING: index "
    9197           << i << " is out of range!" << G4endl;
    92     res = 0.0;
    9398    return res;
    9499  }
    95   matIndex = i;
    96   currentE = energy;
    97 
    98   if (energy < kinE[index] || energy > kinE[index+1]){
    99 
    100     if (energy <= kinE[0]) {
    101       index = 0;
    102       res = e[matIndex][0]*std::sqrt(energy/kinE[0]);
    103       return res;
    104     } else if (energy >= kinE[59]) {
    105       index = 58;
    106       res = e[matIndex][59];
    107       return res;
    108     }
    109     for (index = 0; index<59; index++){if (energy <= kinE[index+1]) break;}
    110   }
    111 
    112   G4double t1 = kinE[index];
    113   G4double t2 = kinE[index+1];
    114   G4double e1 = e[matIndex][index];
    115   G4double e2 = e[matIndex][index+1];
    116   res = e1*std::exp(std::log(energy/t1)*std::log(e2/e1)/std::log(t2/t1));
     100  if(energy < emin) { res = (*(sdata[i]))[0]*std::sqrt(energy/emin); }
     101  else              { res = sdata[i]->Value(energy); }
    117102  return res;
    118103}
     
    120105void G4PSTARStopping::Initialise()
    121106{
    122   G4int i;
    123  
    124107  name [0] = "G4_A-150_TISSUE";
    125108  G4double T0[60] = {
     
    129112    0.085, 0.09,   0.095, 0.1,    0.125, 0.15,  0.175,   0.2, 0.225, 0.25,
    130113    0.275, 0.3,    0.35,  0.4,    0.45,  0.5,    0.55,   0.6, 0.65,  0.7,
    131     0.75,  0.8,    0.85,  0.9,    0.95,  1.,     1.25,   1.5, 1.75,  2. };
     114    0.75,  0.8,    0.85,  0.9,    0.95,  1.,     1.25,   1.5, 1.75,  2. };
     115  emin = T0[0]*MeV;
     116 
    132117  G4double e0[60] = { 176.8, 216.6, 250.1, 279.6, 306.3, 351.1, 390.9, 426.8, 459.8, 489.9, 517.8, 544, 596.4, 641.3, 680.6, 715.7, 747, 775, 800, 822.6, 861.7, 894.2, 920.7, 941.5, 957.3, 968.6, 976.2, 980.5, 982, 981, 978, 973.2, 967, 959.5, 910.4, 853.6, 797.9, 746.9, 701.5, 661.5, 626.4, 595.6, 544.8, 504.4, 471.1, 442.8, 416.4, 392, 369.9, 350, 332.2, 316.4, 302.2, 289.5, 278.1, 267.9, 228.9, 200.8, 179.5, 162.6 };
    133118 
    134   for(i=0; i<60; i++) {e[0][i]=e0[i]*MeV*cm2/g;}
    135   for(i=0; i<60; i++) {kinE[i]=T0[i]*MeV;}
     119  AddData(T0, e0, 0);
    136120 
    137121  name [1] = "G4_ACETYLENE";
    138122  G4double e1[60] = { 185.5, 227.2, 262.3, 293.2, 321.2, 364.8, 404, 439.3, 471.6, 500.3, 526.4, 550.6, 600.2, 641.6, 677.4, 709.2, 737.3, 762, 783.7, 803.1, 837.2, 866.8, 891.7, 911.6, 926.6, 937.4, 944.7, 949, 950.8, 950.3, 947.9, 943.9, 938.4, 931.8, 887.1, 833.7, 779.9, 729.5, 686.8, 650.4, 618.5, 590.2, 541.4, 500.4, 465.3, 434.8, 408, 384.6, 364.4, 346.5, 330.5, 316.1, 303.2, 291.3, 280.4, 270.4, 230.7, 202.2, 180.5, 163.5 };
    139123 
    140   for(i=0; i<60; i++) {e[1][i]=e1[i]*MeV*cm2/g;}
     124  AddData(T0, e1, 1);
    141125 
    142126  name [2] = "G4_ADIPOSE_TISSUE_ICRP";
    143127  G4double e2[60] = { 195.9, 239.9, 277, 309.7, 339.3, 387.5, 430.6, 469.4, 505, 537.2, 566.9, 594.6, 649.9, 696.7, 737.4, 773.3, 805.2, 833.4, 858.3, 880.5, 918.9, 951, 977.2, 997.6, 1013, 1023, 1030, 1034, 1034, 1033, 1029, 1023, 1016, 1008, 955.6, 895, 835.1, 779.6, 729.7, 685.6, 646.6, 612.3, 555, 509.1, 471.6, 440.3, 413.7, 390.4, 370.1, 352.1, 336, 321.4, 308.3, 296.3, 285.3, 275.2, 234.9, 206, 184, 166.7 };
    144128 
    145   for(i=0; i<60; i++) {e[2][i]=e2[i]*MeV*cm2/g;}
     129  AddData(T0, e2, 2);
    146130 
    147131  name [3] = "G4_Ag";
    148132  G4double e3[60] = { 29.73, 36.41, 42.05, 47.01, 51.5, 59.46, 66.48, 72.83, 78.66, 84.09, 89.2, 94.02, 103.7, 112.1, 119.7, 126.6, 132.8, 138.5, 143.7, 148.5, 157.1, 164.3, 170.5, 175.7, 180.1, 183.7, 186.7, 189.1, 191.1, 192.5, 193.6, 194.4, 194.8, 195, 193.4, 189.3, 184.4, 179.2, 174.1, 169.3, 164.8, 160.5, 152.7, 145.7, 139.5, 133.8, 128.6, 123.9, 119.5, 115.4, 111.7, 108.1, 104.8, 101.7, 98.74, 95.98, 84.49, 75.92, 69.3, 64.05 };
    149133 
    150   for(i=0; i<60; i++) {e[3][i]=e3[i]*MeV*cm2/g;}
     134  AddData(T0, e3, 3);
    151135 
    152136  name [4] = "G4_AIR";
    153137  G4double e4[60] = { 119.7, 146.7, 169.3, 189.3, 207.4, 239.5, 267.8, 293.3, 316.8, 338.7, 359.2, 378.7, 417, 450.4, 480.1, 506.7, 530.7, 552.6, 572.4, 590.5, 622.1, 648.3, 670, 687.7, 702, 713.2, 721.7, 727.8, 731.9, 734.1, 734.8, 734, 732, 729, 702.9, 667.2, 629.1, 592.2, 558.3, 527.8, 500.6, 476.3, 434.9, 401.2, 373.3, 349.8, 329.7, 312.1, 296.4, 282.4, 269.9, 258.7, 248.5, 239.1, 230.6, 222.7, 191.1, 168.2, 150.8, 137 };
    154138 
    155   for(i=0; i<60; i++) {e[4][i]=e4[i]*MeV*cm2/g;}
     139  AddData(T0, e4, 4);
    156140 
    157141  name [5] = "G4_Al";
    158142  G4double e5[60] = { 92.38, 113.1, 130.6, 146.1, 160, 184.8, 206.6, 226.3, 244.4, 261.3, 277.1, 292.1, 320.6, 344.8, 365.7, 383.8, 399.6, 413.2, 425, 435.1, 451, 462, 469.2, 473.4, 475.2, 475.1, 473.7, 471.2, 468, 464.2, 460.1, 455.8, 451.3, 446.8, 424.5, 404.5, 386.7, 371, 356.8, 344, 332.3, 321.5, 301.7, 284.2, 268.6, 254.8, 242.5, 231.4, 221.5, 212.4, 204.2, 196.6, 189.7, 183.3, 177.4, 171.9, 149.4, 132.7, 119.8, 109.4 };
    159143 
    160   for(i=0; i<60; i++) {e[5][i]=e5[i]*MeV*cm2/g;}
     144  AddData(T0, e5, 5);
    161145 
    162146  name [6] = "G4_ALUMINUM_OXIDE";
    163147  G4double e6[60] = { 73.51, 90.03, 104, 116.2, 127.3, 147, 164.4, 180.1, 194.5, 207.9, 220.5, 232.5, 256.1, 276.8, 295.3, 311.9, 327, 340.8, 353.4, 364.9, 385.3, 402.5, 417, 429.2, 439.3, 447.6, 454.3, 459.6, 463.7, 466.6, 468.6, 469.8, 470.2, 470, 461.9, 447.2, 430.1, 412.7, 396.5, 381.4, 367.5, 354.5, 331.1, 310.6, 292.6, 276.5, 262.2, 249.4, 238.1, 227.9, 218.7, 210.2, 202.6, 195.7, 189.2, 183.2, 158.9, 140.9, 127, 116 };
    164148 
    165   for(i=0; i<60; i++) {e[6][i]=e6[i]*MeV*cm2/g;}
     149  AddData(T0, e6, 6);
    166150 
    167151  name [7] = "G4_Ar";
    168152  G4double e7[60] = { 86.08, 105.4, 121.7, 136.1, 149.1, 172.2, 192.5, 210.9, 227.7, 243.5, 258.2, 272.2, 299.7, 323.5, 344.5, 363.3, 380.2, 395.3, 409, 421.4, 442.5, 459.4, 472.8, 483.1, 490.7, 496, 499.2, 500.7, 500.8, 499.5, 497.2, 494, 490, 485.5, 457.4, 426.7, 397.7, 371.9, 349.5, 330.1, 313.2, 298.5, 274.2, 254.9, 239, 225.6, 214.4, 204.7, 196.1, 188.4, 181.3, 174.9, 168.9, 163.4, 158.2, 153.3, 133, 118.2, 106.8, 97.72 };
    169153 
    170   for(i=0; i<60; i++) {e[7][i]=e7[i]*MeV*cm2/g;}
     154  AddData(T0, e7, 7);
    171155 
    172156  name [8] = "G4_Au";
    173157  G4double e8[60] = { 14.76, 18.07, 20.87, 23.33, 25.56, 29.51, 33, 36.15, 39.04, 41.74, 44.27, 46.66, 51.51, 55.8, 59.66, 63.18, 66.43, 69.43, 72.23, 74.84, 79.58, 83.77, 87.5, 90.81, 93.77, 96.4, 98.74, 100.8, 102.6, 104.3, 105.7, 106.9, 108, 108.9, 111.5, 112, 111.2, 109.6, 107.6, 105.4, 103.2, 101, 96.33, 91.8, 87.7, 84.05, 80.83, 78, 75.47, 73.18, 71.11, 69.21, 67.46, 65.83, 64.32, 62.91, 56.98, 52.39, 48.68, 45.58 };
    174158 
    175   for(i=0; i<60; i++) {e[8][i]=e8[i]*MeV*cm2/g;}
     159  AddData(T0, e8, 8);
    176160 
    177161  name [9] = "G4_B-100_BONE";
    178162  G4double e9[60] = { 142.5, 174.5, 201.5, 225.2, 246.7, 283.1, 315.3, 344.4, 371.1, 395.5, 418.2, 439.6, 482.3, 519, 551.3, 580.1, 606, 629.2, 650.1, 669, 701.9, 729.5, 752.2, 770.4, 784.5, 795.1, 802.6, 807.4, 810, 810.5, 809.3, 806.6, 802.7, 797.7, 762.5, 719.5, 676.2, 635.8, 599.3, 566.7, 537.9, 512.3, 468.1, 431.4, 400.8, 375, 353, 333.7, 316.9, 301.9, 288.5, 276.3, 265.3, 255.1, 245.9, 237.4, 203.4, 178.9, 160.2, 145.4 };
    179163 
    180   for(i=0; i<60; i++) {e[9][i]=e9[i]*MeV*cm2/g;}
     164  AddData(T0, e9, 9);
    181165 
    182166  name [10] = "G4_Be";
    183167  G4double e10[60] = { 149.7, 183.3, 211.7, 236.7, 259.2, 299.3, 334.7, 366.6, 396, 423.3, 449, 473.3, 517.2, 553.4, 583.6, 608.7, 629.6, 646.8, 660.7, 671.9, 687.3, 695.5, 698.4, 697.6, 694.2, 689.1, 682.8, 675.7, 668.2, 660.5, 652.7, 644.9, 637.2, 629.6, 594.2, 563, 535.4, 510.7, 488.4, 468.2, 449.8, 432.8, 404.4, 380.1, 358.1, 337.6, 318.8, 302.2, 287.4, 274.2, 262.3, 251.5, 241.7, 232.7, 224.4, 216.8, 186, 163.6, 146.3, 132.6 };
    184168 
    185   for(i=0; i<60; i++) {e[10][i]=e10[i]*MeV*cm2/g;}
     169  AddData(T0, e10, 10);
    186170 
    187171  name [11] = "G4_BONE_COMPACT_ICRU";
    188172  G4double e11[60] = { 141.6, 173.4, 200.2, 223.8, 245.2, 281.3, 313.3, 342.2, 368.8, 393.1, 415.6, 436.8, 479, 515.2, 547, 575.3, 600.7, 623.4, 643.8, 662.1, 694.2, 721, 743.2, 760.9, 774.8, 785.2, 792.6, 797.6, 800.3, 801.1, 800.3, 797.9, 794.4, 789.9, 756.4, 714.5, 671.4, 630.5, 593.2, 559.7, 530, 503.5, 459, 423, 393.3, 368.3, 346.9, 328.1, 311.6, 296.9, 283.7, 271.8, 261, 251.1, 242, 233.7, 200.3, 176.3, 158, 143.5 };
    189173 
    190   for(i=0; i<60; i++) {e[11][i]=e11[i]*MeV*cm2/g;}
     174  AddData(T0, e11, 11);
    191175 
    192176  name [12] = "G4_C";
    193177  G4double e12[60] = { 138.4, 169.5, 195.7, 218.8, 239.7, 270.2, 297.8, 322.7, 345.4, 365.1, 382.6, 398.7, 433.5, 462.4, 487.4, 509.9, 530, 547.7, 563.4, 577.6, 603.9, 628.3, 650.1, 668.6, 683.5, 695.3, 704.5, 711.4, 716.3, 719.4, 720.8, 720.9, 719.7, 717.4, 694.5, 661.1, 624.7, 589.1, 556, 526, 499.1, 475, 435.8, 404.4, 377.9, 354.6, 334, 315.9, 300.2, 286.2, 273.7, 262.4, 252.2, 242.7, 234.1, 226.1, 194.2, 171.1, 153.4, 139.4 };
    194178 
    195   for(i=0; i<60; i++) {e[12][i]=e12[i]*MeV*cm2/g;}
    196  
    197   name [13] = "G4_GRAPHITE";
     179  AddData(T0, e12, 12);
     180 
     181  name [13] = "G4_GRAPHITE_POROUS";
    198182  G4double e13[60] = { 142.6, 175.3, 203.1, 228, 250.5, 283.4, 313.3, 340.4, 365.1, 386.7, 405.9, 423.5, 462, 494, 521.9, 546.9, 569.3, 589.2, 606.9, 622.9, 652.4, 679.9, 704.5, 725.3, 742.2, 755.6, 766.1, 774, 779.6, 783.1, 784.7, 784.8, 783.4, 780.7, 753.8, 714.5, 671.4, 629.1, 590.2, 555.6, 524.9, 497.7, 453.9, 419.3, 390.3, 365.1, 343, 323.7, 307.1, 292.3, 279.1, 267.3, 256.6, 246.8, 237.8, 229.5, 196.7, 173, 155, 140.8 };
    199183 
    200   for(i=0; i<60; i++) {e[13][i]=e13[i]*MeV*cm2/g;}
     184  AddData(T0, e13, 13);
    201185 
    202186  name [14] = "G4_ETHYLENE";
    203187  G4double e14[60] = { 225.8, 276.5, 319.3, 357, 391.1, 445.9, 494.9, 539.1, 579.6, 616, 649.5, 680.6, 742.9, 795.1, 840.1, 879.9, 914.8, 945.5, 972.4, 996.1, 1037, 1071, 1099, 1120, 1135, 1145, 1150, 1152, 1152, 1148, 1142, 1135, 1126, 1115, 1052, 981.5, 912.8, 849.7, 795.6, 749, 708.3, 672.4, 611.7, 562.1, 520.6, 485.3, 454.9, 428.4, 405.5, 385.2, 367.1, 350.8, 336.2, 322.8, 310.5, 299.3, 254.6, 222.7, 198.6, 179.6 };
    204188 
    205   for(i=0; i<60; i++) {e[14][i]=e14[i]*MeV*cm2/g;}
     189  AddData(T0, e14, 14);
    206190 
    207191  name [15] = "G4_C-552";
    208192  G4double e15[60] = { 119.2, 146, 168.6, 188.5, 206.5, 235.1, 260.7, 283.8, 305, 323.9, 341.3, 357.4, 390.7, 418.9, 443.7, 465.8, 485.7, 503.6, 519.5, 534.1, 560.1, 583.2, 603.2, 620, 633.7, 644.7, 653.4, 660.1, 665, 668.4, 670.3, 671.1, 670.7, 669.5, 652.9, 626.4, 596.2, 565.7, 537, 510.7, 486.8, 465.1, 427.5, 396.1, 369.6, 347, 327.4, 310.1, 294.9, 281.3, 269, 258, 247.9, 238.6, 230.2, 222.4, 191, 168.2, 150.8, 137 };
    209193 
    210   for(i=0; i<60; i++) {e[15][i]=e15[i]*MeV*cm2/g;}
     194  AddData(T0, e15, 15);
    211195 
    212196  name [16] = "G4_CARBON_DIOXIDE";
    213197  G4double e16[60] = { 106.4, 130.3, 150.4, 168.2, 184.2, 212.7, 237.9, 260.6, 281.4, 300.9, 319.1, 336.4, 370.9, 401.2, 428.3, 452.8, 475.1, 495.6, 514.4, 531.8, 562.6, 588.8, 611.2, 630.2, 646.1, 659.3, 670.1, 678.6, 685.2, 690, 693.2, 694.9, 695.4, 694.8, 679, 650.5, 617.3, 583.6, 552.1, 523.6, 497.8, 474.6, 434.7, 401.8, 374.3, 351, 330.9, 313.2, 297.6, 283.7, 271.2, 259.9, 249.6, 240.3, 231.7, 223.7, 191.9, 168.9, 151.4, 137.5 };
    214198 
    215   for(i=0; i<60; i++) {e[16][i]=e16[i]*MeV*cm2/g;}
     199  AddData(T0, e16, 16);
    216200 
    217201  name [17] = "G4_CALCIUM_FLUORIDE";
    218202  G4double e17[60] = { 74.48, 91.21, 105.3, 117.8, 129, 149, 166.5, 182.4, 197, 210.6, 223.4, 235.5, 259.6, 280.7, 299.6, 316.6, 332, 346.2, 359.1, 371.1, 392.2, 410.1, 425.2, 438, 448.7, 457.5, 464.6, 470.3, 474.7, 477.9, 480.1, 481.4, 481.9, 481.7, 473, 456.7, 437.6, 417.8, 398.6, 380.6, 364, 348.7, 322.9, 301.7, 283.5, 267.5, 253.4, 240.9, 229.8, 219.9, 210.8, 202.5, 194.8, 187.7, 181.3, 175.5, 151.6, 134.4, 121.1, 110.6 };
    219203 
    220   for(i=0; i<60; i++) {e[17][i]=e17[i]*MeV*cm2/g;}
     204  AddData(T0, e17, 17);
    221205 
    222206  name [18] = "G4_CERIC_SULFATE";
    223207  G4double e18[60] = { 135.4, 165.8, 191.5, 214.1, 234.5, 270.8, 302.8, 331.7, 358.2, 383, 406.2, 428.2, 471.7, 509.8, 543.6, 574, 601.5, 626.5, 649.3, 670.1, 706.4, 736.5, 761.2, 781.4, 797.4, 809.8, 819, 825.3, 829.2, 830.8, 830.6, 828.7, 825.4, 820.9, 785.9, 741.4, 696, 653.6, 618.4, 588.8, 562.8, 539.6, 499.3, 464.8, 434.6, 407.9, 384.2, 363.4, 344.9, 328.4, 313.6, 300.3, 288.2, 277.2, 267, 257.7, 220.4, 193.5, 173, 156.9 };
    224208 
    225   for(i=0; i<60; i++) {e[18][i]=e18[i]*MeV*cm2/g;}
     209  AddData(T0, e18, 18);
    226210 
    227211  name [19] = "G4_CELLULOSE_NITRATE";
    228212  G4double e19[60] = { 132.2, 161.9, 187, 209, 229, 262.6, 292.5, 319.4, 344.2, 366.8, 387.8, 407.5, 447, 481, 510.8, 537.6, 561.6, 583.2, 602.7, 620.4, 651.5, 677.9, 700, 718.2, 732.7, 744.1, 752.7, 759, 763.2, 765.5, 766.2, 765.5, 763.5, 760.6, 734.4, 698.2, 659.3, 621.4, 586, 553.8, 524.9, 498.9, 452.4, 413.9, 382.9, 358, 337.7, 319.7, 303.9, 289.7, 277.1, 265.6, 255.2, 245.6, 236.9, 228.8, 196.4, 173, 155, 140.8 };
    229213 
    230   for(i=0; i<60; i++) {e[19][i]=e19[i]*MeV*cm2/g;}
     214  AddData(T0, e19, 19);
    231215 
    232216  name [20] = "G4_BONE_CORTICAL_ICRP";
    233217  G4double e20[60] = { 123.5, 151.3, 174.7, 195.3, 214, 246.1, 274.5, 300.2, 323.8, 345.6, 365.9, 385, 423, 455.7, 484.7, 510.5, 533.8, 554.8, 573.7, 590.9, 620.8, 645.9, 666.5, 683.3, 696.6, 706.8, 714.4, 719.7, 723, 724.5, 724.5, 723.1, 720.6, 717.1, 689.6, 653.5, 615.8, 579.8, 546.6, 516.7, 490, 466.2, 426.1, 393.6, 366.6, 343.7, 324, 306.7, 291.5, 278, 265.8, 254.7, 244.7, 235.5, 227.1, 219.4, 188.4, 166.1, 149, 135.4 };
    234218 
    235   for(i=0; i<60; i++) {e[20][i]=e20[i]*MeV*cm2/g;}
     219  AddData(T0, e20, 20);
    236220 
    237221  name [21] = "G4_CESIUM_IODIDE";
    238222  G4double e21[60] = { 34.67, 42.46, 49.03, 54.82, 60.05, 69.34, 77.52, 84.92, 91.73, 98.06, 104, 109.6, 121, 130.9, 139.9, 148, 155.5, 162.3, 168.6, 174.5, 184.9, 194, 201.8, 208.5, 214.2, 219, 223, 226.3, 228.9, 231, 232.5, 233.4, 234, 234.1, 230.4, 221.9, 211.4, 200.6, 190.1, 180.6, 171.9, 164.1, 151.1, 140.6, 132.1, 125.1, 119.1, 114, 109.6, 105.6, 102.1, 98.92, 95.83, 92.83, 89.95, 87.22, 75.76, 67.41, 61.26, 56.63 };
    239223 
    240   for(i=0; i<60; i++) {e[21][i]=e21[i]*MeV*cm2/g;}
     224  AddData(T0, e21, 21);
    241225 
    242226  name [22] = "G4_Cu";
    243227  G4double e22[60] = { 34.9, 42.74, 49.35, 55.18, 60.45, 69.8, 78.04, 85.48, 92.33, 98.71, 104.7, 110.4, 121.4, 130.9, 139.2, 146.6, 153.2, 159, 164.3, 168.9, 176.9, 183.2, 188.4, 192.5, 195.9, 198.7, 201, 202.8, 204.4, 205.6, 206.7, 207.5, 208.2, 208.7, 209.9, 209.2, 207.5, 205.1, 202.3, 199.1, 195.8, 192.3, 185.4, 178.6, 172, 165.8, 159.6, 153.6, 148, 142.7, 137.8, 133.3, 129.1, 125.2, 121.7, 118.3, 104.7, 94.43, 86.45, 79.87 };
    244228 
    245   for(i=0; i<60; i++) {e[22][i]=e22[i]*MeV*cm2/g;}
     229  AddData(T0, e22, 22);
    246230 
    247231  name [23] = "G4_Fe";
    248232  G4double e23[60] = { 37.81, 46.31, 53.47, 59.78, 65.49, 75.62, 84.54, 92.61, 100, 106.9, 113.4, 119.6, 132, 143, 153, 162, 170.4, 178.2, 185.4, 192.2, 204.6, 215.6, 225.4, 234.2, 242.1, 249.2, 255.5, 261.2, 266.2, 270.7, 274.6, 278.1, 281, 283.6, 290.9, 291.5, 287.6, 281, 272.8, 263.9, 254.9, 246, 229.5, 214.8, 202.1, 191.1, 181.6, 173.4, 166.2, 159.7, 153.8, 148.5, 143.6, 139.1, 135, 131.1, 115.3, 103.5, 94.02, 86.52 };
    249233 
    250   for(i=0; i<60; i++) {e[23][i]=e23[i]*MeV*cm2/g;}
     234  AddData(T0, e23, 23);
    251235 
    252236  name [24] = "G4_FERROUS_SULFATE";
    253237  G4double e24[60] = { 135.1, 165.5, 191.1, 213.6, 234, 270.2, 302.1, 330.9, 357.4, 382.1, 405.3, 427.2, 470.7, 508.7, 542.4, 572.8, 600.3, 625.3, 648, 668.8, 705, 735.1, 759.9, 780.1, 796.1, 808.5, 817.7, 824.1, 827.9, 829.6, 829.4, 827.5, 824.2, 819.7, 784.9, 740.5, 695.1, 652.8, 617.8, 588.4, 562.8, 539.9, 499.9, 465.6, 435.5, 408.8, 385, 364.1, 345.6, 329.1, 314.3, 300.9, 288.8, 277.7, 267.6, 258.3, 220.8, 193.9, 173.4, 157.2 };
    254238 
    255   for(i=0; i<60; i++) {e[24][i]=e24[i]*MeV*cm2/g;}
     239  AddData(T0, e24, 24);
    256240 
    257241  name [25] = "G4_Gd";
    258242  G4double e25[60] = { 25.71, 31.49, 36.37, 40.66, 44.54, 51.43, 57.5, 62.99, 68.03, 72.73, 77.14, 81.32, 89.78, 97.24, 104, 110.1, 115.8, 121, 125.8, 130.4, 138.5, 145.7, 152.1, 157.7, 162.6, 166.9, 170.7, 173.9, 176.7, 179, 181, 182.5, 183.8, 184.7, 185.6, 182.1, 176.3, 169.4, 162.2, 155.2, 148.7, 142.6, 132, 123.3, 116.2, 110.2, 105, 100.6, 96.67, 93.2, 90.08, 87.27, 84.72, 82.38, 80.24, 78.26, 70.14, 63.87, 58.87, 54.76 };
    259243 
    260   for(i=0; i<60; i++) {e[25][i]=e25[i]*MeV*cm2/g;}
     244  AddData(T0, e25, 25);
    261245 
    262246  name [26] = "G4_Ge";
    263247  G4double e26[60] = { 45.91, 56.23, 64.93, 72.59, 79.52, 91.82, 102.7, 112.5, 121.5, 129.9, 137.7, 145.2, 159.7, 172.3, 183.3, 193.1, 201.7, 209.4, 216.3, 222.3, 232.3, 240, 245.6, 249.6, 252.3, 253.9, 254.5, 254.5, 253.9, 252.9, 251.5, 250, 248.2, 246.4, 236.5, 227.2, 218.9, 211.6, 205.1, 199.3, 193.9, 189, 180.1, 172.3, 165.2, 158.8, 152.6, 146.6, 140.9, 135.7, 130.8, 126.3, 122.1, 118.3, 114.7, 111.3, 97.72, 87.77, 80.18, 74.18 };
    264248 
    265   for(i=0; i<60; i++) {e[26][i]=e26[i]*MeV*cm2/g;}
     249  AddData(T0, e26, 26);
    266250 
    267251  name [27] = "G4_Pyrex_Glass";
    268252  G4double e27[60] = { 88.74, 108.7, 125.5, 140.3, 153.7, 177.5, 198.4, 217.4, 234.8, 251, 266.2, 280.6, 308.9, 333.6, 355.6, 375.3, 393.1, 409.2, 423.9, 437.3, 460.8, 480.4, 496.7, 510.2, 521.2, 530.1, 537.1, 542.5, 546.4, 549.1, 550.6, 551.2, 551, 550.1, 537.6, 518.1, 496.1, 473.9, 451.2, 429.2, 408.8, 390.1, 357.9, 331.5, 309.8, 291.7, 276.2, 262.4, 250.1, 239.1, 229.2, 220.2, 212, 204.6, 197.7, 191.4, 165.6, 146.7, 132.1, 120.4 };
    269253 
    270   for(i=0; i<60; i++) {e[27][i]=e27[i]*MeV*cm2/g;}
     254  AddData(T0, e27, 27);
    271255 
    272256  name [28] = "G4_H";
    273257  G4double e28[60] = { 746.5, 914.3, 1056, 1180, 1293, 1493, 1669, 1829, 1975, 2112, 2240, 2361, 2586, 2777, 2942, 3084, 3208, 3316, 3409, 3490, 3618, 3710, 3771, 3808, 3823, 3822, 3807, 3781, 3745, 3702, 3654, 3601, 3545, 3487, 3183, 2890, 2629, 2402, 2204, 2031, 1882, 1753, 1544, 1384, 1258, 1159, 1077, 1007, 947, 894.2, 847.5, 805.9, 768.6, 734.9, 704.3, 676.4, 566.7, 489.7, 432.5, 388.1 };
    274258 
    275   for(i=0; i<60; i++) {e[28][i]=e28[i]*MeV*cm2/g;}
     259  AddData(T0, e28, 28);
    276260 
    277261  name [29] = "G4_He";
    278262  G4double e29[60] = { 184.2, 225.6, 260.6, 291.3, 319.1, 368.5, 412, 451.3, 487.4, 521.1, 552.7, 582.6, 641.3, 691.9, 736.7, 776.6, 812.5, 844.9, 874.2, 900.8, 946.6, 984.1, 1014, 1039, 1058, 1072, 1083, 1089, 1093, 1094, 1093, 1090, 1085, 1079, 1032, 973, 911.2, 852.1, 797.5, 748.3, 704.5, 665.8, 600.4, 547.7, 504.5, 468.3, 437.7, 411.3, 388.2, 368, 349.9, 333.8, 319.3, 306.2, 294.2, 283.2, 239.6, 208.6, 185.2, 167 };
    279263 
    280   for(i=0; i<60; i++) {e[29][i]=e29[i]*MeV*cm2/g;}
     264  AddData(T0, e29, 29);
    281265 
    282266  name [30] = "G4_KAPTON";
    283267  G4double e30[60] = { 145.4, 178.1, 205.6, 229.9, 251.8, 286.2, 317.1, 344.9, 370.4, 393.1, 413.7, 432.9, 472.6, 506.1, 535.2, 561.3, 584.6, 605.3, 623.8, 640.4, 670.2, 696.5, 719.1, 737.7, 752.5, 763.9, 772.5, 778.6, 782.6, 784.6, 784.9, 783.8, 781.4, 778, 749.2, 710.6, 669.6, 630, 593.5, 560.4, 530.8, 504.4, 459.6, 423.3, 393.3, 368.2, 346.8, 328, 311.6, 296.9, 283.8, 272, 261.3, 251.5, 242.4, 234.1, 200.8, 176.8, 158.4, 143.8 };
    284268 
    285   for(i=0; i<60; i++) {e[30][i]=e30[i]*MeV*cm2/g;}
     269  AddData(T0, e30, 30);
    286270 
    287271  name [31] = "G4_Kr";
    288272  G4double e31[60] = { 45.92, 56.24, 64.94, 72.6, 79.53, 91.84, 102.7, 112.5, 121.5, 129.9, 137.8, 145.2, 160.1, 173.2, 184.9, 195.5, 205.1, 213.8, 221.8, 229.1, 242, 252.7, 261.6, 268.8, 274.6, 279, 282.3, 284.5, 285.8, 286.2, 286, 285.1, 283.8, 281.9, 268.6, 252.2, 236.2, 221.7, 209, 198.2, 188.9, 180.9, 168.1, 158.1, 150.2, 143.7, 138.1, 133.2, 128.8, 124.8, 121.2, 117.8, 114.6, 111.6, 108.8, 106.1, 94.63, 85.43, 77.91, 71.84 };
    289273 
    290   for(i=0; i<60; i++) {e[31][i]=e31[i]*MeV*cm2/g;}
     274  AddData(T0, e31, 31);
    291275 
    292276  name [32] = "G4_LITHIUM_TETRABORATE";
    293277  G4double e32[60] = { 111, 135.9, 157, 175.5, 192.2, 222, 248.2, 271.9, 293.6, 313.9, 333, 351, 386.5, 417.4, 444.8, 469.4, 491.6, 511.7, 530.1, 546.7, 575.8, 599.9, 619.8, 636, 649.1, 659.3, 667.2, 672.9, 676.7, 678.9, 679.6, 679.1, 677.6, 675.1, 653, 622.4, 589.5, 557.3, 525.5, 495.6, 468.4, 444.1, 403.1, 370.6, 344.6, 323.5, 305.9, 290.3, 276.4, 263.9, 252.7, 242.4, 233.2, 224.7, 216.9, 209.6, 180.4, 159.2, 142.8, 129.9 };
    294278 
    295   for(i=0; i<60; i++) {e[32][i]=e32[i]*MeV*cm2/g;}
     279  AddData(T0, e32, 32);
    296280 
    297281  name [33] = "G4_LITHIUM_FLUORIDE";
    298282  G4double e33[60] = { 80.87, 99.04, 114.4, 127.9, 140.1, 161.7, 180.8, 198.1, 214, 228.7, 242.6, 255.7, 281.9, 304.9, 325.4, 344, 360.9, 376.5, 390.8, 404, 427.6, 447.8, 465.3, 480.3, 493.1, 504.1, 513.3, 521.1, 527.4, 532.5, 536.5, 539.6, 541.7, 543, 540.3, 527.4, 509.2, 488.8, 467.4, 446.5, 426.9, 408.7, 376.9, 350.4, 328, 309.1, 292.7, 278.1, 265.1, 253.3, 242.5, 232.8, 223.9, 215.6, 208.2, 201.2, 173.1, 152.5, 136.8, 124.4 };
    299283 
    300   for(i=0; i<60; i++) {e[33][i]=e33[i]*MeV*cm2/g;}
     284  AddData(T0, e33, 33);
    301285 
    302286  name [34] = "G4_M3_WAX";
    303287  G4double e34[60] = { 198.1, 242.6, 280.2, 313.3, 343.1, 391.9, 435.4, 474.6, 510.6, 543.1, 573, 601, 656.7, 703.7, 744.4, 780.4, 812.2, 840.3, 865, 887, 925, 956.5, 982.1, 1002, 1016, 1026, 1032, 1035, 1036, 1033, 1029, 1023, 1016, 1007, 953.3, 891.9, 831.3, 775.4, 725.1, 680.6, 641.3, 606.6, 546.6, 497.8, 458.8, 427.4, 401.7, 379.2, 359.6, 342.2, 326.7, 312.7, 300.1, 288.5, 277.8, 268.1, 229.1, 201, 179.7, 162.8 };
    304288 
    305   for(i=0; i<60; i++) {e[34][i]=e34[i]*MeV*cm2/g;}
     289  AddData(T0, e34, 34);
    306290 
    307291  name [35] = "G4_MS20_TISSUE";
    308292  G4double e35[60] = { 174.4, 213.6, 246.7, 275.8, 302.1, 345, 383.2, 417.7, 449.4, 477.9, 504.3, 528.8, 578.1, 619.8, 656, 688.2, 716.7, 742, 764.4, 784.4, 819.3, 848.7, 872.8, 892, 906.4, 916.8, 923.7, 927.8, 929.4, 928.8, 926.4, 922.3, 916.9, 910.4, 866.6, 814.5, 762, 712.8, 668.3, 628.6, 593.3, 562.1, 507.7, 463.3, 427.6, 398.9, 375.3, 354.7, 336.7, 320.6, 306.2, 293.3, 281.6, 270.9, 261, 252, 215.7, 189.5, 169.6, 153.9 };
    309293 
    310   for(i=0; i<60; i++) {e[35][i]=e35[i]*MeV*cm2/g;}
     294  AddData(T0, e35, 35);
    311295 
    312296  name [36] = "G4_METHANE";
    313297  G4double e36[60] = { 272.8, 334.1, 385.8, 431.4, 472.5, 545.6, 610, 668.2, 721.8, 771.6, 818.4, 862.7, 949.2, 1024, 1090, 1148, 1200, 1246, 1288, 1325, 1387, 1436, 1473, 1500, 1518, 1528, 1532, 1530, 1524, 1514, 1501, 1485, 1467, 1447, 1338, 1227, 1127, 1041, 967.3, 904.6, 850.4, 803.2, 724.6, 661.8, 610.5, 567.7, 531.4, 499.8, 472.5, 448.3, 426.7, 407.4, 390, 374.1, 359.6, 346.4, 293.7, 256.2, 227.9, 205.7 };
    314298 
    315   for(i=0; i<60; i++) {e[36][i]=e36[i]*MeV*cm2/g;}
     299  AddData(T0, e36, 36);
    316300 
    317301  name [37] = "G4_Mo";
    318302  G4double e37[60] = { 40.18, 49.21, 56.82, 63.53, 69.59, 80.35, 89.84, 98.41, 106.3, 113.6, 120.5, 127, 140.2, 151.7, 162.1, 171.5, 180.1, 188, 195.4, 202.1, 214.3, 224.8, 233.8, 241.6, 248.3, 253.9, 258.7, 262.6, 265.7, 268.2, 270, 271.3, 272.1, 272.4, 268.7, 259.5, 248, 235.8, 224, 213.1, 203.1, 194.1, 178.9, 166.6, 156.5, 148.1, 141, 134.9, 129.5, 124.7, 120.4, 116.4, 112.6, 109.1, 105.8, 102.6, 89.8, 80.34, 73.15, 67.51 };
    319303 
    320   for(i=0; i<60; i++) {e[37][i]=e37[i]*MeV*cm2/g;}
     304  AddData(T0, e37, 37);
    321305 
    322306  name [38] = "G4_MUSCLE_WITH_SUCROSE";
    323307  G4double e38[60] = { 149.4, 183, 211.3, 236.2, 258.7, 298.3, 333.3, 364.8, 393.8, 420.8, 446, 469.8, 516.6, 557.2, 593.1, 625.2, 654, 680, 703.5, 724.8, 761.7, 792, 816.7, 836.5, 851.9, 863.6, 871.9, 877.4, 880.4, 881.2, 880.1, 877.3, 873.2, 867.9, 829.5, 781.9, 733.4, 688, 647.9, 612.8, 581.8, 554.2, 507.1, 468.4, 435.9, 408.3, 384.4, 363.5, 344.9, 328.4, 313.7, 300.3, 288.2, 277.2, 267, 257.7, 220.4, 193.5, 173, 156.9 };
    324308 
    325   for(i=0; i<60; i++) {e[38][i]=e38[i]*MeV*cm2/g;}
     309  AddData(T0, e38, 38);
    326310 
    327311  name [39] = "G4_MUSCLE_WITHOUT_SUCROSE";
    328312  G4double e39[60] = { 146.6, 179.5, 207.3, 231.8, 253.9, 292.9, 327.3, 358.4, 386.9, 413.5, 438.4, 461.9, 508.2, 548.4, 584, 615.8, 644.5, 670.4, 693.8, 715.1, 752, 782.3, 807.1, 827, 842.5, 854.3, 862.9, 868.5, 871.6, 872.6, 871.6, 869, 865, 859.8, 822, 774.9, 726.9, 682, 643, 609.2, 579.4, 552.9, 507.4, 469.6, 437.7, 410.1, 386.1, 365.1, 346.5, 329.9, 315, 301.6, 289.4, 278.3, 268.2, 258.8, 221.3, 194.3, 173.7, 157.5 };
    329313 
    330   for(i=0; i<60; i++) {e[39][i]=e39[i]*MeV*cm2/g;}
     314  AddData(T0, e39, 39);
    331315 
    332316  name [40] = "G4_MUSCLE_SKELETAL_ICRP";
    333317  G4double e40[60] = { 141.3, 173.1, 199.9, 223.5, 244.8, 282.5, 315.8, 345.8, 373.5, 399.2, 423.3, 446.1, 491.1, 530.2, 565, 596.1, 624.2, 649.7, 672.8, 693.8, 730.4, 760.6, 785.3, 805.3, 821.1, 833.1, 841.9, 847.9, 851.4, 852.6, 852, 849.7, 846.1, 841.2, 804.8, 758.9, 712.2, 668.5, 631.2, 599, 570.8, 545.6, 502.2, 465.8, 434.6, 407.5, 383.7, 362.8, 344.4, 327.9, 313.1, 299.8, 287.7, 276.7, 266.6, 257.3, 220, 193.2, 172.8, 156.7 };
    334318 
    335   for(i=0; i<60; i++) {e[40][i]=e40[i]*MeV*cm2/g;}
     319  AddData(T0, e40, 40);
    336320 
    337321  name [41] = "G4_MUSCLE_STRIATED_ICRU";
    338322  G4double e41[60] = { 141.7, 173.5, 200.4, 224, 245.4, 283.2, 316.5, 346.6, 374.3, 400, 424.2, 447, 492.1, 531.3, 566.1, 597.3, 625.4, 650.9, 674, 695.1, 731.6, 761.9, 786.7, 806.6, 822.4, 834.4, 843.3, 849.2, 852.6, 853.9, 853.2, 851, 847.3, 842.4, 805.8, 759.8, 713, 669.2, 632, 600.1, 572.1, 547.1, 504, 467.7, 436.5, 409.3, 385.3, 364.3, 345.7, 329.2, 314.4, 300.9, 288.8, 277.8, 267.6, 258.3, 220.8, 193.9, 173.4, 157.2 };
    339323 
    340   for(i=0; i<60; i++) {e[41][i]=e41[i]*MeV*cm2/g;}
     324  AddData(T0, e41, 41);
    341325 
    342326  name [42] = "G4_N";
    343327  G4double e42[60] = { 126.5, 155, 179, 200.1, 219.2, 253.1, 283, 310, 334.8, 357.9, 379.6, 400.2, 440.6, 475.8, 507, 535, 560.2, 583.1, 603.8, 622.7, 655.5, 682.7, 704.9, 722.9, 737.3, 748.4, 756.6, 762.3, 765.9, 767.5, 767.5, 766, 763.3, 759.4, 729.3, 689.8, 648.6, 609.1, 572.9, 540.4, 511.6, 486.2, 443.4, 408.8, 380.1, 356, 335.4, 317.2, 301.2, 286.8, 274.1, 262.6, 252.2, 242.7, 234, 225.9, 193.8, 170.5, 152.8, 138.8 };
    344328 
    345   for(i=0; i<60; i++) {e[42][i]=e42[i]*MeV*cm2/g;}
     329  AddData(T0, e42, 42);
    346330 
    347331  name [43] = "G4_SODIUM_IODIDE";
    348332  G4double e43[60] = { 41.1, 50.34, 58.12, 64.98, 71.19, 82.2, 91.9, 100.7, 108.7, 116.2, 123.3, 130, 143.4, 155.2, 165.8, 175.4, 184.2, 192.3, 199.7, 206.6, 219, 229.6, 238.9, 246.8, 253.5, 259.2, 264, 268, 271.1, 273.6, 275.4, 276.7, 277.4, 277.7, 273.7, 264.2, 252.3, 239.7, 227.6, 216.2, 205.9, 196.6, 180.7, 167.8, 157.3, 148.5, 141.1, 134.7, 129.1, 124.1, 119.7, 115.7, 111.9, 108.4, 105.1, 101.9, 88.79, 78.99, 71.48, 65.54 };
    349333 
    350   for(i=0; i<60; i++) {e[43][i]=e43[i]*MeV*cm2/g;}
     334  AddData(T0, e43, 43);
    351335 
    352336  name [44] = "G4_Ne";
    353337  G4double e44[60] = { 58.01, 71.05, 82.04, 91.73, 100.5, 116, 129.7, 142.1, 153.5, 164.1, 174, 183.5, 202.5, 219.3, 234.5, 248.3, 261, 272.8, 283.8, 294, 312.7, 329.2, 343.8, 356.9, 368.6, 379, 388.3, 396.5, 403.8, 410.2, 415.8, 420.7, 424.8, 428.4, 438.1, 437.9, 431.3, 420.8, 408.2, 394.6, 380.7, 367.1, 339, 313.8, 293.3, 277.2, 264.3, 252.6, 241.9, 232.2, 223.2, 215, 207.4, 200.4, 193.8, 187.7, 163, 144.6, 130.3, 118.9 };
    354338 
    355   for(i=0; i<60; i++) {e[44][i]=e44[i]*MeV*cm2/g;}
    356  
    357   name [45] = "G4_NYLON_6/6";
     339  AddData(T0, e44, 44);
     340 
     341  name [45] = "G4_NYLON-6-6";
    358342  G4double e45[60] = { 191, 233.9, 270.1, 302, 330.8, 377.8, 419.7, 457.5, 492.1, 523.4, 552.3, 579.2, 633, 678.5, 717.9, 752.9, 783.8, 811.1, 835.3, 856.8, 894.2, 925.4, 951, 971, 985.8, 996.3, 1003, 1007, 1008, 1006, 1003, 997.7, 991.2, 983.5, 933.5, 875.4, 817.5, 763.6, 715, 671.7, 633.5, 599.6, 542.9, 497.4, 460.4, 429.7, 403.7, 381, 361.2, 343.6, 327.9, 313.8, 301, 289.3, 278.6, 268.8, 229.5, 201.3, 179.8, 162.9 };
    359343 
    360   for(i=0; i<60; i++) {e[45][i]=e45[i]*MeV*cm2/g;}
     344  AddData(T0, e45, 45);
    361345 
    362346  name [46] = "G4_O";
    363347  G4double e46[60] = { 99.46, 121.8, 140.7, 157.3, 172.3, 198.9, 222.4, 243.6, 263.1, 281.3, 298.4, 314.5, 346.6, 374.7, 399.8, 422.4, 443, 461.9, 479.1, 495, 523.1, 547, 567.2, 584.4, 598.7, 610.6, 620.2, 628, 633.9, 638.3, 641.3, 643, 643.6, 643.3, 630.5, 606.7, 578.3, 549.1, 520.9, 494.6, 470.9, 449.7, 413.2, 383.1, 357.8, 336.3, 317.6, 301.1, 286.3, 273.2, 261.3, 250.5, 240.8, 231.9, 223.7, 216.1, 185.7, 163.7, 146.7, 133.4 };
    364348 
    365   for(i=0; i<60; i++) {e[46][i]=e46[i]*MeV*cm2/g;}
     349  AddData(T0, e46, 46);
    366350 
    367351  name [47] = "G4_PARAFFIN";
    368352  G4double e47[60] = { 228.8, 280.2, 323.5, 361.7, 396.2, 451.9, 501.6, 546.5, 587.6, 624.6, 658.6, 690.2, 753.4, 806.4, 852.1, 892.4, 927.9, 959.1, 986.3, 1010, 1052, 1086, 1114, 1135, 1150, 1160, 1166, 1168, 1166, 1163, 1157, 1149, 1140, 1129, 1064, 992.4, 922.6, 858.6, 801.5, 751.1, 706.8, 667.8, 601.8, 548.9, 506.2, 471.3, 442.2, 416.9, 394.9, 375.4, 358, 342.3, 328.2, 315.3, 303.4, 292.6, 249.3, 218.3, 194.8, 176.3 };
    369353 
    370   for(i=0; i<60; i++) {e[47][i]=e47[i]*MeV*cm2/g;}
     354  AddData(T0, e47, 47);
    371355 
    372356  name [48] = "G4_Pb";
    373357  G4double e48[60] = { 15.4, 18.86, 21.78, 24.35, 26.68, 30.81, 34.44, 37.73, 40.75, 43.57, 46.21, 48.71, 53.82, 58.34, 62.45, 66.21, 69.7, 72.94, 75.98, 78.85, 84.11, 88.84, 93.13, 97.02, 100.6, 103.8, 106.8, 109.5, 111.9, 114.1, 116.2, 118, 119.6, 121.1, 126.1, 128.1, 127.9, 126.3, 123.6, 120.4, 116.9, 113.3, 106.4, 99.98, 94.37, 89.5, 85.18, 81.37, 78.01, 75.05, 72.42, 70.08, 67.99, 66.12, 64.44, 62.92, 56.88, 52.22, 48.46, 45.34 };
    374358 
    375   for(i=0; i<60; i++) {e[48][i]=e48[i]*MeV*cm2/g;}
     359  AddData(T0, e48, 48);
    376360 
    377361  name [49] = "G4_PHOTO_EMULSION";
    378362  G4double e49[60] = { 61.33, 75.12, 86.74, 96.97, 106.2, 122.2, 136.3, 149.1, 160.8, 171.6, 181.6, 191.1, 210, 226.3, 240.6, 253.5, 265, 275.4, 284.8, 293.3, 308, 320.3, 330.3, 338.4, 344.7, 349.4, 352.8, 355.1, 356.4, 356.9, 356.6, 355.7, 354.3, 352.4, 338.9, 322.3, 305.5, 289.9, 275.7, 263, 251.7, 241.5, 224.4, 210.3, 198.3, 188, 179, 171, 163.9, 157.5, 151.6, 146.3, 141.3, 136.6, 132.1, 128, 110.6, 97.75, 87.92, 80.2 };
    379363 
    380   for(i=0; i<60; i++) {e[49][i]=e49[i]*MeV*cm2/g;}
     364  AddData(T0, e49, 49);
    381365 
    382366  name [50] = "G4_PLASTIC_SC_VINYLTOLUENE";
    383367  G4double e50[60] = { 190.1, 232.8, 268.8, 300.5, 329.2, 374.1, 414.4, 450.7, 483.9, 513.5, 540.4, 565.4, 616.5, 659.2, 696, 728.7, 757.6, 783, 805.3, 825.2, 860.1, 890.2, 915.4, 935.4, 950.4, 961.1, 968.2, 972.3, 973.8, 973, 970.2, 965.7, 959.9, 952.8, 906, 850.6, 795.1, 743.3, 696.4, 654.7, 617.9, 585.3, 530.7, 487.1, 451.3, 421.4, 395.9, 373.7, 354.4, 337.2, 321.9, 308.1, 295.7, 284.2, 273.8, 264.1, 225.7, 198.1, 177.1, 160.5 };
    384368 
    385   for(i=0; i<60; i++) {e[50][i]=e50[i]*MeV*cm2/g;}
     369  AddData(T0, e50, 50);
    386370 
    387371  name [51] = "G4_POLYCARBONATE";
    388372  G4double e51[60] = { 164.8, 201.8, 233, 260.5, 285.4, 324.6, 359.7, 391.4, 420.3, 446.2, 469.7, 491.7, 536.5, 574.3, 607.1, 636.2, 662.2, 685.1, 705.4, 723.6, 755.9, 783.9, 807.7, 826.9, 841.7, 852.8, 860.8, 866, 868.8, 869.6, 868.6, 866, 862.1, 857.1, 820.5, 774.5, 727.2, 682.2, 641.1, 604.1, 571.2, 542, 492.3, 452.1, 419.1, 391.8, 368.6, 348.4, 330.7, 314.9, 300.8, 288.1, 276.7, 266.1, 256.5, 247.6, 212, 186.3, 166.8, 151.3 };
    389373 
    390   for(i=0; i<60; i++) {e[51][i]=e51[i]*MeV*cm2/g;}
     374  AddData(T0, e51, 51);
    391375 
    392376  name [52] = "G4_POLYETHYLENE";
    393377  G4double e52[60] = { 184.9, 226.5, 261.5, 292.4, 320.3, 369.9, 413.5, 453, 489.3, 523, 554.8, 584.8, 643.9, 695.3, 740.8, 781.4, 817.9, 850.9, 880.6, 907.5, 953.7, 990.9, 1021, 1044, 1061, 1073, 1081, 1084, 1085, 1083, 1078, 1072, 1064, 1054, 994.1, 927.8, 865, 808.9, 760.1, 717.9, 681.4, 649.7, 591.2, 541, 499.2, 464.9, 436.3, 411.4, 389.8, 370.6, 353.4, 338.1, 324.2, 311.4, 299.8, 289.1, 246.4, 215.9, 192.7, 174.4 };
    394378 
    395   for(i=0; i<60; i++) {e[52][i]=e52[i]*MeV*cm2/g;}
    396  
    397   name [53] = "G4_POLYETHYLENE_TEREPHTHALATE_MYLAR";
     379  AddData(T0, e52, 52);
     380 
     381  name [53] = "G4_MYLAR";
    398382  G4double e53[60] = { 150.9, 184.9, 213.5, 238.7, 261.4, 297.8, 330.2, 359.6, 386.4, 410.5, 432.5, 453, 494.9, 530.3, 561.2, 588.8, 613.4, 635.3, 654.7, 672.3, 703.4, 730.5, 753.5, 772.3, 787, 798.3, 806.6, 812.4, 816, 817.6, 817.4, 815.8, 812.9, 808.9, 777.6, 736.5, 693.4, 651.9, 613.6, 579.1, 548.2, 520.6, 472.9, 434, 402.2, 376.1, 354.3, 335, 318.2, 303.2, 289.8, 277.7, 266.7, 256.6, 247.4, 238.9, 204.8, 180.2, 161.4, 146.5 };
    399383 
    400   for(i=0; i<60; i++) {e[53][i]=e53[i]*MeV*cm2/g;}
    401  
    402   name [54] = "G4_PLEXIGLASS";
     384  AddData(T0, e53, 53);
     385 
     386  name [54] = "G4_PLEXIGLASS";  // POLYMETHYL METHACRALATE (LUCITE, PERSPEX, PLEXIGLASS
    403387  G4double e54[60] = { 174.9, 214.2, 247.4, 276.6, 303, 345.9, 384.1, 418.7, 450.4, 479, 505.2, 529.8, 579.1, 620.8, 657.1, 689.3, 717.9, 743.2, 765.7, 785.8, 820.8, 850.5, 875, 894.5, 909.3, 920.1, 927.4, 931.9, 933.9, 933.7, 931.6, 928, 922.9, 916.8, 874.4, 823.2, 771.3, 722.4, 676.2, 634, 596.2, 562.8, 507.2, 463.4, 428.5, 400.2, 376.7, 356.1, 338, 321.9, 307.5, 294.5, 282.8, 272, 262.1, 253, 216.6, 190.4, 170.3, 154.5 };
    404388 
    405   for(i=0; i<60; i++) {e[54][i]=e54[i]*MeV*cm2/g;}
     389  AddData(T0, e54, 54);
    406390 
    407391  name [55] = "G4_POLYPROPYLENE";
    408392  G4double e55[60] = { 197.6, 242, 279.4, 312.4, 342.2, 395.1, 441.8, 483.9, 522.7, 558.8, 592.7, 624.8, 687.3, 741.3, 789, 831.4, 869.4, 903.6, 934.3, 962, 1009, 1048, 1078, 1101, 1119, 1132, 1140, 1145, 1146, 1145, 1141, 1135, 1128, 1119, 1060, 991.7, 924.3, 862, 806.1, 756.5, 712.8, 674.2, 605.4, 548.6, 503.3, 467.5, 438.7, 413.6, 391.8, 372.4, 355.2, 339.7, 325.7, 312.9, 301.1, 290.4, 247.5, 216.8, 193.5, 175.1 };
    409393 
    410   for(i=0; i<60; i++) {e[55][i]=e55[i]*MeV*cm2/g;}
     394  AddData(T0, e55, 55);
    411395 
    412396  name [56] = "G4_POLYSTYRENE";
    413397  G4double e56[60] = { 186, 227.8, 263.1, 294.1, 322.2, 372.1, 416, 455.7, 492.2, 526.2, 558.1, 588.3, 645.3, 693.8, 735.8, 772.4, 804.5, 832.6, 857.2, 878.7, 913.5, 939.2, 957.2, 969, 975.6, 978, 976.8, 972.8, 966.5, 958.4, 948.9, 938.3, 926.9, 914.9, 851.3, 789.6, 734.2, 685.4, 642.9, 605.7, 573, 543.9, 499.5, 465.2, 435.8, 409.1, 384.6, 363.2, 344.6, 328.1, 313.3, 300, 288, 277, 266.8, 257.5, 220.4, 193.6, 173.2, 157 };
    414398 
    415   for(i=0; i<60; i++) {e[56][i]=e56[i]*MeV*cm2/g;}
     399  AddData(T0, e56, 56);
    416400 
    417401  name [57] = "G4_TEFLON";
    418402  G4double e57[60] = { 83.27, 102, 117.8, 131.7, 144.2, 165, 183.4, 200.1, 215.3, 229.2, 242, 254, 278.7, 300, 319, 336.2, 351.9, 366.1, 379.2, 391.2, 413.1, 432.7, 450, 465.1, 478, 489.1, 498.5, 506.4, 513, 518.4, 522.7, 526, 528.4, 530.1, 528.6, 516.7, 499.4, 479.6, 460.4, 442.3, 425.4, 409.6, 381.2, 356.4, 334.6, 315.4, 298.3, 283.1, 269.6, 257.4, 246.5, 236.5, 227.4, 219.1, 211.5, 204.4, 175.9, 155.2, 139.3, 126.7 };
    419403 
    420   for(i=0; i<60; i++) {e[57][i]=e57[i]*MeV*cm2/g;}
     404  AddData(T0, e57, 57);
    421405 
    422406  name [58] = "G4_POLYVINYL_CHLORIDE";
    423407  G4double e58[60] = { 140.2, 171.7, 198.3, 221.7, 242.8, 277.9, 309, 337.2, 363, 386.4, 408.1, 428.4, 468.9, 503.4, 533.6, 560.3, 584.1, 605.3, 624.1, 640.9, 670.1, 694.5, 714.3, 729.8, 741.4, 749.6, 755, 757.9, 758.6, 757.6, 755, 751, 746, 740, 701.3, 656.7, 612.9, 572.6, 538.7, 509.8, 484.7, 462.4, 424.2, 392.4, 365.3, 341.8, 321.1, 302.9, 287.3, 273.6, 261.3, 250.1, 240.1, 231.1, 222.7, 215, 184.5, 162.6, 145.9, 132.6 };
    424408 
    425   for(i=0; i<60; i++) {e[58][i]=e58[i]*MeV*cm2/g;}
     409  AddData(T0, e58, 58);
    426410
    427411  name [59] = "G4_PROPANE";
    428   G4double e59[60] = { 194.5, 234.7, 268.4, 298, 324.7, 372, 413.6, 451.2, 485.8, 518, 548.2, 576.8, 642.6, 702.2, 756.9, 808, 855.9, 901.2, 944.4, 985.6, 1063, 1135, 1203, 1267, 1327, 1385, 1440, 1492, 1543, 1592, 1639, 1684, 1728, 1770, 1964, 2131, 2277, 2404, 2516, 2613, 2698, 2771, 2887, 2969, 3022, 3053, 3065, 3061, 3046, 3021, 2990, 2953, 2912, 2868, 2822, 2775, 2564, 2372, 2191, 2022 };
    429 
    430   for(i=0; i<60; i++) {e[59][i]=e59[i]*MeV*cm2/g;}
     412  G4double e59[60] = { 2.183E+02, 2.673E+02, 3.087E+02, 3.451E+02, 3.780E+02, 4.365E+02, 4.880E+02, 5.346E+02, 5.775E+02, 6.173E+02, 6.548E+02, 6.902E+02, 7.595E+02, 8.190E+02, 8.714E+02, 9.180E+02, 9.597E+02, 9.970E+02, 1.031E+03, 1.061E+03, 1.112E+03, 1.153E+03, 1.186E+03, 1.211E+03, 1.229E+03, 1.242E+03, 1.250E+03, 1.254E+03, 1.254E+03, 1.252E+03, 1.247E+03, 1.239E+03, 1.230E+03, 1.220E+03, 1.153E+03, 1.078E+03, 1.005E+03, 9.379E+02, 8.769E+02, 8.222E+02, 7.736E+02, 7.305E+02, 6.583E+02, 6.006E+02, 5.537E+02, 5.150E+02, 4.825E+02, 4.542E+02, 4.297E+02, 4.079E+02, 3.886E+02, 3.712E+02, 3.556E+02, 3.413E+02, 3.282E+02, 3.163E+02, 2.687E+02, 2.348E+02, 2.092E+02, 1.890E+02 };
     413
     414  AddData(T0, e59, 59);
    431415
    432416  name [60] = "G4_Pt";
    433   G4double e60[60] = { 30.79, 33.73, 36.43, 38.95, 41.31, 43.55, 48.11, 52.16, 55.83, 59.2, 62.32, 65.23, 67.95, 70.51, 75.22, 79.46, 83.3, 86.79, 89.97, 92.87, 95.51, 97.92, 100.1, 102.1, 103.9, 105.5, 107, 108.3, 112.7, 114.5, 114.4, 113, 110.8, 108.1, 105.3, 102.4, 96.92, 92.12, 87.91, 84.22, 80.97, 78.11, 75.56, 73.26, 71.17, 69.26, 67.5, 65.87, 64.36, 62.94, 57, 52.39, 48.67, 45.57, 42.94, 40.66, 38.67, 36.9, 33.91, 31.45 };
    434 
    435   for(i=0; i<60; i++) {e[60][i]=e60[i]*MeV*cm2/g;}
     417  G4double e60[60] =  { 1.377E+01, 1.687E+01, 1.947E+01, 2.177E+01, 2.385E+01, 2.754E+01, 3.079E+01, 3.373E+01, 3.643E+01, 3.895E+01, 4.131E+01, 4.355E+01, 4.811E+01, 5.216E+01, 5.583E+01, 5.920E+01, 6.232E+01, 6.523E+01, 6.795E+01, 7.051E+01, 7.522E+01, 7.946E+01, 8.330E+01, 8.679E+01, 8.997E+01, 9.287E+01, 9.551E+01, 9.792E+01, 1.001E+02, 1.021E+02, 1.039E+02, 1.055E+02, 1.070E+02, 1.083E+02, 1.127E+02, 1.145E+02, 1.144E+02, 1.130E+02, 1.108E+02, 1.081E+02, 1.053E+02, 1.024E+02, 9.692E+01, 9.212E+01, 8.791E+01, 8.422E+01, 8.097E+01, 7.811E+01, 7.556E+01, 7.326E+01, 7.117E+01, 6.926E+01, 6.750E+01, 6.587E+01, 6.436E+01, 6.294E+01, 5.700E+01, 5.239E+01, 4.867E+01, 4.557E+01 };
     418
     419  AddData(T0, e60, 60);
    436420 
    437421  name [61] = "G4_Si";
    438422  G4double e61[60] = { 105, 128.6, 148.5, 166, 181.8, 210, 234.8, 257.2, 277.8, 296.9, 315, 332, 364.6, 392.5, 416.7, 437.8, 456.3, 472.5, 486.6, 498.9, 518.4, 532.3, 541.6, 547, 549.2, 549, 546.8, 543, 538, 532.2, 525.7, 518.8, 511.7, 504.4, 468.7, 437.3, 410.7, 388.4, 369.4, 353, 338.7, 325.9, 304.1, 285.9, 270.3, 256.7, 245.2, 235.1, 225.9, 217.2, 209, 201.1, 193.6, 187, 180.9, 175.3, 152.3, 135.4, 122.2, 111.7 };
    439423 
    440   for(i=0; i<60; i++) {e[61][i]=e61[i]*MeV*cm2/g;}
     424  AddData(T0, e61, 61);
    441425 
    442426  name [62] = "G4_SILICON_DIOXIDE";
    443427  G4double e62[60] = { 85.64, 104.9, 121.1, 135.4, 148.3, 171.3, 191.5, 209.8, 226.6, 242.2, 256.9, 270.8, 298.1, 322, 343.1, 362.1, 379.3, 394.9, 409.1, 422.1, 444.8, 463.8, 479.7, 492.8, 503.6, 512.3, 519.2, 524.5, 528.5, 531.2, 532.9, 533.7, 533.6, 532.9, 521.9, 503.9, 483.5, 462.8, 442.9, 424.2, 406.7, 390.6, 358.9, 330.8, 307.6, 288.9, 273.6, 259.9, 247.8, 236.9, 227.1, 218.2, 210.1, 202.7, 195.9, 189.7, 164.2, 145.5, 131.1, 119.6 };
    444428 
    445   for(i=0; i<60; i++) {e[62][i]=e62[i]*MeV*cm2/g;}
     429  AddData(T0, e62, 62);
    446430 
    447431  name [63] = "G4_STILBENE";
    448432  G4double e63[60] = { 179.2, 219.5, 253.4, 283.3, 310.4, 352.2, 389.8, 423.8, 454.7, 482.3, 507.2, 530.3, 577.9, 617.7, 652.1, 682.6, 709.7, 733.5, 754.4, 773, 806.1, 835.1, 859.5, 879.2, 894.2, 905.1, 912.7, 917.4, 919.6, 919.6, 917.7, 914.2, 909.3, 903.3, 861.4, 810.7, 759.2, 710.8, 667.1, 628.3, 593.9, 563.4, 511.8, 470.2, 435.9, 407.2, 382.8, 361.4, 342.9, 326.4, 311.6, 298.4, 286.4, 275.4, 265.3, 256.1, 219, 192.4, 172.1, 156.1 };
    449433 
    450   for(i=0; i<60; i++) {e[63][i]=e63[i]*MeV*cm2/g;}
     434  AddData(T0, e63, 63);
    451435 
    452436  name [64] = "G4_Ti";
    453437  G4double e64[60] = { 60.88, 74.56, 86.1, 96.26, 105.4, 121.8, 136.1, 149.1, 161.1, 172.2, 182.6, 192.5, 212.3, 229.6, 245.1, 259.1, 271.8, 283.5, 294.2, 304.1, 321.6, 336.5, 349.1, 359.8, 368.7, 376, 382, 386.7, 390.2, 392.7, 394.4, 395.2, 395.3, 394.8, 385.4, 369.3, 351, 332.6, 315.4, 299.6, 285.5, 272.8, 251.3, 233.9, 219.6, 207.6, 197.4, 188.7, 181, 174.1, 167.9, 162.2, 157, 152.2, 147.7, 143.5, 126, 112.5, 101.7, 93.07 };
    454438 
    455   for(i=0; i<60; i++) {e[64][i]=e64[i]*MeV*cm2/g;}
     439  AddData(T0, e64, 64);
    456440 
    457441  name [65] = "G4_Sn";
    458442  G4double e65[60] = { 32.4, 39.68, 45.82, 51.23, 56.12, 64.8, 72.45, 79.36, 85.72, 91.64, 97.2, 102.5, 113.1, 122.4, 130.8, 138.5, 145.5, 151.9, 157.9, 163.4, 173.4, 182, 189.5, 196, 201.6, 206.4, 210.4, 213.8, 216.5, 218.7, 220.4, 221.6, 222.4, 222.9, 220.7, 213.8, 204.9, 195.4, 186, 177.3, 169.4, 162.3, 150.1, 140.3, 132.2, 125.5, 119.7, 114.7, 110.1, 106.1, 102.5, 99.14, 96.12, 93.34, 90.77, 88.4, 78.69, 71.47, 65.7, 60.79 };
    459443 
    460   for(i=0; i<60; i++) {e[65][i]=e65[i]*MeV*cm2/g;}
     444  AddData(T0, e65, 65);
    461445 
    462446  name [66] = "G4_TISSUE-METHANE";
    463447  G4double e66[60] = { 174.5, 213.8, 246.8, 276, 302.3, 349.1, 390.3, 427.6, 461.8, 493.7, 523.6, 552, 607.8, 656.2, 699.1, 737.4, 771.9, 803, 831.1, 856.5, 900.2, 935.6, 963.8, 985.9, 1003, 1015, 1022, 1027, 1028, 1027, 1023, 1018, 1011, 1002, 947.8, 885.5, 824.9, 769.7, 720.9, 678.2, 641, 608.6, 553.2, 507.9, 470.5, 439.1, 412.4, 389, 368.6, 350.5, 334.4, 319.8, 306.6, 294.6, 283.6, 273.5, 233.2, 204.4, 182.5, 165.2 };
    464448 
    465   for(i=0; i<60; i++) {e[66][i]=e66[i]*MeV*cm2/g;}
     449  AddData(T0, e66, 66);
    466450 
    467451  name [67] = "G4_TISSUE-PROPANE";
    468452  G4double e67[60] = { 169.9, 208.1, 240.3, 268.6, 294.3, 339.8, 379.9, 416.2, 449.5, 480.6, 509.7, 537.3, 591.5, 638.4, 679.9, 716.9, 750.2, 780.2, 807.4, 832, 874.4, 909.1, 937.1, 959.3, 976.6, 989.5, 998.7, 1005, 1008, 1008, 1006, 1003, 998, 991.7, 946.9, 891.9, 836, 783.4, 735.7, 693.2, 655.4, 622, 563.5, 515.3, 475.8, 443.4, 416.2, 392.6, 371.9, 353.6, 337.3, 322.5, 309.3, 297.1, 286, 275.8, 235.1, 206, 183.9, 166.5 };
    469453 
    470   for(i=0; i<60; i++) {e[67][i]=e67[i]*MeV*cm2/g;}
     454  AddData(T0, e67, 67);
    471455 
    472456  name [68] = "G4_TOLUENE";
    473457  G4double e68[60] = { 191.6, 234.7, 271, 302.9, 331.9, 377.2, 417.8, 454.5, 488, 517.9, 545.1, 570.4, 621.9, 665, 702.2, 735.2, 764.3, 790, 812.4, 832.5, 867.7, 897.9, 923.2, 943.3, 958.3, 969, 976, 980, 981.4, 980.4, 977.5, 972.9, 966.9, 959.8, 912.2, 856.2, 800.1, 747.8, 700.6, 658.5, 621.4, 588.5, 535.1, 492.8, 457.8, 427.9, 401.8, 379.1, 359.4, 341.9, 326.3, 312.3, 299.6, 287.9, 277.3, 267.5, 228.5, 200.4, 179.1, 162.3 };
    474458 
    475   for(i=0; i<60; i++) {e[68][i]=e68[i]*MeV*cm2/g;}
     459  AddData(T0, e68, 68);
    476460 
    477461  name [69] = "G4_U";
    478462  G4double e69[60] = { 18.38, 22.51, 25.99, 29.06, 31.83, 36.75, 41.09, 45.01, 48.62, 51.98, 55.13, 58.11, 64.19, 69.57, 74.44, 78.9, 83.02, 86.84, 90.42, 93.78, 99.92, 105.4, 110.3, 114.8, 118.8, 122.4, 125.7, 128.6, 131.2, 133.5, 135.6, 137.4, 139, 140.4, 144.4, 144.8, 142.7, 139.1, 134.5, 129.6, 124.2, 118.8, 108.7, 100, 92.78, 86.72, 81.64, 77.35, 73.71, 70.6, 67.92, 65.59, 63.56, 61.77, 60.19, 58.78, 53.33, 49.08, 45.62, 42.73 };
    479463 
    480   for(i=0; i<60; i++) {e[69][i]=e69[i]*MeV*cm2/g;}
     464  AddData(T0, e69, 69);
    481465 
    482466  name [70] = "G4_W";
    483467  G4double e70[60] = { 14.97, 18.34, 21.17, 23.67, 25.93, 29.94, 33.47, 36.67, 39.61, 42.34, 44.91, 47.34, 52.3, 56.7, 60.68, 64.33, 67.7, 70.84, 73.78, 76.55, 81.61, 86.15, 90.24, 93.95, 97.3, 100.3, 103.1, 105.6, 107.8, 109.9, 111.7, 113.3, 114.7, 116, 120, 121.2, 120.5, 118.5, 115.9, 112.9, 109.8, 106.7, 100.2, 94.14, 89.08, 85, 81.68, 78.78, 76.2, 73.88, 71.78, 69.86, 68.09, 66.45, 64.93, 63.5, 57.52, 52.9, 49.15, 46.04 };
    484468 
    485   for(i=0; i<60; i++) {e[70][i]=e70[i]*MeV*cm2/g;}
     469  AddData(T0, e70, 70);
    486470 
    487471  name [71] = "G4_WATER";
    488472  G4double e71[60] = { 133.7, 163.8, 189.1, 211.4, 231.6, 267.5, 299, 327.6, 353.8, 378.2, 401.2, 422.9, 466, 503.6, 537.2, 567.3, 594.6, 619.5, 642.1, 662.8, 698.9, 729, 753.8, 774, 790.1, 802.6, 811.9, 818.3, 822.3, 824.1, 823.9, 822.2, 819, 814.5, 780.1, 736, 695.9, 660.4, 628.6, 599.9, 573.7, 549.7, 507.5, 471.4, 440.1, 412.8, 388.8, 367.6, 348.9, 332.2, 317.2, 303.7, 291.4, 280.3, 270, 260.6, 222.8, 195.5, 174.8, 158.5 };
    489473 
    490   for(i=0; i<60; i++) {e[71][i]=e71[i]*MeV*cm2/g;}
     474  AddData(T0, e71, 71);
    491475 
    492476  name [72] = "G4_WATER_VAPOR";
    493477  G4double e72[60] = { 152.2, 186.5, 215.3, 240.7, 263.7, 304.5, 340.4, 372.9, 402.8, 430.6, 456.7, 481.4, 530.5, 573.2, 611.3, 645.4, 676.4, 704.4, 730, 753.3, 793.8, 827.4, 855, 877.2, 894.8, 908.2, 918.1, 924.7, 928.5, 929.9, 929.1, 926.5, 922.3, 916.9, 876.3, 825.9, 775.3, 728.5, 686.8, 650.1, 618, 589.9, 536.1, 489.2, 450.8, 420.2, 395.5, 373.8, 354.6, 337.5, 322.2, 308.3, 295.8, 284.4, 273.9, 264.3, 225.7, 198, 176.9, 160.4 };
    494478 
    495   for(i=0; i<60; i++) {e[72][i]=e72[i]*MeV*cm2/g;}
     479  AddData(T0, e72, 72);
    496480 
    497481  name [73] = "G4_Xe";
    498482  G4double e73[60] = { 38.1, 46.67, 53.88, 60.24, 65.99, 76.2, 85.2, 93.33, 100.8, 107.8, 114.3, 120.5, 132.8, 143.6, 153.2, 161.8, 169.6, 176.7, 183.2, 189.1, 199.4, 208, 215, 220.7, 225.2, 228.7, 231.2, 232.9, 233.9, 234.3, 234.1, 233.5, 232.5, 231.1, 221.3, 209.3, 197.4, 186.5, 177, 168.6, 161.3, 155, 144.4, 135.9, 128.8, 122.8, 117.5, 112.7, 108.4, 104.5, 101, 97.75, 94.8, 92.09, 89.6, 87.29, 77.8, 70.52, 64.84, 60.13 };
    499483 
    500   for(i=0; i<60; i++) {e[73][i]=e73[i]*MeV*cm2/g;}
     484  AddData(T0, e73, 73);
    501485}
     486
     487void G4PSTARStopping::AddData(G4double* ekin, G4double* s, G4int idx)
     488{
     489  sdata[idx] = new G4LPhysicsFreeVector(60, ekin[0]*MeV, ekin[59]*MeV);
     490  const G4double fac = MeV*cm2/g;
     491  for(size_t i=0; i<60; ++i) { sdata[idx]->PutValues(i, ekin[i]*MeV, s[i]*fac); }
     492  sdata[idx]->SetSpline(true);
     493}
  • trunk/source/processes/electromagnetic/standard/src/G4UrbanMscModel93.cc

    r1228 r1315  
    1 //
     1// 
    22// ********************************************************************
    33// * License and Disclaimer                                           *
     
    2525//
    2626//
    27 // $Id: G4UrbanMscModel93.cc,v 1.1 2009/11/01 13:05:01 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     27// $Id: G4UrbanMscModel93.cc,v 1.4 2010/05/20 13:17:25 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// -------------------------------------------------------------------
    31 //
     31//   
    3232// GEANT4 Class file
    33 //
     33//   
    3434//
    3535// File name:   G4UrbanMscModel93
     
    466466  presafety = sp->GetSafety();
    467467
    468   //G4cout << "G4Urban2::StepLimit tPathLength= "
    469   //     <<tPathLength<<" safety= " << presafety
    470   //       << " range= " <<currentRange<< " lambda= "<<lambda0
    471   //     << " Alg: " << steppingAlgorithm <<G4endl;
     468 // G4cout << "G4Urban2::StepLimit tPathLength= "
     469 //      <<tPathLength<<" safety= " << presafety
     470 //        << " range= " <<currentRange<< " lambda= "<<lambda0
     471 //      << " Alg: " << steppingAlgorithm <<G4endl;
    472472
    473473  // far from geometry boundary
     
    571571      if(tlimit < stepmin) tlimit = stepmin;
    572572
    573       if(tPathLength > tlimit) tPathLength = tlimit  ;
     573      // randomize 1st step or 1st 'normal' step in volume
     574      if((stepStatus == fUndefined) ||
     575         ((smallstep == skin) && !insideskin))
     576        {
     577          G4double temptlimit = tlimit;
     578          if(temptlimit > tlimitmin)
     579          {
     580            do {
     581              temptlimit = G4RandGauss::shoot(tlimit,0.3*tlimit);       
     582               } while ((temptlimit < tlimitmin) ||
     583                        (temptlimit > 2.*tlimit-tlimitmin));
     584          }
     585          else
     586            temptlimit = tlimitmin;
     587          if(tPathLength > temptlimit) tPathLength = temptlimit;
     588        }
     589      else
     590        { 
     591          if(tPathLength > tlimit) tPathLength = tlimit  ;
     592        }
    574593
    575594    }
     
    617636      //lower limit for tlimit
    618637      if(tlimit < tlimitmin) tlimit = tlimitmin;
    619 
     638     
    620639      if(tPathLength > tlimit) tPathLength = tlimit;
     640
    621641    }
    622642 
     
    10021022G4double G4UrbanMscModel93::SampleDisplacement()
    10031023{
     1024  // compute rmean = sqrt(<r**2>) from theory
    10041025  const G4double kappa = 2.5;
    10051026  const G4double kappapl1 = kappa+1.;
    10061027  const G4double kappami1 = kappa-1.;
     1028  // Compute rmean = sqrt(<r**2>) from theory
    10071029  G4double rmean = 0.0;
    10081030  if ((currentTau >= tausmall) && !insideskin) {
     
    10221044  }
    10231045
     1046  if(rmean == 0.) return rmean;
     1047
    10241048  // protection against z > t ...........................
    1025   if(rmean > 0.) {
    1026     G4double zt = (tPathLength-zPathLength)*(tPathLength+zPathLength);
    1027     if(zt <= 0.)
    1028       rmean = 0.;
    1029     else if(rmean*rmean > zt)
    1030       rmean = sqrt(zt);
    1031   }
     1049  G4double rmax = (tPathLength-zPathLength)*(tPathLength+zPathLength);
     1050    if(rmax <= 0.)
     1051      rmax = 0.;
     1052    else
     1053      rmax = sqrt(rmax);
     1054
     1055  if(rmean >= rmax) return rmax;
     1056     
    10321057  return rmean;
     1058  // VI comment out for the time being
     1059  /*
     1060  //sample r (Gaussian distribution with a mean of rmean )
     1061  G4double r = 0.;
     1062  G4double sigma = min(rmean,rmax-rmean);
     1063  sigma /= 3.;
     1064  G4double rlow  = rmean-3.*sigma;
     1065  G4double rhigh = rmean+3.*sigma;
     1066  do {
     1067      r = G4RandGauss::shoot(rmean,sigma); 
     1068     } while ((r < rlow) || (r > rhigh));   
     1069
     1070  return r;
     1071  */
    10331072}
    10341073
  • trunk/source/processes/electromagnetic/standard/src/G4WaterStopping.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4WaterStopping.cc,v 1.18 2009/06/19 10:39:48 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4WaterStopping.cc,v 1.21 2010/04/26 17:44:34 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828
    2929//---------------------------------------------------------------------------
     
    5454{
    5555  spline = splineFlag;
     56  dedx.reserve(17);
    5657  Initialise(corr);
    5758}
     
    6768{
    6869  G4double res = 0.0;
    69   if((iz > 26) || (iz < 3) || (iz > 18 && iz < 26)) return res;
    70   G4bool b;
     70  if((iz > 26) || (iz < 3) || (iz > 18 && iz < 26)) { return res; }
    7171  G4int idx = iz - 3;
    7272  G4double scaledEnergy = energy/A[idx];
    73   G4double emin = 0.025*MeV;
    7473  if(scaledEnergy < emin) {
    75     res = (dedx[idx])->GetValue(emin, b)*std::sqrt(scaledEnergy/emin);
     74    res = (*(dedx[idx]))[0]*std::sqrt(scaledEnergy/emin);
    7675  } else {
    77     res = (dedx[idx])->GetValue(scaledEnergy, b);
     76    res = (dedx[idx])->Value(scaledEnergy);
    7877  }
    7978  return res;
     
    8584                              G4double factor)
    8685{
    87   G4LPhysicsFreeVector* pv = new G4LPhysicsFreeVector(53,energy[0],energy[52]);
     86  G4LPhysicsFreeVector* pv = new G4LPhysicsFreeVector(53,energy[0]*MeV,energy[52]*MeV);
    8887  pv->SetSpline(spline);
    8988  dedx.push_back(pv);
    90   for(G4int i=0;i<53;i++) {
    91     pv->PutValues(i,energy[i],stoppower[i]*factor);
     89  for(G4int i=0; i<53; ++i) {
     90    pv->PutValues(i,energy[i]*MeV,stoppower[i]*factor);
    9291  }
    9392}
     
    101100  G4int zz[17] = {3, 4, 5, 6, 7, 8, 9, 10,11,12,13,14,15,16,17,18,26};
    102101  G4int aa[17] = {7, 9, 11, 12, 14, 16, 19, 20, 23, 24, 27, 28,31,32, 35,40,56};
    103   // G4double A_Ion[17] = {6.941,9.0122,10.811,12.011,14.007,15.999,18.998,20.180,22.990,24.305,26.982,28.086,30.974,32.065,35.453,39.948,55.845};
    104   for(i=0; i<17; i++) {
     102  for(i=0; i<17; ++i) {
    105103    Z[i] = zz[i];
    106104    A[i] = G4double(aa[i]);
     
    108106  //..Reduced energies
    109107  G4double E[53] = {0.025,0.03,0.04,0.05,0.06,0.07,0.08,0.09,0.1,0.15,0.2,0.25,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1,1.5,2,2.5,3,4,5,6,7,8,9,10,15,20,25,30,40,50,60,70,80,90,100,150,200,250,300,400,500,600,700,800,900,1000};
    110   for(i=0; i<53; i++) {E[i] *= MeV;}
    111 
     108  emin   = E[0]*MeV;
    112109  G4double factor = 1000.*MeV/cm;
    113110
     
    149146
    150147  if(corr) {
    151     for(i=0; i<17; i++) {corr->AddStoppingData(Z[i], aa[i], "G4_WATER", dedx[i]);}
     148    for(i=0; i<17; ++i) {corr->AddStoppingData(Z[i], aa[i], "G4_WATER", dedx[i]);}
    152149  }
    153150}
  • trunk/source/processes/electromagnetic/standard/src/G4WentzelVIModel.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4WentzelVIModel.cc,v 1.37 2009/10/28 10:14:13 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4WentzelVIModel.cc,v 1.60 2010/06/01 11:13:31 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    3939//
    4040// Modifications:
     41// 27-05-2010 V.Ivanchenko added G4WentzelOKandVIxSection class to
     42//              compute cross sections and sample scattering angle
    4143//
    4244//
     
    5759#include "G4WentzelVIModel.hh"
    5860#include "Randomize.hh"
    59 #include "G4LossTableManager.hh"
    6061#include "G4ParticleChangeForMSC.hh"
    6162#include "G4PhysicsTableHelper.hh"
    6263#include "G4ElementVector.hh"
    6364#include "G4ProductionCutsTable.hh"
    64 #include "G4PhysicsLogVector.hh"
    65 #include "G4Electron.hh"
    66 #include "G4Positron.hh"
    67 #include "G4Proton.hh"
    68 
    69 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    70 
    71 G4double G4WentzelVIModel::ScreenRSquare[] = {0.0};
    72 G4double G4WentzelVIModel::FormFactor[]    = {0.0};
     65#include "G4LossTableManager.hh"
     66#include "G4Pow.hh"
     67
     68//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    7369
    7470using namespace std;
     
    7773  G4VMscModel(nam),
    7874  theLambdaTable(0),
    79   theLambda2Table(0),
    80   numlimit(0.2),
    81   nbins(60),
    82   nwarnings(0),
    83   nwarnlimit(50),
     75  numlimit(0.1),
    8476  currentCouple(0),
    8577  cosThetaMin(1.0),
    86   q2Limit(TeV*TeV),
    87   alpha2(fine_structure_const*fine_structure_const),
    8878  isInitialized(false),
    8979  inside(false)
     
    9181  invsqrt12 = 1./sqrt(12.);
    9282  tlimitminfix = 1.e-6*mm;
    93   theManager = G4LossTableManager::Instance();
    94   fNistManager = G4NistManager::Instance();
    95   theElectron = G4Electron::Electron();
    96   thePositron = G4Positron::Positron();
    97   theProton   = G4Proton::Proton();
    98   lowEnergyLimit = 0.1*keV;
    99   G4double p0 = electron_mass_c2*classic_electr_radius;
    100   coeff  = twopi*p0*p0;
    101   tkin = targetZ = mom2 = DBL_MIN;
    102   ecut = etag = DBL_MAX;
     83  lowEnergyLimit = 1.0*eV;
    10384  particle = 0;
    10485  nelments = 5;
    10586  xsecn.resize(nelments);
    10687  prob.resize(nelments);
    107 
    108   // Thomas-Fermi screening radii
    109   // Formfactors from A.V. Butkevich et al., NIM A 488 (2002) 282
    110 
    111   if(0.0 == ScreenRSquare[0]) {
    112     G4double a0 = electron_mass_c2/0.88534;
    113     G4double constn = 6.937e-6/(MeV*MeV);
    114 
    115     ScreenRSquare[0] = alpha2*a0*a0;
    116     for(G4int j=1; j<100; j++) {
    117       G4double x = a0*fNistManager->GetZ13(j);
    118       ScreenRSquare[j] = alpha2*x*x;
    119       x = fNistManager->GetA27(j);
    120       FormFactor[j] = constn*x*x;
    121     }
    122   }
     88  theManager = G4LossTableManager::Instance();
     89  fG4pow = G4Pow::GetInstance();
     90  wokvi = new G4WentzelOKandVIxSection();
    12391}
    12492
     
    12694
    12795G4WentzelVIModel::~G4WentzelVIModel()
    128 {}
     96{
     97  delete wokvi;
     98}
    12999
    130100//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    135105  // reset parameters
    136106  SetupParticle(p);
    137   tkin = targetZ = mom2 = 0.0;
    138   ecut = etag = DBL_MAX;
    139107  currentRange = 0.0;
    140108  cosThetaMax = cos(PolarAngleLimit());
     109  wokvi->Initialise(p, cosThetaMax);
     110  /*
     111  G4cout << "G4WentzelVIModel: factorA2(GeV^2) = " << factorA2/(GeV*GeV)
     112         << "  1-cos(ThetaLimit)= " << 1 - cosThetaMax
     113         << G4endl;
     114  */
    141115  currentCuts = &cuts;
    142116
     
    157131                             G4double cutEnergy, G4double)
    158132{
    159   SetupParticle(p);
    160   if(kinEnergy < lowEnergyLimit) return 0.0;
    161   SetupKinematic(kinEnergy, cutEnergy);
    162   SetupTarget(Z, kinEnergy);
    163   G4double xsec = ComputeTransportXSectionPerAtom();
    164   /*   
    165   G4cout << "CS: e= " << tkin << " cosEl= " << cosTetMaxElec2
    166          << " cosN= " << cosTetMaxNuc2 << " xsec(bn)= " << xsec/barn
    167          << " " << particle->GetParticleName() << G4endl;
     133  G4double xsec = 0.0;
     134  if(p != particle) { SetupParticle(p); }
     135  if(kinEnergy < lowEnergyLimit) { return xsec; }
     136  DefineMaterial(CurrentCouple());
     137  cosTetMaxNuc = wokvi->SetupKinematic(kinEnergy, currentMaterial);
     138  if(cosTetMaxNuc < 1.0) {
     139    cosTetMaxNuc = wokvi->SetupTarget(G4int(Z), cutEnergy);
     140    xsec = wokvi->ComputeTransportCrossSectionPerAtom(cosTetMaxNuc);
     141  /*     
     142    G4cout << "G4WentzelVIModel::CS: Z= " << G4int(Z) << " e(MeV)= " << kinEnergy
     143           << " 1-cosN= " << 1 - costm << " xsec(bn)= " << xsec/barn
     144           << " " << particle->GetParticleName() << G4endl;
    168145  */
     146  }
    169147  return xsec;
    170 }
    171 
    172 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    173 
    174 G4double G4WentzelVIModel::ComputeTransportXSectionPerAtom()
    175 {
    176   G4double xSection = 0.0;
    177   G4double x, y, x1, x2, x3, x4;
    178 
    179   // scattering off electrons
    180   if(cosTetMaxElec2 < 1.0) {
    181     x = (1.0 - cosTetMaxElec2)/screenZ;
    182     if(x < numlimit) y = 0.5*x*x*(1.0 - 1.3333333*x + 1.5*x*x);
    183     else             y = log(1.0 + x) - x/(1.0 + x);
    184     if(y < 0.0) {
    185       nwarnings++;
    186       if(nwarnings < nwarnlimit /*&& y < -1.e-10*/) {
    187         G4cout << "Electron scattering <0 for L1 " << y
    188                << " e(MeV)= " << tkin << " p(MeV/c)= " << sqrt(mom2)
    189                << " Z= " << targetZ << "  "
    190                << particle->GetParticleName() << G4endl;
    191         G4cout << " z= " << 1.0-cosTetMaxElec2 << " screenZ= " << screenZ
    192                << " x= " << x << G4endl;
    193       }
    194       y = 0.0;
    195     }
    196     xSection = y;
    197   }
    198   /* 
    199   G4cout << "G4WentzelVI:XS per A " << " Z= " << targetZ
    200          << " e(MeV)= " << tkin/MeV << " XSel= " << xSection
    201          << " cut(MeV)= " << ecut/MeV 
    202          << " zmaxE= " << (1.0 - cosTetMaxElec)/screenZ
    203          << " zmaxN= " << (1.0 - cosTetMaxNuc2)/screenZ
    204          << " costm= " << cosTetMaxNuc2 << G4endl;
    205   */
    206   // scattering off nucleus
    207   if(cosTetMaxNuc2 < 1.0) {
    208     x  = 1.0 - cosTetMaxNuc2;
    209     x1 = screenZ*formfactA;
    210     x2 = 1.0 - x1;
    211     x3 = x/screenZ;
    212     x4 = formfactA*x;
    213     // low-energy limit
    214     if(x3 < numlimit && x1 < numlimit) {
    215       y = 0.5*x3*x3*(1.0 - 1.3333333*x3 + 1.5*x3*x3 - 1.5*x1
    216                      + 3.0*x1*x1 + 2.666666*x3*x1)/(x2*x2*x2);
    217       // high energy limit
    218     } else if(x2 <= 0.0) {
    219       x4 = x1*(1.0 + x3);
    220       y  = x3*(1.0 + 0.5*x3 - (2.0 - x1)*(1.0 + x3 + x3*x3/3.0)/x4)/(x4*x4);
    221       // middle energy
    222     } else {
    223       y = ((1.0 + x1)*x2*log((1. + x3)/(1. + x4))
    224            - x3/(1. + x3) - x4/(1. + x4))/(x2*x2);
    225     }
    226     //G4cout << "y= " << y << " x1= " <<x1<<"  x2= " <<x2
    227     //     <<"  x3= "<<x3<<"  x4= " << x4<<G4endl;
    228     if(y < 0.0) {
    229       nwarnings++;
    230       if(nwarnings < nwarnlimit /*&& y < -1.e-10*/) {
    231         G4cout << "Nuclear scattering <0 for L1 " << y
    232                << " e(MeV)= " << tkin << " Z= " << targetZ << "  "
    233                << particle->GetParticleName() << G4endl;
    234         G4cout << " formfactA= " << formfactA << " screenZ= " << screenZ
    235                << " x= " << " x1= " << x1 << " x2= " << x2
    236                << " x3= " << x3 << " x4= " << x4 <<G4endl;
    237       }
    238       y = 0.0;
    239     }
    240     xSection += y*targetZ;
    241   }
    242   xSection *= kinFactor;
    243   /*
    244   G4cout << "Z= " << targetZ << " XStot= " << xSection/barn
    245          << " screenZ= " << screenZ << " formF= " << formfactA
    246          << " for " << particle->GetParticleName()
    247          << " m= " << mass << " 1/v= " << sqrt(invbeta2) << " p= " << sqrt(mom2)
    248          << " x= " << x
    249          << G4endl;
    250   */
    251   return xSection;
    252148}
    253149
     
    263159  G4StepPoint* sp = track.GetStep()->GetPreStepPoint();
    264160  G4StepStatus stepStatus = sp->GetStepStatus();
     161  //G4cout << "G4WentzelVIModel::ComputeTruePathLengthLimit stepStatus= "
     162  //     << stepStatus << G4endl;
    265163
    266164  // initialisation for 1st step 
     
    268166    inside = false;
    269167    SetupParticle(dp->GetDefinition());
    270     theLambdaTable = theTable;
    271168  }
    272169
     
    274171  preKinEnergy  = dp->GetKineticEnergy();
    275172  DefineMaterial(track.GetMaterialCutsCouple());
    276   lambda0 = GetLambda(preKinEnergy);
     173  theLambdaTable = theTable;
     174  lambdaeff = GetLambda(preKinEnergy);
    277175  currentRange =
    278176    theManager->GetRangeFromRestricteDEDX(particle,preKinEnergy,currentCouple);
     177  cosTetMaxNuc = wokvi->SetupKinematic(preKinEnergy, currentMaterial);
    279178
    280179  // extra check for abnormal situation
    281180  // this check needed to run MSC with eIoni and eBrem inactivated
    282   if(tlimit > currentRange) tlimit = currentRange;
     181  if(tlimit > currentRange) { tlimit = currentRange; }
    283182
    284183  // stop here if small range particle
    285   if(inside) return tlimit;   
     184  if(inside) { return tlimit; }
    286185
    287186  // pre step
     
    290189  // compute presafety again if presafety <= 0 and no boundary
    291190  // i.e. when it is needed for optimization purposes
    292   if(stepStatus != fGeomBoundary && presafety < tlimitminfix)
     191  if(stepStatus != fGeomBoundary && presafety < tlimitminfix) {
    293192    presafety = ComputeSafety(sp->GetPosition(), tlimit);
     193  }
    294194  /*
    295   G4cout << "G4WentzelVIModel::ComputeTruePathLengthLimit tlimit= "
    296          <<tlimit<<" safety= " << presafety
    297          << " range= " <<currentRange<<G4endl;
     195  G4cout << "e(MeV)= " << preKinEnergy/MeV
     196         << "  " << particle->GetParticleName()
     197         << " CurLimit(mm)= " << tlimit/mm <<" safety(mm)= " << presafety/mm
     198         << " R(mm)= " <<currentRange/mm
     199         << " L0(mm^-1)= " << lambdaeff*mm
     200         <<G4endl;
    298201  */
    299202  // far from geometry boundary
    300203  if(currentRange < presafety) {
    301204    inside = true; 
    302    
    303     // limit mean scattering angle
    304   } else {
    305     G4double rlimit = facrange*lambda0;
    306     G4double rcut = currentCouple->GetProductionCuts()->GetProductionCut(1);
    307     if(rcut > rlimit) rlimit = std::pow(rcut*rcut*rlimit,0.33333333);
    308     rlimit = std::min(rlimit, facgeom*currentMaterial->GetRadlen());
    309     if(rlimit < tlimit) tlimit = rlimit;
    310   }
    311   /*
     205    return tlimit;
     206  }
     207
     208  // natural limit for high energy
     209  G4double rlimit = std::max(facrange*currentRange,
     210                             0.7*(1.0 - cosTetMaxNuc)*lambdaeff);
     211
     212  // low-energy e-
     213  if(cosThetaMax > cosTetMaxNuc) {
     214    rlimit = std::min(rlimit, facsafety*presafety);
     215  }
     216   
     217  // cut correction
     218  G4double rcut = currentCouple->GetProductionCuts()->GetProductionCut(1);
     219  //G4cout << "rcut= " << rcut << " rlimit= " << rlimit << " presafety= " << presafety
     220  // << " 1-cosThetaMax= " <<1-cosThetaMax << " 1-cosTetMaxNuc= " << 1-cosTetMaxNuc
     221  // << G4endl;
     222  if(rcut > rlimit) { rlimit = std::min(rlimit, rcut*sqrt(rlimit/rcut)); }
     223
     224  if(rlimit < tlimit) { tlimit = rlimit; }
     225
     226  tlimit = std::max(tlimit, tlimitminfix);
     227
     228  // step limit in infinite media
     229  tlimit = std::min(tlimit, 20*currentMaterial->GetRadlen());
     230  /* 
    312231  G4cout << particle->GetParticleName() << " e= " << preKinEnergy
    313          << " L0= " << lambda0 << " R= " << currentRange
     232         << " L0= " << lambdaeff << " R= " << currentRange
    314233         << "tlimit= " << tlimit 
    315234         << " currentMinimalStep= " << currentMinimalStep << G4endl;
     
    324243  tPathLength  = truelength;
    325244  zPathLength  = tPathLength;
    326   lambdaeff    = lambda0;
    327 
    328   if(lambda0 > 0.0) {
    329     G4double tau = tPathLength/lambda0;
     245
     246  if(lambdaeff > 0.0) {
     247    G4double tau = tPathLength/lambdaeff;
    330248    //G4cout << "ComputeGeomPathLength: tLength= " << tPathLength
    331     //   << " lambda0= " << lambda0 << " tau= " << tau << G4endl;
     249    //   << " Leff= " << lambdaeff << " tau= " << tau << G4endl;
    332250    // small step
    333251    if(tau < numlimit) {
     
    336254      // medium step
    337255    } else {
    338       //      zPathLength = lambda0*(1.0 - exp(-tPathLength/lambda0));
    339256      G4double e1 = 0.0;
    340257      if(currentRange > tPathLength) {
     
    343260                                   currentCouple);
    344261      }
    345       lambdaeff = GetLambda(0.5*(e1 + preKinEnergy));
     262      e1 = 0.5*(e1 + preKinEnergy);
     263      cosTetMaxNuc = wokvi->SetupKinematic(e1, currentMaterial);
     264      lambdaeff = GetLambda(e1);
    346265      zPathLength = lambdaeff*(1.0 - exp(-tPathLength/lambdaeff));
    347266    }
     
    355274G4double G4WentzelVIModel::ComputeTrueStepLength(G4double geomStepLength)
    356275{
    357   // step defined other than transportation
    358   if(geomStepLength == zPathLength) return tPathLength;
     276  // initialisation of single scattering x-section
     277  xtsec = 0.0;
     278
     279  // pathalogical case
     280  if(lambdaeff <= 0.0) {
     281    zPathLength = geomStepLength;
     282    tPathLength = geomStepLength;
     283    return tPathLength;
     284  }
     285
     286  G4double tau = geomStepLength/lambdaeff;
    359287
    360288  // step defined by transportation
    361   tPathLength  = geomStepLength;
    362   zPathLength  = geomStepLength;
    363   G4double tau = zPathLength/lambdaeff;
    364   tPathLength *= (1.0 + 0.5*tau + tau*tau/3.0);
    365 
    366   if(tau > numlimit) {
    367     G4double e1 = 0.0;
    368     if(currentRange > tPathLength) {
    369       e1 = theManager->GetEnergy(particle,
    370                                  currentRange-tPathLength,
    371                                  currentCouple);
    372     }
    373     lambdaeff = GetLambda(0.5*(e1 + preKinEnergy));
    374     tau = zPathLength/lambdaeff;
    375 
    376     if(tau < 0.999999) tPathLength = -lambdaeff*log(1.0 - tau);
    377     else               tPathLength = currentRange;
    378 
    379     if(tPathLength < zPathLength) tPathLength = zPathLength;
    380   }
    381   if(tPathLength > currentRange) tPathLength = currentRange;
    382   //G4cout<<"Comp.true: zLength= "<<zPathLength<<" tLength= "<<tPathLength<<G4endl;
     289  if(geomStepLength != zPathLength) {
     290
     291    // step defined by transportation
     292    zPathLength = geomStepLength;
     293    tPathLength = zPathLength*(1.0 + 0.5*tau + tau*tau/3.0);
     294
     295    // energy correction for a big step
     296    if(tau > numlimit) {
     297      G4double e1 = 0.0;
     298      if(currentRange > tPathLength) {
     299        e1 = theManager->GetEnergy(particle,
     300                                   currentRange-tPathLength,
     301                                   currentCouple);
     302      }
     303      e1 = 0.5*(e1 + preKinEnergy);
     304      cosTetMaxNuc = wokvi->SetupKinematic(e1, currentMaterial);
     305      lambdaeff = GetLambda(e1);
     306      tau = zPathLength/lambdaeff;
     307     
     308      if(tau < 0.999999) { tPathLength = -lambdaeff*log(1.0 - tau); }
     309      else               { tPathLength = currentRange; }
     310    }
     311  }
     312
     313  // check of step length
     314  // define threshold angle between single and multiple scattering
     315  cosThetaMin = 1.0 - 1.5*tPathLength/lambdaeff;
     316
     317  // recompute transport cross section - do not change energy
     318  // anymore - cannot be applied for big steps
     319  if(cosThetaMin > cosTetMaxNuc) {
     320
     321    // new computation
     322    G4double xsec = ComputeXSectionPerVolume();
     323    //G4cout << "%%%% xsec= " << xsec << "  xtsec= " << xtsec << G4endl;
     324    if(xtsec > 0.0) {
     325      if(xsec > 0.0) { lambdaeff = 1./xsec; }
     326      else           { lambdaeff = DBL_MAX; }
     327
     328      tau = zPathLength*xsec;
     329      if(tau < numlimit) { tPathLength = zPathLength*(1.0 + 0.5*tau + tau*tau/3.0); }
     330      else if(tau < 0.999999) { tPathLength = -lambdaeff*log(1.0 - tau); }
     331      else               { tPathLength = currentRange; }
     332    }
     333  }
     334
     335  if(tPathLength > currentRange) { tPathLength = currentRange; }
     336  if(tPathLength < zPathLength)  { tPathLength = zPathLength; }
     337  /*   
     338  G4cout <<"Comp.true: zLength= "<<zPathLength<<" tLength= "<<tPathLength
     339         <<" Leff(mm)= "<<lambdaeff/mm<<" sig0(1/mm)= " << xtsec <<G4endl;
     340  G4cout << particle->GetParticleName() << " 1-cosThetaMin= " << 1-cosThetaMin
     341         << " 1-cosTetMaxNuc= " << 1-cosTetMaxNuc
     342         << " e(MeV)= " << preKinEnergy/MeV << G4endl;
     343  */
    383344  return tPathLength;
    384345}
     
    391352  //G4cout << "!##! G4WentzelVIModel::SampleScattering for "
    392353  //     << particle->GetParticleName() << G4endl;
    393   G4double kinEnergy = dynParticle->GetKineticEnergy();
    394 
    395   // ignore scattering for zero step length and enegy below the limit
    396   if(kinEnergy < lowEnergyLimit || tPathLength <= DBL_MIN) return;
    397 
    398   G4double ekin = preKinEnergy;
    399   if(ekin - kinEnergy > ekin*dtrl) {
    400     ekin = 0.5*(preKinEnergy + kinEnergy);
    401     lambdaeff = GetLambda(ekin);
    402   } 
     354
     355  // ignore scattering for zero step length and energy below the limit
     356  if(dynParticle->GetKineticEnergy() < lowEnergyLimit ||
     357     tPathLength <= DBL_MIN || lambdaeff <= DBL_MIN)
     358    { return; }
    403359 
    404   G4double x1 = 0.5*tPathLength/lambdaeff;
    405   G4double cut= (*currentCuts)[currentMaterialIndex];
    406   /* 
    407   G4cout <<"SampleScat: E0(MeV)= "<< preKinEnergy<<" Eeff(MeV)= "<<ekin/MeV
    408          << " L0= " << lambda0 << " Leff= " << lambdaeff
    409          << " x1= " << x1 << " safety= " << safety << G4endl;
     360  G4double invlambda = 0.0;
     361  if(lambdaeff < DBL_MAX) { invlambda = 0.5/lambdaeff; }
     362
     363  // use average kinetic energy over the step
     364  G4double cut = (*currentCuts)[currentMaterialIndex];
     365  /*     
     366  G4cout <<"SampleScat: E0(MeV)= "<< preKinEnergy/MeV
     367         << " Leff= " << lambdaeff <<" sig0(1/mm)= " << xtsec
     368         << " x1= " <<  tPathLength*invlambda << " safety= " << safety << G4endl;
    410369  */
    411370
    412   G4double xsec = 0.0;
    413   G4bool largeAng = false;
    414 
    415   // large scattering angle case
    416   if(x1 > 0.5) {
    417     x1 *= 0.5;
    418     largeAng = true;
    419 
    420     // normal case
    421   } else {
    422 
    423     // define threshold angle between single and multiple scattering
    424     cosThetaMin = 1.0 - 3.0*x1;
    425 
    426     // for low-energy e-,e+ no limit
    427     SetupKinematic(ekin, cut);
    428  
    429     // recompute transport cross section
    430     if(cosThetaMin > cosTetMaxNuc) {
    431 
    432       xsec = ComputeXSectionPerVolume();
    433 
    434       if(xtsec > 0.0) x1 = 0.5*tPathLength*xtsec;
    435       else            x1 = 0.0;
    436 
    437       /*     
    438         G4cout << "cosTetMaxNuc= " << cosTetMaxNuc
    439         << " cosThetaMin= " << cosThetaMin
    440         << " cosThetaMax= " << cosThetaMax
    441         << " cosTetMaxElec2= " << cosTetMaxElec2 << G4endl;
    442         G4cout << "Recomputed xsec(1/mm)= " << xsec << " x1= " << x1 << G4endl;
    443       */
    444     }
    445   }
    446 
    447   // result of central part sampling
    448   G4double z;
     371  G4double length = tPathLength;
     372  G4double lengthlim = tPathLength*1.e-6;
     373
     374  // step limit due msc
     375  G4double x0 = length;
     376  // large scattering angle case - two step approach
     377  if(tPathLength*invlambda > 0.5 && length > tlimitminfix) { x0 *= 0.5; }
     378
     379  // step limit due single scattering
     380  G4double x1 = length;
     381  if(xtsec > 0.0) { x1 = -log(G4UniformRand())/xtsec; }
     382
     383  const G4ElementVector* theElementVector =
     384    currentMaterial->GetElementVector();
     385  G4int nelm = currentMaterial->GetNumberOfElements();
     386
     387  // geometry
     388  G4double sint, cost, phi;
     389  G4ThreeVector oldDirection = dynParticle->GetMomentumDirection();
     390  G4ThreeVector temp(0.0,0.0,1.0);
     391
     392  // current position and direction relative to the end point
     393  // because of magnetic field geometry is computed relatively to the
     394  // end point of the step
     395  G4ThreeVector dir(0.0,0.0,1.0);
     396  G4ThreeVector pos(0.0,0.0,-zPathLength);
     397  G4double mscfac = zPathLength/tPathLength;
     398
     399  // start a loop
    449400  do {
    450     z = -x1*log(G4UniformRand());
    451   } while (z > 1.0);
    452 
    453   // cost is sampled ------------------------------
    454   G4double cost = 1.0 - 2.0*z;
    455   //  if(cost < -1.0) cost = -1.0;
    456   // else if(cost > 1.0) cost = 1.0;
    457   G4double sint = sqrt((1.0 - cost)*(1.0 + cost));
    458 
    459   G4double phi  = twopi*G4UniformRand();
    460 
    461   G4double dirx = sint*cos(phi);
    462   G4double diry = sint*sin(phi);
    463  
    464   //G4cout << "G4WentzelVIModel: step(mm)= " << tPathLength/mm
    465   //     << " sint= " << sint << " cost= " << cost<< G4endl;
    466  
    467   G4ThreeVector oldDirection = dynParticle->GetMomentumDirection();
    468   G4ThreeVector newDirection(dirx,diry,cost);
    469   G4ThreeVector temp(0.0,0.0,1.0);
    470   G4ThreeVector pos(0.0,0.0,-zPathLength);
    471   G4ThreeVector dir(0.0,0.0,1.0);
    472   G4bool isscat = false;
    473 
    474   // sample MSC scattering for large angle
    475   // extra central scattering for half step
    476   if(largeAng) {
    477     isscat = true;
    478     pos.setZ(-0.5*zPathLength);
    479     do {
    480       z = -x1*log(G4UniformRand());
    481     } while (z > 1.0);
     401    G4double step = x0;
     402    G4bool singleScat = false;
     403
     404    // single scattering case
     405    if(x1 < x0) {
     406      step = x1;
     407      singleScat = true;
     408    }
     409
     410    // new position
     411    pos += step*mscfac*dir;
     412
     413    // added multiple scattering
     414    G4double z;
     415    G4double tet2 = step*invlambda; 
     416    do { z = -tet2*log(G4UniformRand()); } while (z >= 1.0);
     417
    482418    cost = 1.0 - 2.0*z;
    483     //if(std::fabs(cost) > 1.0) cost = 1.0;
    484 
    485419    sint = sqrt((1.0 - cost)*(1.0 + cost));
    486420    phi  = twopi*G4UniformRand();
    487 
    488     // position and direction for secondary scattering
    489     dir.set(sint*cos(phi),sint*sin(phi),cost);
    490     pos += 0.5*dir*zPathLength;
    491     x1 *= 2.0;
    492   }
    493 
    494   // sample Rutherford scattering for large angle
    495   if(xsec > DBL_MIN) {
    496     G4double t = tPathLength;
    497     G4int nelm = currentMaterial->GetNumberOfElements();
    498     const G4ElementVector* theElementVector =
    499       currentMaterial->GetElementVector();
    500     do{
    501       G4double x  = -log(G4UniformRand())/xsec;     
    502       pos += dir*(zPathLength*std::min(x,t)/tPathLength);
    503       t -= x;
    504       if(t > 0.0) {
    505         G4double zz1 = 1.0;
    506         G4double qsec = G4UniformRand()*xsec;
    507 
    508         // scattering off nucleus
    509         G4int i = 0;
    510         if(nelm > 1) {
    511           for (; i<nelm; i++) {if(xsecn[i] >= qsec) break;}
    512           if(i >= nelm) i = nelm - 1;
    513         }
    514         SetupTarget((*theElementVector)[i]->GetZ(), tkin);
    515         G4double formf = formfactA;
    516         G4double costm = cosTetMaxNuc2;
    517         if(prob[i] > 0.0) {
    518           if(G4UniformRand() <= prob[i]) {
    519             formf = 0.0;
    520             costm = cosTetMaxElec2;
    521           }
    522         }
    523         if(cosThetaMin > costm) {
    524 
    525           G4double w1 = 1. - cosThetaMin + screenZ;
    526           G4double w2 = 1. - costm + screenZ;
    527           G4double w3 = cosThetaMin - costm;
    528           G4double grej, zz;
    529           do {
    530             zz = w1*w2/(w1 + G4UniformRand()*w3) - screenZ;
    531             grej = 1.0/(1.0 + formf*zz);
    532           } while ( G4UniformRand() > grej*grej ); 
    533           if(zz < 0.0) zz = 0.0;
    534           else if(zz > 2.0) zz = 2.0;
    535           zz1 = 1.0 - zz;
    536         }
    537         if(zz1 < 1.0) {
    538           isscat = true;
    539           //G4cout << "Rutherford zz1= " << zz1 << " t= " << t << G4endl;
    540           sint = sqrt((1.0 - zz1)*(1.0 + zz1));
    541           //G4cout << "sint= " << sint << G4endl;
    542           phi  = twopi*G4UniformRand();
    543           G4double vx1 = sint*cos(phi);
    544           G4double vy1 = sint*sin(phi);
    545           temp.set(vx1,vy1,zz1);
    546           temp.rotateUz(dir);
    547           dir = temp;
    548         }
     421    G4double vx1 = sint*cos(phi);
     422    G4double vy1 = sint*sin(phi);
     423
     424    // lateral displacement 
     425    if (latDisplasment && safety > tlimitminfix) {
     426      G4double rms = invsqrt12*sqrt(2.0*tet2);
     427      G4double dx = step*(0.5*vx1 + rms*G4RandGauss::shoot(0.0,1.0));
     428      G4double dy = step*(0.5*vy1 + rms*G4RandGauss::shoot(0.0,1.0));
     429      G4double dz;
     430      G4double d = (dx*dx + dy*dy)/(step*step);
     431      if(d < numlimit)  { dz = -0.5*step*d*(1.0 + 0.25*d); }
     432      else if(d < 1.0)  { dz = -step*(1.0 - sqrt(1.0 - d));}
     433      else              { dx = dy = dz = 0.0; }
     434
     435      // change position
     436      temp.set(dx,dy,dz);
     437      temp.rotateUz(dir);
     438      pos += temp;
     439    }
     440
     441    // direction is changed
     442    temp.set(vx1,vy1,cost);
     443    temp.rotateUz(dir);
     444    dir = temp;
     445
     446    if(singleScat) {
     447
     448      // select element
     449      G4int i = 0;
     450      if(nelm > 1) {
     451        G4double qsec = G4UniformRand()*xtsec;
     452        for (; i<nelm; ++i) { if(xsecn[i] >= qsec) { break; } }
     453        if(i >= nelm) { i = nelm - 1; }
    549454      }
    550     } while (t > 0.0);
    551   }
    552   if(isscat) newDirection.rotateUz(dir);
    553   newDirection.rotateUz(oldDirection);
     455      G4double cosTetM =
     456        wokvi->SetupTarget(G4int((*theElementVector)[i]->GetZ()), cut);
     457      temp = wokvi->SampleSingleScattering(cosThetaMin, cosTetM, prob[i]);
     458      temp.rotateUz(dir);
     459
     460      // renew direction
     461      dir = temp;
     462
     463      // new single scatetring
     464      x1 = -log(G4UniformRand())/xtsec;
     465    }
     466
     467    // update step
     468    length -= step;
     469
     470  } while (length > lengthlim);
     471   
     472  dir.rotateUz(oldDirection);
     473  pos.rotateUz(oldDirection);
    554474
    555475  //G4cout << "G4WentzelVIModel sampling of scattering is done" << G4endl;
    556476  // end of sampling -------------------------------
    557477
    558   fParticleChange->ProposeMomentumDirection(newDirection);
    559 
    560   if (latDisplasment && safety > tlimitminfix) {
    561     G4double rms = invsqrt12*sqrt(2.0*x1);
    562     G4double dx = zPathLength*(0.5*dirx + rms*G4RandGauss::shoot(0.0,1.0));
    563     G4double dy = zPathLength*(0.5*diry + rms*G4RandGauss::shoot(0.0,1.0));
    564     G4double dz;
    565     G4double d = (dx*dx + dy*dy)/(zPathLength*zPathLength);
    566     if(d < numlimit)  dz = -0.5*zPathLength*d*(1.0 + 0.25*d);
    567     else if(d < 1.0)  dz = -zPathLength*(1.0 - sqrt(1.0 - d));
    568     else {
    569       dx = dy = dz = 0.0;
    570     }
    571 
    572     temp.set(dx,dy,dz);
    573     if(isscat) temp.rotateUz(dir);
    574     pos += temp;
    575    
    576     pos.rotateUz(oldDirection);
    577 
     478  fParticleChange->ProposeMomentumDirection(dir);
     479
     480  // lateral displacement 
     481  if (latDisplasment) {
    578482    G4double r = pos.mag();
    579483
     
    597501G4double G4WentzelVIModel::ComputeXSectionPerVolume()
    598502{
    599   const G4ElementVector* theElementVector =
    600     currentMaterial->GetElementVector();
     503  // prepare recomputation of x-sections
     504  const G4ElementVector* theElementVector = currentMaterial->GetElementVector();
    601505  const G4double* theAtomNumDensityVector =
    602506    currentMaterial->GetVecNbOfAtomsPerVolume();
     
    604508  if(nelm > nelments) {
    605509    nelments = nelm;
    606     xsecn.resize(nelments);
    607     prob.resize(nelments);
    608   }
    609 
     510    xsecn.resize(nelm);
     511    prob.resize(nelm);
     512  }
     513  G4double cut = (*currentCuts)[currentMaterialIndex];
     514  cosTetMaxNuc = wokvi->GetCosThetaNuc();
     515
     516  // check consistency
    610517  xtsec = 0.0;
     518  if(cosTetMaxNuc > cosThetaMin) { return 0.0; }
     519
     520  // loop over elements
    611521  G4double xs = 0.0;
    612 
    613   for (G4int i=0; i<nelm; i++) {
    614     SetupTarget((*theElementVector)[i]->GetZ(), tkin);
     522  for (G4int i=0; i<nelm; ++i) {
     523    G4double costm =
     524      wokvi->SetupTarget(G4int((*theElementVector)[i]->GetZ()), cut);
    615525    G4double density = theAtomNumDensityVector[i];
    616     G4double cosnm = cosTetMaxNuc2;
    617     G4double cosem = cosTetMaxElec2;
    618 
    619     // recompute the angular limit
    620     cosTetMaxNuc2  = std::max(cosnm,cosThetaMin);
    621     cosTetMaxElec2 = std::max(cosem,cosThetaMin);
    622     xtsec += ComputeTransportXSectionPerAtom()*density;
    623     // return limit back
    624     cosTetMaxElec2 = cosem;
    625     cosTetMaxNuc2  = cosnm;
    626526
    627527    G4double esec = 0.0;
    628     G4double nsec = 0.0;
    629     G4double x1 = 1.0 - cosThetaMin + screenZ;
    630     G4double f  = kinFactor*density;
    631 
    632     // scattering off electrons
    633     if(cosThetaMin > cosem) {
    634       esec = f*(cosThetaMin - cosem)/(x1*(1.0 - cosem + screenZ));
    635     }
    636 
    637     // scattering off nucleaus
    638     if(cosThetaMin > cosnm) {
    639 
    640       // Rutherford part
    641       G4double s  = screenZ*formfactA;
    642       G4double z1 = 1.0 - cosnm + screenZ;
    643       G4double s1 = 1.0 - s;
    644       G4double d  = s1/formfactA;
    645 
    646       // check numerical limit
    647       if(d < numlimit*x1) {
    648         G4double x2 = x1*x1;
    649         G4double z2 = z1*z1;
    650         nsec = (1.0/(x1*x2) - 1.0/(z1*z2) - d*1.5*(1.0/(x2*x2) - 1.0/(z2*z2)))/
    651           (3.0*formfactA*formfactA);
    652       } else {
    653         G4double x2 = x1 + d;
    654         G4double z2 = z1 + d;
    655         nsec = (1.0/x1 - 1.0/z1 + 1.0/x2 - 1.0/z2 - 2.0*log(z1*x2/(z2*x1))/d)/(s1*s1);
    656       }
    657       nsec *= f*targetZ;
    658     }
    659     nsec += esec;
    660     if(nsec > 0.0) esec /= nsec;
    661     xs += nsec;
    662     xsecn[i] = xs;
     528    if(costm < cosThetaMin) { 
     529
     530      // recompute the transport x-section
     531      xs += density*wokvi->ComputeTransportCrossSectionPerAtom(cosThetaMin);
     532
     533      // recompute the total x-section
     534      G4double nsec = wokvi->ComputeNuclearCrossSection(cosThetaMin, costm);
     535      esec = wokvi->ComputeElectronCrossSection(cosThetaMin, costm);
     536      nsec += esec;
     537      if(nsec > 0.0) { esec /= nsec; }
     538      xtsec += nsec*density;
     539    }
     540    xsecn[i] = xtsec;
    663541    prob[i]  = esec;
    664     //G4cout << i << "  xs= " << xs << " cosThetaMin= " << cosThetaMin
    665     //     << " costm= " << costm << G4endl;
     542    //G4cout << i << "  xs= " << xs << " xtsec= " << xtsec << " 1-cosThetaMin= " << 1-cosThetaMin
     543    //     << " 1-cosTetMaxNuc2= " <<1-cosTetMaxNuc2<< G4endl;
    666544  }
    667545 
    668546  //G4cout << "ComputeXS result:  xsec(1/mm)= " << xs
    669   //<< " txsec(1/mm)= " << xtsec <<G4endl;
     547  //     << " txsec(1/mm)= " << xtsec <<G4endl;
    670548  return xs;
    671549}
    672550
    673551//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    674 
    675 /*
    676 G4double G4MuMscModel::ComputeXSectionPerVolume()
    677 {
    678   const G4ElementVector* theElementVector =
    679     currentMaterial->GetElementVector();
    680   const G4double* theAtomNumDensityVector =
    681     currentMaterial->GetVecNbOfAtomsPerVolume();
    682   size_t nelm = currentMaterial->GetNumberOfElements();
    683 
    684   xsece1 = 0.0;
    685   xsece2 = 0.0;
    686   xsecn2 = 0.0;
    687   zcorr  = 0.0;
    688 
    689   G4double fac = coeff*chargeSquare*invbeta2/mom2;
    690 
    691   for (size_t i=0; i<nelm; i++) {
    692     const G4Element* elm = (*theElementVector)[i];
    693     G4double Z = elm->GetZ();
    694     SetupTarget(Z, tkin);
    695     G4double den = fac*theAtomNumDensityVector[i]*Z;
    696 
    697     G4double x  = 1.0 - cosThetaMin;
    698     G4double x1 = x + screenZ;
    699     G4double x2 = 1.0/(x1*x1);
    700     G4double x3 = 1.0 + x*formfactA;
    701    
    702     //G4cout << "x= " << x << " den= " << den << " cosE= " << cosTetMaxElec << G4endl;
    703     //G4cout << "cosThtaMin= " << cosThetaMin << G4endl;
    704     //G4cout << "cosTetMaxNuc= " << cosTetMaxNuc << " q2Limit= " << q2Limit << G4endl;
    705    
    706     // scattering off electrons
    707     if(cosTetMaxElec < cosThetaMin) {
    708 
    709       // flat part
    710       G4double s = den*x2*x;
    711       xsece1 += s;
    712       zcorr  += 0.5*x*s;
    713 
    714       // Rutherford part
    715       G4double z1 = 1.0 - cosTetMaxElec + screenZ;
    716       G4double z2 = (cosThetaMin - cosTetMaxElec)/x1;
    717       if(z2 < 0.2) s = z2*(x - 0.5*z2*(x - screenZ))/x1;
    718       else         s = log(1.0 + z2)  - screenZ*z2/z1;
    719       xsece2  += den*z2/z1;
    720       zcorr   += den*s;
    721     }
    722     den *= Z;
    723 
    724     //G4cout << "Z= " << Z<< " cosL= " << cosTetMaxNuc << " cosMin= " << cosThetaMin << G4endl;
    725     // scattering off nucleaus
    726     if(cosTetMaxNuc < cosThetaMin) {
    727 
    728       // flat part
    729       G4double s = den*x2*x/(x3*x3);
    730       xsece1 += s;
    731       zcorr  += 0.5*x*s;
    732 
    733       // Rutherford part
    734       s  = screenZ*formfactA;
    735       G4double w  = 1.0 + 2.0*s;
    736       G4double z1 = 1.0 - cosTetMaxNuc + screenZ;
    737       G4double d  = (1.0 - s)/formfactA;
    738       G4double x4 = x1 + d;
    739       G4double z4 = z1 + d;
    740       G4double t1 = 1.0/(x1*z1);
    741       G4double t4 = 1.0/(x4*z4);
    742       G4double w1 = cosThetaMin - cosTetMaxNuc;
    743       G4double w2 = log(z1*x4/(x1*z4));
    744 
    745       den *= w;     
    746       xsecn2  += den*(w1*(t1 + t4) - 2.0*w2/d);
    747       zcorr   += den*(w*w2 - w1*(screenZ*t1 + t4/formfactA));
    748     }
    749     xsece[i] = xsece2;
    750     xsecn[i] = xsecn2;
    751     //    G4cout << i << "  xsece2= " << xsece2 << "  xsecn2= " << xsecn2 << G4endl;
    752   }
    753   G4double xsec = xsece1 + xsece2 + xsecn2;
    754  
    755     //G4cout << "xsece1= " << xsece1 << "  xsece2= " << xsece2
    756     //<< "  xsecn2= " << xsecn2
    757         // << " zsec= " << zcorr*0.5*tPathLength << G4endl;
    758   zcorr *= 0.5*tPathLength;
    759 
    760   return xsec;
    761 }
    762 */
    763 
    764 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    765 
    766 void G4WentzelVIModel::ComputeMaxElectronScattering(G4double cutEnergy)
    767 {
    768   ecut = cutEnergy;
    769   G4double tmax = tkin;
    770   cosTetMaxElec = 1.0;
    771   if(mass > MeV) {
    772     G4double ratio = electron_mass_c2/mass;
    773     G4double tau = tkin/mass;
    774     tmax = 2.0*electron_mass_c2*tau*(tau + 2.)/
    775       (1.0 + 2.0*ratio*(tau + 1.0) + ratio*ratio);
    776     cosTetMaxElec = 1.0 - std::min(cutEnergy, tmax)*electron_mass_c2/mom2;
    777   } else {
    778 
    779     if(particle == theElectron) tmax *= 0.5;
    780     G4double t = std::min(cutEnergy, tmax);
    781     G4double mom21 = t*(t + 2.0*electron_mass_c2);
    782     G4double t1 = tkin - t;
    783     //G4cout <<"tkin=" <<tkin<<" tmax= "<<tmax<<" t= "
    784     //<<t<< " t1= "<<t1<<" cut= "<<ecut<<G4endl;
    785     if(t1 > 0.0) {
    786       G4double mom22 = t1*(t1 + 2.0*mass);
    787       G4double ctm = (mom2 + mom22 - mom21)*0.5/sqrt(mom2*mom22);
    788       if(ctm <  1.0) cosTetMaxElec = ctm;
    789       if(ctm < -1.0) cosTetMaxElec = -1.0;
    790     }
    791   }
    792   if(cosTetMaxElec < cosTetMaxNuc) cosTetMaxElec = cosTetMaxNuc;
    793 }
    794 
    795 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
  • trunk/source/processes/electromagnetic/standard/src/G4eBremsstrahlungModel.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eBremsstrahlungModel.cc,v 1.44 2009/04/09 18:41:18 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4eBremsstrahlungModel.cc,v 1.46 2010/04/28 18:39:40 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    9292  if(p) SetParticle(p);
    9393  theGamma = G4Gamma::Gamma();
    94   minThreshold = 1.0*keV;
     94  minThreshold = 0.1*keV;
    9595}
    9696
     
    901901  if(1 < nElements) {
    902902
     903    --nElements;
    903904    G4DataVector* dv = partialSumSigma[couple->GetIndex()];
    904     G4double rval = G4UniformRand()*((*dv)[nElements-1]);
    905 
    906     for (G4int i=0; i<nElements; i++) {
    907       if (rval <= (*dv)[i]) elm = (*theElementVector)[i];
    908     }
    909     if(!elm) {
    910       G4cout << "G4eBremsstrahlungModel::SelectRandomAtom: Warning -"
    911              << " no elements found in "
    912              << material->GetName()
    913              << G4endl;
    914       elm = (*theElementVector)[0];
    915     }
    916   } else elm = (*theElementVector)[0];
     905    G4double rval = G4UniformRand()*((*dv)[nElements]);
     906
     907    elm = (*theElementVector)[nElements];
     908    for (G4int i=0; i<nElements; ++i) {
     909      if (rval <= (*dv)[i]) {
     910        elm = (*theElementVector)[i];
     911        break;
     912      }
     913    }
     914  } else { elm = (*theElementVector)[0]; }
    917915 
    918916  SetCurrentElement(elm);
  • trunk/source/processes/electromagnetic/standard/src/G4eBremsstrahlungRelModel.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eBremsstrahlungRelModel.cc,v 1.14 2009/04/09 18:41:18 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4eBremsstrahlungRelModel.cc,v 1.15 2010/04/06 17:02:23 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    9393  theGamma = G4Gamma::Gamma();
    9494
    95   minThreshold = 1.0*keV;
     95  minThreshold = 0.1*keV;
    9696  SetLowEnergyLimit(GeV); 
    9797
  • trunk/source/processes/electromagnetic/standard/src/G4eCoulombScatteringModel.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eCoulombScatteringModel.cc,v 1.78 2009/10/28 10:14:13 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4eCoulombScatteringModel.cc,v 1.89 2010/05/27 14:22:05 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    4747// 09.06.08 V.Ivanchenko add SelectIsotope and sampling of the recoil ion
    4848// 16.06.09 C.Consolandi fixed computation of effective mass
     49// 27.05.10 V.Ivanchenko added G4WentzelOKandVIxSection class to
     50//              compute cross sections and sample scattering angle
    4951//
    5052//
     
    6062#include "G4DataVector.hh"
    6163#include "G4ElementTable.hh"
    62 #include "G4PhysicsLogVector.hh"
    6364#include "G4ParticleChangeForGamma.hh"
    64 #include "G4Electron.hh"
    65 #include "G4Positron.hh"
    6665#include "G4Proton.hh"
    6766#include "G4ParticleTable.hh"
    6867#include "G4ProductionCutsTable.hh"
    6968#include "G4NucleiProperties.hh"
    70 
    71 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    72 
    73 G4double G4eCoulombScatteringModel::ScreenRSquare[] = {0.0};
    74 G4double G4eCoulombScatteringModel::FormFactor[]    = {0.0};
     69#include "G4Pow.hh"
     70#include "G4LossTableManager.hh"
     71#include "G4NistManager.hh"
     72
     73//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    7574
    7675using namespace std;
     
    8079    cosThetaMin(1.0),
    8180    cosThetaMax(-1.0),
    82     q2Limit(TeV*TeV),
    83     alpha2(fine_structure_const*fine_structure_const),
    84     faclim(100.0),
    8581    isInitialised(false)
    8682{
    8783  fNistManager = G4NistManager::Instance();
    8884  theParticleTable = G4ParticleTable::GetParticleTable();
    89   theElectron = G4Electron::Electron();
    90   thePositron = G4Positron::Positron();
    9185  theProton   = G4Proton::Proton();
    9286  currentMaterial = 0;
    9387  currentElement  = 0;
    94   lowEnergyLimit  = 0.1*keV;
    95   G4double p0 = electron_mass_c2*classic_electr_radius;
    96   coeff  = twopi*p0*p0;
    97   tkin = targetZ = mom2 = DBL_MIN;
    98   elecXSection = nucXSection = 0.0;
     88  lowEnergyLimit  = 1*eV;
    9989  recoilThreshold = 0.*keV;
    100   ecut = DBL_MAX;
    10190  particle = 0;
    10291  currentCouple = 0;
    103 
    104   // Thomas-Fermi screening radii
    105   // Formfactors from A.V. Butkevich et al., NIM A 488 (2002) 282
    106 
    107   if(0.0 == ScreenRSquare[0]) {
    108     G4double a0 = electron_mass_c2/0.88534;
    109     G4double constn = 6.937e-6/(MeV*MeV);
    110 
    111     ScreenRSquare[0] = alpha2*a0*a0;
    112     for(G4int j=1; j<100; j++) {
    113       G4double x = a0*fNistManager->GetZ13(j);
    114       ScreenRSquare[j] = alpha2*x*x;
    115       x = fNistManager->GetA27(j);
    116       FormFactor[j] = constn*x*x;
    117     }
    118   }
     92  wokvi = new G4WentzelOKandVIxSection();
    11993}
    12094
     
    12296
    12397G4eCoulombScatteringModel::~G4eCoulombScatteringModel()
    124 {}
     98{
     99  delete wokvi;
     100}
    125101
    126102//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    131107  SetupParticle(p);
    132108  currentCouple = 0;
    133   elecXSection = nucXSection = 0.0;
    134   tkin = targetZ = mom2 = DBL_MIN;
    135   ecut = etag = DBL_MAX;
    136109  cosThetaMin = cos(PolarAngleLimit());
     110  wokvi->Initialise(p, cosThetaMin);
     111  /*
     112  G4cout << "G4eCoulombScatteringModel: factorA2(GeV^2) = " << factorA2/(GeV*GeV)
     113         << "  1-cos(ThetaLimit)= " << 1 - cosThetaMin
     114         << "  cos(thetaMax)= " <<  cosThetaMax
     115         << G4endl;
     116  */
    137117  pCuts = G4ProductionCutsTable::GetProductionCutsTable()->GetEnergyCutsVector(3);
    138118  //G4cout << "!!! G4eCoulombScatteringModel::Initialise for "
     
    151131//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    152132
    153 void G4eCoulombScatteringModel::ComputeMaxElectronScattering(G4double cutEnergy)
    154 {
    155   ecut = cutEnergy;
    156   G4double tmax = tkin;
    157   cosTetMaxElec = 1.0;
    158   if(mass > MeV) {
    159     G4double ratio = electron_mass_c2/mass;
    160     G4double tau = tkin/mass;
    161     tmax = 2.0*electron_mass_c2*tau*(tau + 2.)/
    162       (1.0 + 2.0*ratio*(tau + 1.0) + ratio*ratio);
    163     cosTetMaxElec = 1.0 - std::min(cutEnergy, tmax)*electron_mass_c2/mom2;
    164   } else {
    165 
    166     if(particle == theElectron) tmax *= 0.5;
    167     G4double t = std::min(cutEnergy, tmax);
    168     G4double mom21 = t*(t + 2.0*electron_mass_c2);
    169     G4double t1 = tkin - t;
    170     //G4cout << "tkin= " << tkin << " t= " << t << " t1= " << t1 << G4endl;
    171     if(t1 > 0.0) {
    172       G4double mom22 = t1*(t1 + 2.0*mass);
    173       G4double ctm = (mom2 + mom22 - mom21)*0.5/sqrt(mom2*mom22);
    174       //G4cout << "ctm= " << ctm << G4endl;
    175       if(ctm <  1.0) cosTetMaxElec = ctm;
    176       if(ctm < -1.0) cosTetMaxElec = -1.0;
    177     }
    178   }
    179 }
    180 
    181 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    182 
    183133G4double G4eCoulombScatteringModel::ComputeCrossSectionPerAtom(
    184134                const G4ParticleDefinition* p,
     
    190140  //  << p->GetParticleName()<<" Z= "<<Z<<" e(MeV)= "<< kinEnergy/MeV << G4endl;
    191141  G4double xsec = 0.0;
    192   SetupParticle(p);
    193   if(kinEnergy < lowEnergyLimit) return xsec;
    194   SetupKinematic(kinEnergy, cutEnergy);
    195   if(cosTetMaxNuc < cosTetMinNuc) {
    196     SetupTarget(Z, kinEnergy);
    197     xsec = CrossSectionPerAtom(); 
     142  if(p != particle) { SetupParticle(p); }
     143
     144  // cross section is set to zero to avoid problems in sample secondary
     145  if(kinEnergy < lowEnergyLimit) { return xsec; }
     146  DefineMaterial(CurrentCouple());
     147  cosTetMinNuc = wokvi->SetupKinematic(kinEnergy, currentMaterial);
     148  if(cosThetaMax < cosTetMinNuc) {
     149    G4int iz = G4int(Z);
     150    cosTetMinNuc = wokvi->SetupTarget(iz, cutEnergy);
     151    cosTetMaxNuc = cosThetaMax;
     152    if(iz == 1 && cosTetMaxNuc < 0.0 && particle == theProton) {
     153      cosTetMaxNuc = 0.0;
     154    }
     155    xsec =  wokvi->ComputeNuclearCrossSection(cosTetMinNuc, cosTetMaxNuc);
     156    elecRatio = wokvi->ComputeElectronCrossSection(cosTetMinNuc, cosThetaMax);
     157    xsec += elecRatio;
     158    if(xsec > 0.0) { elecRatio /= xsec; } 
    198159  }
    199160  /*
    200   G4cout << "e(MeV)= " << ekin/MeV << "cosTetMinNuc= " << cosTetMinNuc
    201          << " cosTetMaxNuc= " << cosTetMaxNuc
    202          << " cosTetMaxElec= " << cosTetMaxElec
     161  G4cout << "e(MeV)= " << kinEnergy/MeV << " xsec(b)= " << xsec/barn 
     162         << " 1-cosTetMinNuc= " << 1-cosTetMinNuc
     163         << " 1-cosTetMaxNuc2= " << 1-cosTetMaxNuc2
     164         << " 1-cosTetMaxElec= " << 1-cosTetMaxElec
    203165         << " screenZ= " << screenZ
    204166         << " formfactA= " << formfactA << G4endl;
    205167  */
    206168  return xsec; 
    207 }
    208 
    209 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    210 
    211 G4double G4eCoulombScatteringModel::CrossSectionPerAtom()
    212 {
    213   // This method needs initialisation before be called
    214   //G4double fac = coeff*targetZ*chargeSquare*invbeta2/mom2;
    215 
    216   G4double meff = targetMass/(mass+targetMass);
    217   G4double fac  = coeff*targetZ*chargeSquare*invbeta2/(mom2*meff*meff);
    218 
    219   elecXSection = 0.0;
    220   nucXSection  = 0.0;
    221 
    222   G4double x  = 1.0 - cosTetMinNuc;
    223   G4double x1 = x + screenZ;
    224 
    225   if(cosTetMaxElec2 < cosTetMinNuc) {
    226     elecXSection = fac*(cosTetMinNuc - cosTetMaxElec2)/
    227       (x1*(1.0 - cosTetMaxElec2 + screenZ));
    228     nucXSection  = elecXSection;
    229   }
    230 
    231   //G4cout << "XS tkin(MeV)= " << tkin<<" xs= " <<nucXSection
    232   //     << " costmax= " << cosTetMaxNuc2
    233   //     << " costmin= " << cosTetMinNuc << "  Z= " << targetZ <<G4endl;
    234   if(cosTetMaxNuc2 < cosTetMinNuc) {
    235     G4double s  = screenZ*formfactA;
    236     G4double z1 = 1.0 - cosTetMaxNuc2 + screenZ;
    237     G4double s1 = 1.0 - s;
    238     G4double d  = s1/formfactA;
    239     //G4cout <<"x1= "<<x1<<" z1= " <<z1<<" s= "<<s << " d= " <<d <<G4endl;
    240     if(d < 0.2*x1) {
    241       G4double x2 = x1*x1;
    242       G4double z2 = z1*z1;
    243       x = (1.0/(x1*x2) - 1.0/(z1*z2) - d*1.5*(1.0/(x2*x2) - 1.0/(z2*z2)))/
    244         (3.0*formfactA*formfactA);
    245     } else {
    246       G4double x2 = x1 + d;
    247       G4double z2 = z1 + d;
    248       x = (1.0/x1 - 1.0/z1 + 1.0/x2 - 1.0/z2 - 2.0*log(z1*x2/(z2*x1))/d)/(s1*s1);
    249     }
    250     nucXSection += fac*targetZ*x;
    251   }
    252   //G4cout<<" cross(bn)= "<<nucXSection/barn<<" xsElec(bn)= "<<elecXSection/barn
    253   //    << " Asc= " << screenZ << G4endl;
    254  
    255   return nucXSection;
    256169}
    257170
     
    266179{
    267180  G4double kinEnergy = dp->GetKineticEnergy();
    268   if(kinEnergy < lowEnergyLimit) return;
    269   DefineMaterial(couple);
     181  if(kinEnergy < lowEnergyLimit) { return; }
    270182  SetupParticle(dp->GetDefinition());
    271183
    272   SetupKinematic(kinEnergy, cutEnergy);
    273184  //G4cout << "G4eCoulombScatteringModel::SampleSecondaries e(MeV)= "
    274185  //     << kinEnergy << "  " << particle->GetParticleName()
     
    279190                                    kinEnergy,cutEnergy,kinEnergy);
    280191
    281   SetupTarget(currentElement->GetZ(),kinEnergy);
    282 
     192  G4double Z = currentElement->GetZ();
     193 
     194  if(ComputeCrossSectionPerAtom(particle,kinEnergy, Z,
     195                                kinEnergy, cutEnergy, kinEnergy) == 0.0)
     196    { return; }
     197
     198  G4int iz = G4int(Z);
    283199  G4int ia = SelectIsotopeNumber(currentElement);
    284   targetMass = G4NucleiProperties::GetNuclearMass(ia, iz);
    285  
    286   G4double cost = SampleCosineTheta();
    287   G4double z1   = 1.0 - cost;
    288   if(z1 < 0.0) return;
    289 
    290   G4double sint = sqrt(z1*(1.0 + cost));
    291  
    292   //G4cout<<"## Sampled sint= " << sint << "  Z= " << targetZ << " A= " << ia
    293   //    << "  screenZ= " << screenZ << " cn= " << formfactA << G4endl;
    294  
    295   G4double phi  = twopi * G4UniformRand();
     200  G4double targetMass = G4NucleiProperties::GetNuclearMass(ia, iz);
     201
     202  G4ThreeVector newDirection =
     203    wokvi->SampleSingleScattering(cosTetMinNuc, cosThetaMax, elecRatio);
     204  G4double cost = newDirection.z();
    296205
    297206  G4ThreeVector direction = dp->GetMomentumDirection();
    298   G4ThreeVector newDirection(cos(phi)*sint,sin(phi)*sint,cost);
    299207  newDirection.rotateUz(direction);   
    300208
     
    303211  // recoil sampling assuming a small recoil
    304212  // and first order correction to primary 4-momentum
    305   G4double q2   = 2*z1*mom2;
    306   G4double trec = q2/(sqrt(targetMass*targetMass + q2) + targetMass);
     213  G4double mom2 = wokvi->GetMomentumSquare();
     214  G4double trec = mom2*(1.0 - cost)/(targetMass + (mass + kinEnergy)*(1.0 + cost));
    307215  G4double finalT = kinEnergy - trec;
    308216  //G4cout<<"G4eCoulombScatteringModel: finalT= "<<finalT<<" Trec= "<<trec<<G4endl;
     
    332240//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    333241
    334 G4double G4eCoulombScatteringModel::SampleCosineTheta()
    335 {
    336   G4double costm = cosTetMaxNuc2;
    337   G4double formf = formfactA;
    338   G4double prob  = 0.0;
    339   G4double xs = CrossSectionPerAtom();
    340   if(xs > 0.0) prob = elecXSection/xs;
    341 
    342   // scattering off e or A?
    343   if(G4UniformRand() < prob) {
    344     costm = cosTetMaxElec2;
    345     formf = 0.0;
    346   }
    347 
    348   /* 
    349   G4cout << "SampleCost: e(MeV)= " << tkin
    350          << " 1-ctmaxN= " << 1. - cosTetMinNuc
    351          << " 1-ctmax= " << 1. - costm
    352          << " Z= " << targetZ
    353          << G4endl;
    354   */
    355 
    356   if(costm >= cosTetMinNuc) return 2.0;
    357 
    358   G4double x1 = 1. - cosTetMinNuc + screenZ;
    359   G4double x2 = 1. - costm + screenZ;
    360   G4double x3 = cosTetMinNuc - costm;
    361   G4double grej, z1;
    362   do {
    363     z1 = x1*x2/(x1 + G4UniformRand()*x3) - screenZ;
    364     grej = 1.0/(1.0 + formf*z1);
    365   } while ( G4UniformRand() > grej*grej ); 
    366 
    367   if(mass > MeV) {
    368     if(G4UniformRand() > (1. - z1*0.5)/(1.0 + z1*sqrt(mom2)/targetMass)) {
    369       return 2.0;
    370     }
    371   }
    372   //G4cout << "z1= " << z1 << " cross= " << nucXSection/barn
    373   //     << " crossE= " << elecXSection/barn << G4endl;
    374 
    375   return 1.0 - z1;
    376 }
    377 
    378 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    379 
    380 
     242
  • trunk/source/processes/electromagnetic/standard/src/G4eMultipleScattering.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eMultipleScattering.cc,v 1.10 2009/11/01 13:05:01 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4eMultipleScattering.cc,v 1.12 2010/06/04 09:11:02 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -----------------------------------------------------------------------------
     
    4545
    4646#include "G4eMultipleScattering.hh"
    47 #include "G4UrbanMscModel92.hh"
     47#include "G4UrbanMscModel93.hh"
    4848#include "G4MscStepLimitType.hh"
    4949#include "G4Electron.hh"
     
    7777void G4eMultipleScattering::InitialiseProcess(const G4ParticleDefinition*)
    7878{
    79   if(isInitialized) return;
     79  if(isInitialized) { return; }
    8080
    8181  // initialisation of parameters - defaults for particles other
    8282  // than ions can be overwritten by users
    83   G4VMscModel* mscUrban = new G4UrbanMscModel92();
     83  G4VMscModel* mscUrban = new G4UrbanMscModel93();
    8484  AddEmModel(1,mscUrban);
    8585  isInitialized = true;
    86   /*
    87   G4cout << "G4eMultipleScattering::InitialiseProcess for "
    88          << p->GetParticleName()
    89          << " skin= " << Skin()
    90          << " SA= " << steppingAlgorithm
    91          << G4endl;
    92   */
    9386}
    9487
     
    9891{
    9992  G4cout << "      RangeFactor= " << RangeFactor()
    100          << ", step limit type: " << StepLimitType()
    101          << ", lateralDisplacement: " << LateralDisplasmentFlag()
    102          << ", skin= " << Skin() 
    103          << ", geomFactor= " << GeomFactor() 
    104          << G4endl;
     93         << ", stepLimitType: " << StepLimitType()
     94         << ", latDisplacement: " << LateralDisplasmentFlag();
     95  if(StepLimitType() == fUseDistanceToBoundary) {
     96    G4cout  << ", skin= " << Skin() << ", geomFactor= " << GeomFactor();
     97  } 
     98  G4cout << G4endl;
    10599}
    106100
  • trunk/source/processes/electromagnetic/standard/src/G4hIonisation.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4hIonisation.cc,v 1.82 2009/02/20 12:06:37 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4hIonisation.cc,v 1.85 2010/06/04 09:22:14 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    7979// 14-01-07 use SetEmModel() and SetFluctModel() from G4VEnergyLossProcess (mma)
    8080// 12-09-08 Removed CorrectionsAlongStep (VI)
     81// 27-05-10 Added G4ICRU73QOModel for anti-protons (VI)
    8182//
    8283// -------------------------------------------------------------------
     
    99100#include "G4KaonPlus.hh"
    100101#include "G4KaonMinus.hh"
     102#include "G4ICRU73QOModel.hh"
    101103
    102104//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    106108G4hIonisation::G4hIonisation(const G4String& name)
    107109  : G4VEnergyLossProcess(name),
    108     isInitialised(false),
    109     nuclearStopping(true)
    110 {
    111   //  SetStepFunction(0.2, 1.0*mm);
     110    isInitialised(false)
     111{
     112  //SetStepFunction(0.2, 1.0*mm);
    112113  //SetIntegral(true);
    113114  //SetVerboseLevel(1);
     
    151152    const G4ParticleDefinition* theBaseParticle = 0;
    152153    G4String pname = part->GetParticleName();
     154    G4double q = part->GetPDGCharge();
    153155
    154156    // standard base particles
     
    163165    else if(bpart == 0) {
    164166
    165       if(part->GetPDGSpin() == 0.0)
    166         if(part->GetPDGCharge() > 0.0 ) {
    167           theBaseParticle = G4KaonPlus::KaonPlus();
    168         } else {
    169           theBaseParticle = G4KaonMinus::KaonMinus();
    170         }
    171       else if(part->GetPDGCharge() > 0.0) {
    172         theBaseParticle = G4Proton::Proton();
     167      if(part->GetPDGSpin() == 0.0) {
     168        if(q > 0.0) { theBaseParticle = G4KaonPlus::KaonPlus(); }
     169        else { theBaseParticle = G4KaonMinus::KaonMinus(); }
    173170      } else {
    174         theBaseParticle = G4AntiProton::AntiProton();
     171        if(q > 0.0) { theBaseParticle = G4Proton::Proton(); }
     172        else { theBaseParticle = G4AntiProton::AntiProton(); }
    175173      }
     174
    176175      // base particle defined by interface
    177176    } else {
     
    183182    mass  = part->GetPDGMass();
    184183    ratio = electron_mass_c2/mass;
    185 
    186     if(mass < 900.*MeV) nuclearStopping = false;
    187 
    188     if (!EmModel(1)) SetEmModel(new G4BraggModel(),1);
     184    eth   = 2.0*MeV*mass/proton_mass_c2;
     185
     186    if (!EmModel(1)) {
     187      if(q > 0.0) { SetEmModel(new G4BraggModel(),1); }
     188      else { SetEmModel(new G4ICRU73QOModel(),1); }
     189    }
    189190    EmModel(1)->SetLowEnergyLimit(MinKinEnergy());
    190191
    191192    // model limit defined for protons
    192     eth = (EmModel(1)->HighEnergyLimit())*mass/proton_mass_c2;
     193    //eth = (EmModel(1)->HighEnergyLimit())*mass/proton_mass_c2;
    193194    EmModel(1)->SetHighEnergyLimit(eth);
    194195    AddEmModel(1, EmModel(1), new G4IonFluctuations());
    195196
    196     if (!FluctModel()) SetFluctModel(new G4UniversalFluctuation());
    197 
    198     if (!EmModel(2)) SetEmModel(new G4BetheBlochModel(),2); 
     197    if (!FluctModel()) { SetFluctModel(new G4UniversalFluctuation()); }
     198
     199    if (!EmModel(2)) { SetEmModel(new G4BetheBlochModel(),2); }
    199200    EmModel(2)->SetLowEnergyLimit(eth);
    200201    EmModel(2)->SetHighEnergyLimit(MaxKinEnergy());
     
    203204    isInitialised = true;
    204205  }
    205   EmModel(1)->ActivateNuclearStopping(nuclearStopping);
    206   EmModel(2)->ActivateNuclearStopping(nuclearStopping);
    207206}
    208207
     
    210209
    211210void G4hIonisation::PrintInfo()
    212 {
    213   if(EmModel(1) && EmModel(2)) {
    214     G4cout << "      NuclearStopping= " << nuclearStopping
    215            << G4endl;
    216   }
    217 }
    218 
    219 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     211{}
     212
     213//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     214
     215void G4hIonisation::ActivateNuclearStopping(G4bool)
     216{}
     217
     218//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
  • trunk/source/processes/electromagnetic/standard/src/G4hMultipleScattering.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4hMultipleScattering.cc,v 1.16 2009/11/01 13:05:01 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4hMultipleScattering.cc,v 1.18 2010/04/16 09:01:24 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -----------------------------------------------------------------------------
     
    4747
    4848#include "G4hMultipleScattering.hh"
    49 #include "G4UrbanMscModel.hh"
    5049#include "G4UrbanMscModel90.hh"
    5150#include "G4MscStepLimitType.hh"
     
    9089  G4cout << "      RangeFactor= " << RangeFactor()
    9190         << ", stepLimitType: " << StepLimitType()
    92          << ", latDisplacement: " << LateralDisplasmentFlag()
    93          << ", skin= " << Skin()
    94          << ", geomFactor= " << GeomFactor() 
    95          << G4endl;
     91         << ", latDisplacement: " << LateralDisplasmentFlag();
     92  if(StepLimitType() == fUseDistanceToBoundary) {
     93    G4cout  << ", skin= " << Skin() << ", geomFactor= " << GeomFactor();
     94  } 
     95  G4cout << G4endl;
    9696}
    9797
  • trunk/source/processes/electromagnetic/standard/test/BremLPMTest.cc

    r1199 r1315  
    2525//
    2626// $Id: BremLPMTest.cc,v 1.2 2008/08/22 08:16:17 schaelic Exp $
    27 // GEANT4 tag $Name: geant4-09-03-cand-01 $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// ------------------------------------------------------------
  • trunk/source/processes/electromagnetic/standard/test/CrossSectionStd.cc

    r1199 r1315  
    2626//
    2727// $Id: CrossSectionStd.cc,v 1.5 2006/06/29 19:54:07 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03-cand-01 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// ------------------------------------------------------------
  • trunk/source/processes/electromagnetic/standard/test/CrossSectionV52.cc

    r1199 r1315  
    2626//
    2727// $Id: CrossSectionV52.cc,v 1.4 2006/06/29 19:54:09 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03-cand-01 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// ------------------------------------------------------------
  • trunk/source/processes/electromagnetic/standard/test/G4InitXscPAItest.cc

    r1199 r1315  
    2626//
    2727// $Id: G4InitXscPAItest.cc,v 1.6 2006/06/29 19:54:11 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03-cand-01 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
  • trunk/source/processes/electromagnetic/standard/test/G4PAIdNdxTest.cc

    r1199 r1315  
    2626//
    2727// $Id: G4PAIdNdxTest.cc,v 1.8 2008/04/14 14:53:39 grichine Exp $
    28 // GEANT4 tag $Name: geant4-09-03-cand-01 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
  • trunk/source/processes/electromagnetic/standard/test/G4PAIxSectionTest.cc

    r1199 r1315  
    2525//
    2626//
    27 // $Id: G4PAIxSectionTest.cc,v 1.15 2006/06/29 19:54:15 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03-cand-01 $
     27// $Id: G4PAIxSectionTest.cc,v 1.16 2009/12/30 12:57:41 grichine Exp $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
     
    432432 outFile <<k<<"\t"<< "  Material : " <<(*theMaterialTable)[k]->GetName() << G4endl ;
    433433  }
    434   G4String testName ;
     434  G4String testName = "Argon" ;
    435435  G4cout<<"Enter material name for test : "<<std::flush ;
    436436  //  G4cin>>testName ;
     
    448448
    449449
    450   for(k=0;k<numOfMaterials;k++)
     450  for( k = 0; k < numOfMaterials; k++ )
    451451  {
    452     //    if((*theMaterialTable)[k]->GetName() != testName) continue ;
     452    if((*theMaterialTable)[k]->GetName() != testName) continue ;
    453453     outFile << "Material : " <<(*theMaterialTable)[k]->GetName() << G4endl ;
    454454     G4cout << "Material : " <<(*theMaterialTable)[k]->GetName() << G4endl ;
     
    543543     //   G4PAIxSection testPAIproton(k,maxEnergyTransfer) ;
    544544
    545      kineticEnergy = 10.0*keV ;  // 110*MeV ;
     545     kineticEnergy = 100.*MeV;  // 10.0*keV ;  // 110*MeV ;
    546546
    547547     //     for(j=1;j<testPAIproton.GetNumberOfGammas();j++)
  • trunk/source/processes/electromagnetic/standard/test/PAIenergyLossTest.cc

    r1199 r1315  
    2626//
    2727// $Id: PAIenergyLossTest.cc,v 1.8 2006/06/29 19:54:17 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03-cand-01 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
  • trunk/source/processes/electromagnetic/standard/test/readBremLPM.py

    r1199 r1315  
    11# $Id: readBremLPM.py,v 1.2 2008/08/22 08:16:17 schaelic Exp $
    2 # GEANT4 tag $Name: geant4-09-03-cand-01 $
     2# GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    33#
    44# works together with BremLPMTest.cc
  • trunk/source/processes/electromagnetic/standard/test/test90Ne10CO2pai.cc

    r1199 r1315  
    2525//
    2626//
    27 // $Id: test90Ne10CO2pai.cc,v 1.6 2008/12/18 13:01:40 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03-cand-01 $
     27// $Id: test90Ne10CO2pai.cc,v 1.8 2009/12/30 12:57:41 grichine Exp $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
     
    3838// 11.04.08, V. Grichine test of PAI predictions for 90% Ne + 10% CO2
    3939//                       ALICE TPC gas mixture
     40// 8.12.09   V. Grichine update for T2K gas mixture
    4041
    4142#include "G4ios.hh"
     
    150151int main()
    151152{
    152    std::ofstream outFile("90Ne10CO2pai.dat", std::ios::out );
     153  // std::ofstream outFile("90Ne10CO2pai.dat", std::ios::out );
     154   std::ofstream outFile("e5GeVt2kPhilippe.dat", std::ios::out );
    153155   outFile.setf( std::ios::scientific, std::ios::floatfield );
    154156
     
    174176
    175177
     178  a = 1.01*g/mole;
     179  G4Isotope* ih1 = new G4Isotope("Hydrogen",iz=1,n=1,a);
     180
     181  a = 2.01*g/mole;
     182  G4Isotope* ih2 = new G4Isotope("Deuterium",iz=1,n=2,a);
     183
     184  G4Element* elH = new G4Element(name="Hydrogen",symbol="H",2);
     185  elH->AddIsotope(ih1,.999);
     186  elH->AddIsotope(ih2,.001);
     187
    176188  a = 12.01*g/mole;
    177189  G4Element* elC = new G4Element(name="Carbon",symbol="C", ez=6., a);
     
    183195  G4Element* elO = new G4Element(name="Oxygen",symbol="O", ez=8., a);
    184196
     197 
     198  a = 19.00*g/mole;
     199  G4Element* elF  = new G4Element(name="Fluorine", symbol="F", z=9., a);
    185200 
     201  a = 39.948*g/mole;
     202  G4Element* elAr = new G4Element(name="Argon", symbol="Ar", z=18., a);
    186203
    187204  // Neon as detector gas, STP
     
    232249  density *= 0.966/1.01325;
    233250
    234   G4cout<<"density of Ne857CO295N2T292 = "<<density*cm3/mg<<"  mg/cm3"<<G4endl;
     251  // G4cout<<"density of Ne857CO295N2T292 = "<<density*cm3/mg<<"  mg/cm3"<<G4endl;
    235252
    236253  G4Material* Ne857CO295N2T292 = new G4Material(name="Ne857CO295N2T292"  , density,
     
    241258
    242259
     260 
     261  // Ar as detector gas,STP
     262
     263  density = 1.7836*mg/cm3 ;       // STP
     264  G4Material* Argon = new G4Material(name="Argon"  , density, ncomponents=1);
     265  Argon->AddElement(elAr, 1);
     266  /*
     267  // iso-Butane (methylpropane), STP
     268
     269  density = 2.67*mg/cm3 ;
     270  G4Material* isobutane = new G4Material(name="isoC4H10",density,nel=2) ;
     271  isobutane->AddElement(elC,4) ;
     272  isobutane->AddElement(elH,10) ;
     273
     274  // CF4 from ATLAS TRT estimation
     275
     276  G4double TRT_CF4_density = 3.9*mg/cm3;
     277  G4Material* TRT_CF4 = new G4Material(name="TRT_CF4", TRT_CF4_density, nel=2,
     278                                           kStateGas,293.15*kelvin,1.*atmosphere);
     279  */
     280
     281  // Philippe Gros T2K mixture version
     282  // Argon                                                                                                   
     283  /*                                         
     284  density     = 1.66*mg/cm3;
     285  pressure    = 1*atmosphere;
     286  temperature = 288.15*kelvin;
     287  G4Material* Argon = new G4Material(name="Ar", // z=18., a=39.948*g/mole,
     288                                     density, ncomponents=1); // kStateGas,temperature,pressure);
     289  Argon->AddElement(elAr, 1);
     290  */
     291   
     292  // IsoButane   
     293                                                                                                   
     294  density     = 2.51*mg/cm3;
     295  G4Material* Isobu = new G4Material(name="isoC4H10", z=34.,a=58.123*g/mole,
     296                                       density, kStateGas,temperature,pressure);
     297
     298  // Tetrafluoromethane   
     299                                                                                           
     300  density = 3.72*mg/cm3;
     301  G4Material* FlMet = new
     302  G4Material(name="CF4",z=42.,a=88.01*g/mole,density,kStateGas,temperature,pressure);
     303
     304  // Argon + 3% tetrafluoromethane  + 2% iso-butane     
     305                                                           
     306  density = 1.748*mg/cm3;
     307  G4Material* t2kGasMixture = new G4Material(name="t2kGasMixture", density, ncomponents=3);
     308  t2kGasMixture->AddMaterial(Argon, fractionmass = 90.9*perCent);
     309  t2kGasMixture->AddMaterial(FlMet, fractionmass = 6.3*perCent);
     310  t2kGasMixture->AddMaterial(Isobu, fractionmass = 2.8*perCent);
     311
     312
    243313  G4int i, j, jMax, k, numOfMaterials, iSan, nbOfElements, sanIndex, row;
    244314  G4double maxEnergyTransfer, kineticEnergy;
     
    261331
    262332  // G4String testName = "N2";
    263   G4String testName = "Ne10CO2";
     333  // G4String testName = "Ne10CO2";
     334  G4String testName = "t2kGasMixture";
     335  // G4String testName = "Ar";
     336  //  G4String testName = "Argon";
    264337  // G4String testName = "Ne10CO2T293";
    265338  // G4String testName = "Ne857CO295N2T292";
     
    372445
    373446
    374      kineticEnergy = 10.0*keV; // 100.*GeV;    // 10.0*keV;  // 110*MeV; // for proton
     447     // kineticEnergy = 10.0*keV; // 100.*GeV;    // 10.0*keV;  // 110*MeV; // for proton
     448
     449     // kineticEnergy = 5*GeV; // for electrons
     450
     451     kineticEnergy = 5*GeV*proton_mass_c2/electron_mass_c2;
     452
     453     // kineticEnergy = 5*GeV;
    375454
    376455     //     for(j=1;j<testPAIproton.GetNumberOfGammas();j++)
    377456
    378      jMax = 70; // 70;
    379 
    380      outFile<<jMax<<G4endl;
     457     // jMax = 70; // 70;
     458     jMax = 1; // 70;
     459
     460     // outFile<<jMax<<G4endl;
    381461
    382462     for( j = 0; j < jMax; j++ )
    383463     {
    384464       tau      = kineticEnergy/proton_mass_c2;
     465       // tau      = kineticEnergy/electron_mass_c2;
    385466       gamma    = tau +1.0;
    386467       bg2      = tau*(tau + 2.0);
    387468       bg = std::sqrt(bg2);
    388469       beta2    = bg2/(gamma*gamma);
    389        // G4cout<<"bg = "<<bg<<";  b2 = "<<beta2<<G4endl<<G4endl;
     470       G4cout<<"bg = "<<bg<<";  b2 = "<<beta2<<G4endl<<G4endl;
    390471       rateMass = electron_mass_c2/proton_mass_c2;
    391 
    392        Tmax     = 2.0*electron_mass_c2*bg2
    393                    /(1.0+2.0*gamma*rateMass+rateMass*rateMass);
     472       
     473       Tmax = 2.0*electron_mass_c2*bg2/(1.0+2.0*gamma*rateMass+rateMass*rateMass);
     474       // Tmax = 0.5*kineticEnergy;
    394475
    395476       Tkin = maxEnergyTransfer;
     
    404485       }
    405486       G4PAIxSection testPAIproton(k,Tkin,bg2);
    406        
     487       /*       
    407488       G4cout 
    408489         //      << kineticEnergy/keV<<"\t\t"
     
    444525       //             <<testPAIproton.GetPAItable(1,j)*cm<<"\t\t"<<G4endl;
    445526
    446             
    447        /*
     527       */           
     528       
    448529       outFile<<testPAIproton.GetSplineSize()-1<<G4endl;
    449530
     
    451532       {
    452533       outFile
     534               << testPAIproton.GetSplineEnergy(i)/keV       << "\t"
     535         //  << testPAIproton.GetIntegralCerenkov(i)*cm    << "\t"
     536         //     << testPAIproton.GetIntegralMM(i)*cm    << "\t"
     537         //     << testPAIproton.GetIntegralPlasmon(i)*cm     << "\t"
     538         //      << testPAIproton.GetIntegralResonance(i)*cm   << "\t"
     539               << testPAIproton.GetIntegralPAIxSection(i)*cm << "\t"
     540               << G4endl;
     541
     542       G4cout
    453543               << testPAIproton.GetSplineEnergy(i)/keV       << "\t"
    454544               << testPAIproton.GetIntegralCerenkov(i)*cm    << "\t"
     
    458548               << testPAIproton.GetIntegralPAIxSection(i)*cm << "\t"
    459549               << G4endl;
     550
    460551       }
    461552       
    462        */
     553     
    463554
    464555       
  • trunk/source/processes/electromagnetic/utils/History

    r1228 r1315  
    1 $Id: History,v 1.400 2009/11/22 19:48:30 vnivanch Exp $
     1$Id: History,v 1.424 2010/06/04 15:36:39 vnivanch Exp $
    22-------------------------------------------------------------------
    33
     
    1717     * Reverse chronological order (last date on top), please *
    1818     ----------------------------------------------------------
     19
     204 June 10: V.Ivant (emutils-V09-03-16)
     21Previous tag was set from wrong directory
     22
     234 June 10: V.Ivant (emutils-V09-03-15)
     24G4EmConfigurator - fixed case of more than one model is added per a process
     25
     264 June 10: V.Ivant (emutils-V09-03-14)
     27G4EmCorrections - moved G4AtomicShell header into source
     28
     2926 May 10: V.Ivant (emutils-V09-03-13)
     30G4VEmModel - added method ChargeSquareRatio to access current charge of an ion
     31G4VEnergyLossProcess - use this new method
     32
     3310 May 10: V.Ivant (emutils-V09-03-12)
     34G4VEmProcess - cleanup printout at initialisation for scattering process
     35
     3628 April 10: V.Ivant (emutils-V09-03-11)
     37G4VEmProcess, G4VEnergyLossProcess, G4VEmModel - provided GetCurrentElement method
     38                       (addressed bug report #1115 and HyperNews request)
     39
     4027 April 10: V.Ivant (emutils-V09-03-10)
     41G4LossTableManager   - added class member and a method GetNumberOfBinsPerDecade
     42G4VEmModel           - use GetNumberOfBinsPerDecade and spline flag to initialise
     43                       G4EmElementSelector (addressed bug report #1115)
     44G4EmElementSelector  - use spline flag to construct vectors probabilities
     45G4EmProcessOptions   - removed double implementation of initialisation code,
     46                       which already exist in G4LossTableManager
     47G4VEnergyLossProcess - call CorrectionsAlongStep only for ions (minor CPU saving)
     48
     4923 April 10: V.Ivant (emutils-V09-03-09)
     50G4VEnergyLossProcess - removed unused variable
     51
     5212 April 10: V.Ivant (emutils-V09-03-08)
     53G4EmModelManager - do not use min energy cut defined by models allowing
     54                   decreasing of cuts in limit to zero
     55G4EmCalculator - fixed GetCrossSection method
     56
     5712 April 10: V.Ivant (emutils-V09-03-07)
     58G4LossTableManager - added methods PreparePhsyicsTables, BuildPhysicsTables,
     59                     and changed initialisation of models via G4EmConfigurator
     60G4VEnergyLossProcess, G4VEmProcess, G4VMultipleScattering - added
     61                     calls of new G4LossTableManager methods
     62                     PreparePhsyicsTables, BuildPhysicsTables
     63G4EmConfigarator - upgraded and fixed old problem
     64
     6506 April 10: V.Ivant (emutils-V09-03-06)
     66G4VEnergyLossProcess - use the same method to build cross section table
     67                       as DEDX table (use copy constructors to reduce
     68                       number of calls to std::exp)
     69G4EmModelManager - cleanup comments
     70
     7122 March 10: V.Ivant (emutils-V09-03-05)
     72G4EmCorrections - added protection against large Barkas and Bloch
     73                  corrections in the case of large negatively charged
     74                  particle (100*e-) - fixed problem reported by ATLAS
     75G4EmCalculator - cleanup
     76
     7710 March 10: V.Ivant (emutils-V09-03-04)
     78G4VEmModel, G4VEmProcess, G4VEnergyLossProcess, G4VMultipleScattering,
     79G4LossTableManager - reorder inline methods and add comments
     80
     8105 March 10: V.Ivant (emutils-V09-03-03)
     82G4VMscModel, G4VMultipleScattering - set skin=1.0 as a default
     83
     8424 February 10: V.Ivant (emutils-V09-03-02)
     85G4VEmProcess - move SetBuildTableFlag method from protected to public
     86
     8717 February 10: V.Ivant (emutils-V09-03-01)
     88G4VEmProcess - fixed problem for ion processes by adding pointer to
     89               currentParticle which may be different from GenericIon
     90
     9122 January 10: V.Ivant (emutils-V09-03-00)
     92G4VEmProcess - added protection against negative cross section
     93G4VEnergyLossProcess - added protection against negative cross section;
     94                     - improved logic in RetrieveTable method
    1995
    209623 November 09: V.Ivant (emutils-V09-02-24)
  • trunk/source/processes/electromagnetic/utils/include/G4EmCalculator.hh

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4EmCalculator.hh,v 1.19 2009/11/11 23:59:48 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4EmCalculator.hh,v 1.20 2010/04/13 10:58:03 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929//
     
    249249  const G4Material*            currentMaterial;
    250250  const G4ParticleDefinition*  currentParticle;
     251  const G4ParticleDefinition*  lambdaParticle;
    251252  const G4ParticleDefinition*  baseParticle;
    252253  const G4PhysicsTable*        currentLambda;
     
    260261
    261262  G4String                     currentName;
     263  G4String                     lambdaName;
    262264  G4double                     currentCut;
    263265  G4double                     chargeSquare;
  • trunk/source/processes/electromagnetic/utils/include/G4EmConfigurator.hh

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4EmConfigurator.hh,v 1.2 2008/11/21 12:30:29 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4EmConfigurator.hh,v 1.3 2010/04/12 11:44:40 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    5858//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    5959
     60class G4VEnergyLossProcess;
     61class G4VEmProcess;
     62class G4VMultipleScattering;
     63
    6064class G4EmConfigurator
    6165{
    6266public:
    6367 
    64   G4EmConfigurator();
     68  G4EmConfigurator(G4int verboseLevel = 1);
    6569 
    6670  ~G4EmConfigurator();
    6771
    68   // Add EM model to the list of extra models potentially to be
    69   // declared for the G4Region and energy interval
    70   //
    71   void AddExtraEmModel(const G4String& particleName,
    72                        G4VEmModel*, G4VEmFluctuationModel* fm = 0);
    73 
    74   // Declare EM model for particle type and process to
    75   // be active for the G4Region and energy interval
    76   // The model should be previously added to the configurator
    77   // or be "dummy"
    78   //
    79   void AddModelForRegion(const G4String& particleName,
    80                          const G4String& processName,
    81                          const G4String& modelName,
    82                          const G4String& regionName = "",
    83                          G4double emin = 0.0,
    84                          G4double emax = DBL_MAX,
    85                          const G4String& flucModelName = "");
    86 
    8772  // Set EM model for particle type and process to
    8873  // be active for the G4Region and energy interval
     74  // The model will be added to the list
    8975  //
    9076  void SetExtraEmModel(const G4String& particleName,
     
    9783
    9884  // Add all previously declared models to corresponding processes
     85  // Can be called in ConstructPhysics
     86  //
    9987  void AddModels();
     88
     89  // These methods called by G4LossTableManager
     90  //
     91  void PrepareModels(const G4ParticleDefinition* aParticle,
     92                     G4VEnergyLossProcess* p);
     93
     94  void PrepareModels(const G4ParticleDefinition* aParticle,
     95                     G4VEmProcess* p);
     96
     97  void PrepareModels(const G4ParticleDefinition* aParticle,
     98                     G4VMultipleScattering* p);
     99
     100  void Clear();
     101
     102  inline void SetVerbose(G4int value);
    100103
    101104private:
    102105
    103   void SetModelForRegion(const G4String& particleName,
     106  G4Region* FindRegion(const G4String&);
     107
     108  void SetModelForRegion(G4VEmModel* model,
     109                         G4VEmFluctuationModel* fm,
     110                         G4Region* reg,
     111                         const G4String& particleName,
    104112                         const G4String& processName,
    105                          const G4String& modelName,
    106                          const G4String& regionName,
    107                          const G4String& flucModelName,
    108113                         G4double emin,
    109114                         G4double emax);
     115
     116  G4bool UpdateModelEnergyRange(G4VEmModel* mod,
     117                                G4double emin, G4double emax);
    110118
    111119  // hide assignment operator
     
    113121  G4EmConfigurator(const G4EmConfigurator&);
    114122
     123  std::vector<G4VEmModel*> models; 
     124  std::vector<G4VEmFluctuationModel*> flucModels; 
    115125  std::vector<G4String> particles; 
    116126  std::vector<G4String> processes; 
    117   std::vector<G4String> models; 
    118127  std::vector<G4String> regions; 
    119   std::vector<G4String> flucModels; 
    120128  std::vector<G4double> lowEnergy;
    121129  std::vector<G4double> highEnergy;
    122130 
    123   std::vector<G4String> particleList; 
    124   std::vector<G4VEmModel*> modelList;
    125   std::vector<G4VEmFluctuationModel*> flucModelList;
    126 
    127131  G4int index;
     132  G4int verbose;
    128133};
    129134
    130135//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     136
     137inline void G4EmConfigurator::SetVerbose(G4int value)
     138{
     139  verbose = value;
     140}
    131141
    132142#endif
  • trunk/source/processes/electromagnetic/utils/include/G4EmCorrections.hh

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4EmCorrections.hh,v 1.24 2008/09/12 14:44:48 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4EmCorrections.hh,v 1.25 2010/06/04 09:28:46 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    5656
    5757#include "globals.hh"
    58 #include "G4AtomicShells.hh"
    5958#include "G4ionEffectiveCharge.hh"
    6059#include "G4Material.hh"
     
    263262  G4int     nbinCorr;
    264263
    265   G4AtomicShells        shells;
    266264  G4ionEffectiveCharge  effCharge;
    267265
     
    356354    tmax  = 2.0*electron_mass_c2*bg2 /(1. + 2.0*gamma*ratio + ratio*ratio);
    357355    charge  = p->GetPDGCharge()/eplus;
    358     if(charge < 1.5)  {q2 = charge*charge;}
    359     else {
    360       q2 = effCharge.EffectiveChargeSquareRatio(p,mat,kinEnergy);
    361       charge = std::sqrt(q2);
    362     }
     356    //if(charge < 1.5)  {q2 = charge*charge;}
     357    //else {
     358    //  q2 = effCharge.EffectiveChargeSquareRatio(p,mat,kinEnergy);
     359    //  charge = std::sqrt(q2);
     360    //}
     361    if(charge > 1.5) { charge = effCharge.EffectiveCharge(p,mat,kinEnergy); }
     362    q2 = charge*charge;
    363363  }
    364364  if(mat != material) {
  • trunk/source/processes/electromagnetic/utils/include/G4LossTableManager.hh

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4LossTableManager.hh,v 1.55 2009/10/29 19:25:28 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4LossTableManager.hh,v 1.58 2010/04/27 16:59:52 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929//
     
    6161// 12-02-07 Add SetSkin, SetLinearLossLimit (V.Ivanchenko)
    6262// 18-06-07 Move definition of msc parameters to G4EmProcessOptions (V.Ivanchenko)
     63// 12-04-10 Added PreparePhsyicsTables and BuildPhysicsTables entries (V.Ivanchenko)
    6364//
    6465// Class Description:
     
    9394class G4EmConfigurator;
    9495class G4LossTableBuilder;
     96class G4Region;
    9597
    9698class G4LossTableManager
     
    103105  ~G4LossTableManager();
    104106
     107  //-------------------------------------------------
     108  // called from destructor
     109  //-------------------------------------------------
     110
    105111  void Clear();
    106112
    107   // get the DEDX or the range for a given particle/energy/material
     113  //-------------------------------------------------
     114  // initialisation before a new run
     115  //-------------------------------------------------
     116
     117  void PreparePhysicsTable(const G4ParticleDefinition* aParticle,
     118                           G4VEnergyLossProcess* p);
     119  void PreparePhysicsTable(const G4ParticleDefinition* aParticle,
     120                           G4VEmProcess* p);
     121  void PreparePhysicsTable(const G4ParticleDefinition* aParticle,
     122                           G4VMultipleScattering* p);
     123  void BuildPhysicsTable(const G4ParticleDefinition* aParticle);
     124  void BuildPhysicsTable(const G4ParticleDefinition* aParticle,
     125                         G4VEnergyLossProcess* p);
     126
     127  //-------------------------------------------------
     128  // Run time access to DEDX, range, energy for a given particle,
     129  // energy, and G4MaterialCutsCouple
     130  //-------------------------------------------------
     131
    108132  inline G4double GetDEDX(
    109133    const G4ParticleDefinition *aParticle,
     
    141165          G4double& length);
    142166
    143   // to be called only by energy loss processes
     167  //-------------------------------------------------
     168  // Methods to be called only at initialisation
     169  //-------------------------------------------------
     170
    144171  void Register(G4VEnergyLossProcess* p);
    145172
     
    162189  void DeRegister(G4VEmFluctuationModel* p);
    163190
    164   void EnergyLossProcessIsInitialised(const G4ParticleDefinition* aParticle,
    165                                       G4VEnergyLossProcess* p);
    166  
    167191  void RegisterIon(const G4ParticleDefinition* aParticle,
    168192                   G4VEnergyLossProcess* p);
     
    171195                             G4VEnergyLossProcess* p);
    172196
    173   void BuildPhysicsTable(const G4ParticleDefinition* aParticle,
    174                          G4VEnergyLossProcess* p);
    175 
    176197  void SetLossFluctuations(G4bool val);
    177198
    178   void SetSubCutoff(G4bool val);
     199  void SetSubCutoff(G4bool val, const G4Region* r=0);
    179200
    180201  void SetIntegral(G4bool val);
     
    198219  void SetLambdaBinning(G4int val);
    199220
     221  G4int GetNumberOfBinsPerDecade() const;
     222
    200223  void SetStepFunction(G4double v1, G4double v2);
    201224
     
    214237  void SetVerbose(G4int val);
    215238
     239  //-------------------------------------------------
     240  // Access methods
     241  //-------------------------------------------------
     242
    216243  G4EnergyLossMessenger* GetMessenger();
    217244
     
    241268
    242269private:
     270
     271  //-------------------------------------------------
     272  // Private methods and members
     273  //-------------------------------------------------
    243274
    244275  G4LossTableManager();
     
    251282  void ParticleHaveNoLoss(const G4ParticleDefinition* aParticle);
    252283
    253   void SetParameters(G4VEnergyLossProcess*);
     284  void SetParameters(const G4ParticleDefinition* aParticle,
     285                     G4VEnergyLossProcess*);
    254286
    255287  void CopyDEDXTables();
    256288
    257 private:
    258 
    259289  static G4LossTableManager* theInstance;
    260290
    261291  typedef const G4ParticleDefinition* PD;
     292
    262293  std::map<PD,G4VEnergyLossProcess*,std::less<PD> > loss_map;
    263294
     
    279310  PD                    currentParticle;
    280311  PD                    theElectron;
     312  PD                    firstParticle;
    281313
    282314  G4int n_loss;
     
    284316
    285317  G4bool all_tables_are_built;
    286   //  G4bool first_entry;
     318  G4bool startInitialisation;
     319
    287320  G4bool lossFluctuationFlag;
    288321  G4bool subCutoffFlag;
     
    290323  G4bool integral;
    291324  G4bool integralActive;
    292   G4bool all_tables_are_stored;
    293325  G4bool buildCSDARange;
    294326  G4bool minEnergyActive;
     
    314346  G4EmConfigurator*           emConfigurator;
    315347
    316   const G4ParticleDefinition* firstParticle;
     348  G4int nbinsLambda;
     349  G4int nbinsPerDecade;
    317350  G4int verbose;
    318351
     
    322355//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
    323356
     357inline G4VEnergyLossProcess* G4LossTableManager::GetEnergyLossProcess(
     358          const G4ParticleDefinition *aParticle)
     359{
     360  if(aParticle != currentParticle) {
     361    currentParticle = aParticle;
     362    std::map<PD,G4VEnergyLossProcess*,std::less<PD> >::const_iterator pos;
     363    if ((pos = loss_map.find(aParticle)) != loss_map.end()) {
     364      currentLoss = (*pos).second;
     365    } else {
     366      currentLoss = 0;
     367     // ParticleHaveNoLoss(aParticle);
     368    }
     369  }
     370  return currentLoss;
     371}
     372
     373//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     374
    324375inline G4double G4LossTableManager::GetDEDX(
    325376          const G4ParticleDefinition *aParticle,
     
    327378          const G4MaterialCutsCouple *couple)
    328379{
    329   if(aParticle != currentParticle) GetEnergyLossProcess(aParticle);
     380  if(aParticle != currentParticle) { GetEnergyLossProcess(aParticle); }
    330381  G4double x;
    331   if(currentLoss) x = currentLoss->GetDEDX(kineticEnergy, couple);
    332   else            x = G4EnergyLossTables::GetDEDX(
    333                       currentParticle,kineticEnergy,couple,false);
     382  if(currentLoss) { x = currentLoss->GetDEDX(kineticEnergy, couple); }
     383  else            { x = G4EnergyLossTables::GetDEDX(currentParticle,
     384                                                    kineticEnergy,couple,false); }
    334385  return x;
    335386}
     
    342393          const G4MaterialCutsCouple *couple)
    343394{
    344   if(aParticle != currentParticle) GetEnergyLossProcess(aParticle);
     395  if(aParticle != currentParticle) { GetEnergyLossProcess(aParticle); }
    345396  G4double x = 0.0;
    346   if(currentLoss) x = currentLoss->GetDEDXForSubsec(kineticEnergy, couple);
     397  if(currentLoss) { x = currentLoss->GetDEDXForSubsec(kineticEnergy, couple); }
    347398  return x;
    348399}
     
    355406          const G4MaterialCutsCouple *couple)
    356407{
    357   if(aParticle != currentParticle) GetEnergyLossProcess(aParticle);
     408  if(aParticle != currentParticle) { GetEnergyLossProcess(aParticle); }
    358409  G4double x = DBL_MAX;
    359   if(currentLoss) x = currentLoss->GetCSDARange(kineticEnergy, couple);
     410  if(currentLoss) { x = currentLoss->GetCSDARange(kineticEnergy, couple); }
    360411  return x;
    361412}
     
    368419          const G4MaterialCutsCouple *couple)
    369420{
    370   if(aParticle != currentParticle) GetEnergyLossProcess(aParticle);
     421  if(aParticle != currentParticle) { GetEnergyLossProcess(aParticle); }
    371422  G4double x;
    372   if(currentLoss) x = currentLoss->GetRangeForLoss(kineticEnergy, couple);
    373   else    
    374     x = G4EnergyLossTables::GetRange(currentParticle,kineticEnergy,couple,false);
     423  if(currentLoss) { x = currentLoss->GetRangeForLoss(kineticEnergy, couple); }
     424  else { x = G4EnergyLossTables::GetRange(currentParticle,kineticEnergy,
     425                                          couple,false); }
    375426  return x;
    376427}
     
    383434          const G4MaterialCutsCouple *couple)
    384435{
    385   if(aParticle != currentParticle) GetEnergyLossProcess(aParticle);
     436  if(aParticle != currentParticle) { GetEnergyLossProcess(aParticle); }
    386437  G4double x;
    387   if(currentLoss) x = currentLoss->GetRange(kineticEnergy, couple);
    388   else    
    389     x = G4EnergyLossTables::GetRange(currentParticle,kineticEnergy,couple,false);
     438  if(currentLoss) { x = currentLoss->GetRange(kineticEnergy, couple); }
     439  else { x = G4EnergyLossTables::GetRange(currentParticle,kineticEnergy,
     440                                          couple,false); }
    390441  return x;
    391442}
     
    398449          const G4MaterialCutsCouple *couple)
    399450{
    400   if(aParticle != currentParticle) GetEnergyLossProcess(aParticle);
     451  if(aParticle != currentParticle) { GetEnergyLossProcess(aParticle); }
    401452  G4double x;
    402   if(currentLoss) x = currentLoss->GetKineticEnergy(range, couple);
    403   else            x = G4EnergyLossTables::GetPreciseEnergyFromRange(
    404                       currentParticle,range,couple,false);
     453  if(currentLoss) { x = currentLoss->GetKineticEnergy(range, couple); }
     454  else { x = G4EnergyLossTables::GetPreciseEnergyFromRange(currentParticle,range,
     455                                                           couple,false); }
    405456  return x;
    406457}
     
    428479//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    429480
    430 inline G4VEnergyLossProcess* G4LossTableManager::GetEnergyLossProcess(
    431           const G4ParticleDefinition *aParticle)
    432 {
    433   if(aParticle != currentParticle) {
    434     currentParticle = aParticle;
    435     std::map<PD,G4VEnergyLossProcess*,std::less<PD> >::const_iterator pos;
    436     if ((pos = loss_map.find(aParticle)) != loss_map.end()) {
    437       currentLoss = (*pos).second;
    438     } else {
    439       currentLoss = 0;
    440      // ParticleHaveNoLoss(aParticle);
    441     }
    442   }
    443   return currentLoss;
    444 }
    445 
    446 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    447 
    448481#endif
    449482
  • trunk/source/processes/electromagnetic/utils/include/G4VAtomDeexcitation.hh

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VAtomDeexcitation.hh,v 1.1 2009/07/09 11:42:52 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4VAtomDeexcitation.hh,v 1.3 2010/03/30 09:19:56 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    6363  virtual ~G4VAtomDeexcitation();
    6464
    65   //initialization
     65  //========== initialization ==========
     66
    6667  virtual void PreparePhysicsTable(const G4ParticleDefinition&);
    6768  virtual void BuildPhysicsTable(const G4ParticleDefinition&);
    68 
    69   // Get atomic shell by shell index, used by discrete processes
    70   // (for example, photoelectric), when shell vacancy sampled by the model
    71   virtual const G4AtomicChell* GetAtomicShell(G4int Z, G4int ShellIndex);
    72 
    73   // selection of random shell for ionisation process
    74   virtual const G4AtomicShell* SelectRandomShell(const G4DynamicParticle*,
    75                                                  G4int Z);
    76 
    77   // generation of deexcitation for given atom and shell vacancy
    78   virtual void GenerateParticles(std::vector<G4DynamicParticle*>*,
    79                                  const G4AtomicChell*, G4int Z);
    80 
    81   // access or compute PIXE cross section
    82   virtual G4double GetPIXECrossSection (const G4ParticleDefinition*,
    83                                         G4int Z, G4double kinE);
    84 
    85   // calculate PIXE cross section from the models
    86   virtual G4double CalculatePIXECrossSection(const G4ParticleDefinition*,
    87                                              G4int Z, G4double kinE);
    88 
    89   // Sampling of PIXE for ionisation processes
    90   virtual void
    91   AlongStepDeexcitation(std::vector<G4DynamicParticle*>* secVect,
    92                         const G4DynamicParticle* icidentParticle,
    93                         const G4MaterialCutsCouple*,
    94                         G4double trueStepLenght,
    95                         G4double eLoss);
    96 
    97   // Check if deexcitation is active for a given geometry volume
    98   G4bool CheckActiveRegion(G4int coupleIndex);
    99 
    100   // Access flags defined in the CheckActiveVolume method
    101   inline G4bool IsFluorescenceActive() const;
    102   inline G4bool IsPIXECrossSectionActive() const;
    10369
    10470  // PIXE model name
     
    11581  void SetPIXECrossSectionActiveRegion(const G4String& rname = "");
    11682
     83  //========== Run time methods ==========
     84
     85  // Check if deexcitation is active for a given geometry volume
     86  G4bool CheckFluorescenceActiveRegion(G4int coupleIndex);
     87
     88  // Check if deexcitation is active for a given geometry volume
     89  G4bool CheckPIXEActiveRegion(G4int coupleIndex);
     90
     91  // Get atomic shell by shell index, used by discrete processes
     92  // (for example, photoelectric), when shell vacancy sampled by the model
     93  const G4AtomicShell* GetAtomicShell(G4int Z, G4int ShellIndex);
     94
     95  // selection of random shell for ionisation process
     96  virtual const G4AtomicShell* SelectRandomShell(const G4DynamicParticle*,
     97                                                 G4int Z);
     98
     99  // generation of deexcitation for given atom and shell vacancy
     100  virtual void GenerateParticles(std::vector<G4DynamicParticle*>*,
     101                                 const G4AtomicShell*, G4int Z) = 0;
     102
     103  // access or compute PIXE cross section
     104  virtual G4double GetPIXECrossSection (const G4ParticleDefinition*,
     105                                        G4int Z, G4double kinE) = 0;
     106
     107  // calculate PIXE cross section from the models
     108  virtual G4double CalculatePIXECrossSection(const G4ParticleDefinition*,
     109                                             G4int Z, G4double kinE) = 0;
     110
     111  // Sampling of PIXE for ionisation processes
     112  virtual void
     113  AlongStepDeexcitation(std::vector<G4DynamicParticle*>* secVect,
     114                        const G4DynamicParticle* icidentParticle,
     115                        const G4MaterialCutsCouple*,
     116                        G4double trueStepLenght,
     117                        G4double eLoss) = 0;
     118
     119
     120
    117121private:
    118122
     
    122126
    123127  G4String namePIXE;
    124   G4bool isFluoActive;
    125   G4bool isPIXEActive;
    126128
    127129};
    128 
    129 inline G4bool IsFluorescenceActive() const
    130 {
    131   return isFluoActive;
    132 }
    133 
    134 inline G4bool IsPIXECrossSectionActive() const
    135 {
    136   return isPIXEActive;
    137 }
    138130
    139131inline
  • trunk/source/processes/electromagnetic/utils/include/G4VEmModel.hh

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VEmModel.hh,v 1.72 2009/09/23 14:42:47 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4VEmModel.hh,v 1.75 2010/05/26 10:41:34 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    150150
    151151  // Compute effective ion charge square
     152  virtual G4double ChargeSquareRatio(const G4Track&);
     153
     154  // Compute effective ion charge square
    152155  virtual G4double GetChargeSquareRatio(const G4ParticleDefinition*,
    153156                                        const G4Material*,
     
    228231                                             G4double maxEnergy = DBL_MAX);
    229232
     233  // select isotope in order to have precise mass of the nucleus
     234  inline G4int SelectIsotopeNumber(const G4Element*);
     235
    230236  // atom can be selected effitiantly if element selectors are initialised
    231237  inline const G4Element* SelectRandomAtom(const G4MaterialCutsCouple*,
     
    236242
    237243  // to select atom cross section per volume is recomputed for each element
    238   inline const G4Element* SelectRandomAtom(const G4Material*,
    239                                            const G4ParticleDefinition*,
    240                                            G4double kineticEnergy,
    241                                            G4double cutEnergy = 0.0,
    242                                            G4double maxEnergy = DBL_MAX);
    243 
    244   // select isotope in order to have precise mass of the nucleus
    245   inline G4int SelectIsotopeNumber(const G4Element*);
     244  const G4Element* SelectRandomAtom(const G4Material*,
     245                                    const G4ParticleDefinition*,
     246                                    G4double kineticEnergy,
     247                                    G4double cutEnergy = 0.0,
     248                                    G4double maxEnergy = DBL_MAX);
    246249
    247250  //------------------------------------------------------------------------
     
    291294  inline void SetCurrentCouple(const G4MaterialCutsCouple*);
    292295
     296  inline const G4Element* GetCurrentElement() const;
     297
    293298protected:
    294299
     
    296301
    297302  inline void SetCurrentElement(const G4Element*);
    298 
    299   inline const G4Element* GetCurrentElement() const;
    300303
    301304private:
     
    341344};
    342345
    343 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     346// ======== Run time inline methods ================
     347
     348inline void G4VEmModel::SetCurrentCouple(const G4MaterialCutsCouple* p)
     349{
     350  currentCouple = p;
     351}
     352
     353//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     354
     355inline const G4MaterialCutsCouple* G4VEmModel::CurrentCouple() const
     356{
     357  return currentCouple;
     358}
     359
     360//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     361
     362inline void G4VEmModel::SetCurrentElement(const G4Element* elm)
     363{
     364  currentElement = elm;
     365}
     366
     367//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     368
     369inline const G4Element* G4VEmModel::GetCurrentElement() const
     370{
     371  return currentElement;
     372}
     373
     374//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     375
     376inline
     377G4double G4VEmModel::MaxSecondaryKinEnergy(const G4DynamicParticle* dynPart)
     378{
     379  return MaxSecondaryEnergy(dynPart->GetDefinition(),
     380                            dynPart->GetKineticEnergy());
     381}
     382
    344383//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    345384
     
    375414  G4double mfp = DBL_MAX;
    376415  G4double cross = CrossSectionPerVolume(material,p,ekin,emin,emax);
    377   if (cross > DBL_MIN) mfp = 1./cross;
     416  if (cross > DBL_MIN) { mfp = 1./cross; }
    378417  return mfp;
    379418}
     
    415454//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    416455
    417 inline
    418 const G4Element* G4VEmModel::SelectRandomAtom(const G4Material* material,
    419                                               const G4ParticleDefinition* pd,
    420                                               G4double kinEnergy,
    421                                               G4double tcut,
    422                                               G4double tmax)
    423 {
    424   const G4ElementVector* theElementVector = material->GetElementVector();
    425   G4int n = material->GetNumberOfElements() - 1;
    426   currentElement = (*theElementVector)[n];
    427   if (n > 0) {
    428     G4double x = G4UniformRand()*
    429                  G4VEmModel::CrossSectionPerVolume(material,pd,kinEnergy,tcut,tmax);
    430     for(G4int i=0; i<n; i++) {
    431       if (x <= xsec[i]) {
    432         currentElement = (*theElementVector)[i];
    433         break;
    434       }
    435     }
    436   }
    437   return currentElement;
    438 }
    439 
    440 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    441 
    442456inline G4int G4VEmModel::SelectIsotopeNumber(const G4Element* elm)
    443457{
     
    450464      G4double* ab = elm->GetRelativeAbundanceVector();
    451465      G4double x = G4UniformRand();
    452       for(; idx<ni; idx++) {
     466      for(; idx<ni; ++idx) {
    453467        x -= ab[idx];
    454         if (x <= 0.0) break;
     468        if (x <= 0.0) { break; }
    455469      }
    456       if(idx >= ni) idx = ni - 1;
     470      if(idx >= ni) { idx = ni - 1; }
    457471    }
    458472    N = elm->GetIsotope(idx)->GetN();
     
    461475}
    462476
    463 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     477// ======== Get/Set inline methods used at initialisation ================
    464478
    465479inline G4VEmFluctuationModel* G4VEmModel::GetModelOfFluctuations()
     
    578592{
    579593  nuclearStopping = val;
    580 }
    581 
    582 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    583 
    584 inline
    585 G4double G4VEmModel::MaxSecondaryKinEnergy(const G4DynamicParticle* dynPart)
    586 {
    587   return MaxSecondaryEnergy(dynPart->GetDefinition(),
    588                             dynPart->GetKineticEnergy());
    589594}
    590595
     
    601606                                          G4VEmFluctuationModel* f = 0)
    602607{
    603   if(p && pParticleChange != p) pParticleChange = p;
     608  if(p && pParticleChange != p) { pParticleChange = p; }
    604609  fluc = f;
    605610}
     
    607612//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    608613
    609 inline void G4VEmModel::SetCurrentCouple(const G4MaterialCutsCouple* p)
    610 {
    611   currentCouple = p;
    612 }
    613 
    614 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    615 
    616 inline const G4MaterialCutsCouple* G4VEmModel::CurrentCouple() const
    617 {
    618   return currentCouple;
    619 }
    620 
    621 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    622 
    623 inline void G4VEmModel::SetCurrentElement(const G4Element* elm)
    624 {
    625   currentElement = elm;
    626 }
    627 
    628 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    629 
    630 inline const G4Element* G4VEmModel::GetCurrentElement() const
    631 {
    632   return currentElement;
    633 }
    634 
    635 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    636 
    637614#endif
    638615
  • trunk/source/processes/electromagnetic/utils/include/G4VEmProcess.hh

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VEmProcess.hh,v 1.55 2009/09/23 14:42:47 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4VEmProcess.hh,v 1.60 2010/04/28 14:43:13 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    5656// 27-10-07 Virtual functions moved to source (V.Ivanchenko)
    5757// 15-07-08 Reorder class members for further multi-thread development (VI)
     58// 17-02-10 Added pointer currentParticle (VI)
    5859//
    5960// Class Description:
     
    158159
    159160  // It returns the cross section of the process per atom
    160   inline G4double ComputeCrossSectionPerAtom(G4double kineticEnergy,
    161                                              G4double Z, G4double A=0.,
    162                                              G4double cut=0.0);
    163 
    164   inline G4double MeanFreePath(const G4Track& track);
     161  G4double ComputeCrossSectionPerAtom(G4double kineticEnergy,
     162                                      G4double Z, G4double A=0.,
     163                                      G4double cut=0.0);
     164
     165  G4double MeanFreePath(const G4Track& track);
    165166
    166167  // It returns cross section per volume
     
    225226  G4VEmModel* GetModelByIndex(G4int idx = 0, G4bool ver = false);
    226227
     228  // access atom on which interaction happens
     229  const G4Element* GetCurrentElement() const;
     230
    227231  inline void SetLambdaFactor(G4double val);
    228232
     
    231235
    232236  inline void SetApplyCuts(G4bool val);
     237
     238  inline void SetBuildTableFlag(G4bool val);
    233239
    234240  //------------------------------------------------------------------------
     
    245251
    246252  inline G4double RecalculateLambda(G4double kinEnergy,
    247                                     const G4MaterialCutsCouple* couple);
     253                                    const G4MaterialCutsCouple* couple);
    248254
    249255  inline G4ParticleChangeForGamma* GetParticleChange();
     
    258264
    259265  inline G4double GetElectronEnergyCut();
    260 
    261   inline void SetBuildTableFlag(G4bool val);
    262266
    263267  inline void SetStartFromNullFlag(G4bool val);
     
    340344
    341345  const G4ParticleDefinition*  particle;
     346  const G4ParticleDefinition*  currentParticle;
    342347
    343348  // cash
     
    352357};
    353358
    354 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    355 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    356 
    357 inline G4double G4VEmProcess::ComputeCrossSectionPerAtom(
    358                  G4double kineticEnergy, G4double Z, G4double A, G4double cut)
    359 {
    360   SelectModel(kineticEnergy, currentCoupleIndex);
    361   G4double x = 0.0;
    362   if(currentModel) {
    363    x = currentModel->ComputeCrossSectionPerAtom(particle,kineticEnergy,
    364                                                  Z,A,cut);
    365   }
    366   return x;
    367 }
    368 
    369 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    370 
    371 inline G4double G4VEmProcess::MeanFreePath(const G4Track& track)
    372 {
    373   DefineMaterial(track.GetMaterialCutsCouple());
    374   preStepLambda = GetCurrentLambda(track.GetKineticEnergy());
    375   G4double x = DBL_MAX;
    376   if(DBL_MIN < preStepLambda) x = 1.0/preStepLambda;
    377   return x;
    378 }
    379 
    380 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    381 
    382 inline G4double G4VEmProcess::GetLambda(G4double& kineticEnergy,
    383                                         const G4MaterialCutsCouple* couple)
    384 {
    385   DefineMaterial(couple);
    386   return GetCurrentLambda(kineticEnergy);
    387 }
    388 
    389 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    390 
    391 inline void G4VEmProcess::SetLambdaBinning(G4int nbins)
    392 {
    393   nLambdaBins = nbins;
    394 }
    395 
    396 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    397 
    398 inline G4int G4VEmProcess::LambdaBinning() const
    399 {
    400   return nLambdaBins;
    401 }
    402 
    403 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    404 
    405 inline void G4VEmProcess::SetMinKinEnergy(G4double e)
    406 {
    407   minKinEnergy = e;
    408 }
    409 
    410 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    411 
    412 inline G4double G4VEmProcess::MinKinEnergy() const
    413 {
    414   return minKinEnergy;
    415 }
    416 
    417 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    418 
    419 inline void G4VEmProcess::SetMaxKinEnergy(G4double e)
    420 {
    421   maxKinEnergy = e;
    422 }
    423 
    424 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    425 
    426 inline G4double G4VEmProcess::MaxKinEnergy() const
    427 {
    428   return maxKinEnergy;
    429 }
    430 
    431 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    432 
    433 inline void G4VEmProcess::SetPolarAngleLimit(G4double val)
    434 {
    435   if(val < 0.0)     polarAngleLimit = 0.0;
    436   else if(val > pi) polarAngleLimit = pi;
    437   else              polarAngleLimit = val;
    438 }
    439 
    440 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    441 
    442 inline G4double G4VEmProcess::PolarAngleLimit() const
    443 {
    444   return polarAngleLimit;
    445 }
    446 
    447 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    448 
    449 inline const G4PhysicsTable* G4VEmProcess::LambdaTable() const
    450 {
    451   return theLambdaTable;
    452 }
    453 
    454 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    455 
    456 inline const G4ParticleDefinition* G4VEmProcess::Particle() const
    457 {
    458   return particle;
    459 }
    460 
    461 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    462 
    463 inline const G4ParticleDefinition* G4VEmProcess::SecondaryParticle() const
    464 {
    465   return secondaryParticle;
    466 }
    467 
    468 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    469 
    470 inline
    471 G4VEmModel* G4VEmProcess::SelectModel(G4double& kinEnergy, size_t index)
    472 {
    473   currentModel = modelManager->SelectModel(kinEnergy, index);
    474   currentModel->SetCurrentCouple(currentCouple);
    475   return currentModel;
    476 }
    477 
    478 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    479 
    480 inline
    481 G4VEmModel* G4VEmProcess::SelectModelForMaterial(G4double kinEnergy,
    482                                                  size_t& idxRegion) const
    483 {
    484   return modelManager->SelectModel(kinEnergy, idxRegion);
    485 }
    486 
    487 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    488 
    489 inline void G4VEmProcess::SetLambdaFactor(G4double val)
    490 {
    491   if(val > 0.0 && val <= 1.0) lambdaFactor = val;
    492 }
    493 
    494 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    495 
    496 inline void G4VEmProcess::SetIntegral(G4bool val)
    497 {
    498   if(particle && particle != theGamma) integral = val;
    499   if(integral) buildLambdaTable = true;
    500 }
    501 
    502 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    503 
    504 inline G4bool G4VEmProcess::IsIntegral() const
    505 {
    506   return integral;
    507 }
    508 
    509 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    510 
    511 inline void G4VEmProcess::SetApplyCuts(G4bool val)
    512 {
    513   applyCuts = val;
    514 }
    515 
    516 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    517 
    518 inline G4double G4VEmProcess::RecalculateLambda(G4double e,
    519                                                 const G4MaterialCutsCouple* couple)
    520 {
    521   DefineMaterial(couple);
    522   return ComputeCurrentLambda(e);
    523 }
    524 
    525 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    526 
    527 inline G4ParticleChangeForGamma* G4VEmProcess::GetParticleChange()
    528 {
    529   return &fParticleChange;
    530 }
    531 
    532 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    533 
    534 inline void G4VEmProcess::SetParticle(const G4ParticleDefinition* p)
    535 {
    536   particle = p;
    537 }
    538 
    539 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    540 
    541 inline void G4VEmProcess::SetSecondaryParticle(const G4ParticleDefinition* p)
    542 {
    543   secondaryParticle = p;
    544 }
    545 
    546 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     359// ======== Run time inline methods ================
    547360
    548361inline size_t G4VEmProcess::CurrentMaterialCutsCoupleIndex() const
     
    563376{
    564377  return (*theCutsElectron)[currentCoupleIndex];
    565 }
    566 
    567 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    568 
    569 inline void G4VEmProcess::SetBuildTableFlag(G4bool val)
    570 {
    571   buildLambdaTable = val;
    572   if(!val) integral = false;
    573 }
    574 
    575 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    576 
    577 inline void G4VEmProcess::SetStartFromNullFlag(G4bool val)
    578 {
    579   startFromNull = val;
    580 }
    581 
    582 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    583 
    584 inline void G4VEmProcess::InitialiseStep(const G4Track& track)
    585 {
    586   preStepKinEnergy = track.GetKineticEnergy();
    587   DefineMaterial(track.GetMaterialCutsCouple());
    588   SelectModel(preStepKinEnergy, currentCoupleIndex);
    589   if (theNumberOfInteractionLengthLeft < 0.0) mfpKinEnergy = DBL_MAX;
    590378}
    591379
     
    600388    mfpKinEnergy = DBL_MAX;
    601389  }
     390}
     391
     392//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     393
     394inline
     395G4VEmModel* G4VEmProcess::SelectModel(G4double& kinEnergy, size_t index)
     396{
     397  currentModel = modelManager->SelectModel(kinEnergy, index);
     398  currentModel->SetCurrentCouple(currentCouple);
     399  return currentModel;
     400}
     401
     402//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     403
     404inline
     405G4VEmModel* G4VEmProcess::SelectModelForMaterial(G4double kinEnergy,
     406                                                 size_t& idxRegion) const
     407{
     408  return modelManager->SelectModel(kinEnergy, idxRegion);
     409}
     410
     411//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     412
     413inline void G4VEmProcess::InitialiseStep(const G4Track& track)
     414{
     415  currentParticle = track.GetDefinition();
     416  preStepKinEnergy = track.GetKineticEnergy();
     417  DefineMaterial(track.GetMaterialCutsCouple());
     418  SelectModel(preStepKinEnergy, currentCoupleIndex);
     419  if (theNumberOfInteractionLengthLeft < 0.0) mfpKinEnergy = DBL_MAX;
     420}
     421
     422//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     423
     424inline G4double G4VEmProcess::GetLambdaFromTable(G4double e)
     425{
     426  return (((*theLambdaTable)[currentCoupleIndex])->Value(e));
     427}
     428
     429//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     430
     431inline G4double G4VEmProcess::ComputeCurrentLambda(G4double e)
     432{
     433  SelectModel(e, currentCoupleIndex);
     434  return currentModel->CrossSectionPerVolume(currentMaterial,currentParticle,
     435                                             e,(*theCuts)[currentCoupleIndex]);
     436}
     437
     438//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     439
     440inline G4double G4VEmProcess::GetCurrentLambda(G4double e)
     441{
     442  G4double x = 0.0;
     443  if(theLambdaTable) { x = GetLambdaFromTable(e); }
     444  else               { x = ComputeCurrentLambda(e); }
     445  return x;
     446}
     447
     448//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     449
     450inline G4double G4VEmProcess::GetLambda(G4double& kineticEnergy,
     451                                        const G4MaterialCutsCouple* couple)
     452{
     453  DefineMaterial(couple);
     454  return GetCurrentLambda(kineticEnergy);
     455}
     456
     457//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     458
     459inline G4double G4VEmProcess::RecalculateLambda(G4double e,
     460                                                const G4MaterialCutsCouple* couple)
     461{
     462  DefineMaterial(couple);
     463  return ComputeCurrentLambda(e);
    602464}
    603465
     
    625487}
    626488
    627 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    628 
    629 inline G4double G4VEmProcess::GetLambdaFromTable(G4double e)
    630 {
    631   return (((*theLambdaTable)[currentCoupleIndex])->Value(e));
    632 }
    633 
    634 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    635 
    636 inline G4double G4VEmProcess::GetCurrentLambda(G4double e)
    637 {
    638   G4double x = 0.0;
    639   if(theLambdaTable) { x = GetLambdaFromTable(e); }
    640   else               { x = ComputeCurrentLambda(e); }
    641   return x;
    642 }
    643 
    644 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    645 
    646 inline G4double G4VEmProcess::ComputeCurrentLambda(G4double e)
    647 {
    648   SelectModel(e, currentCoupleIndex);
    649   return currentModel->CrossSectionPerVolume(currentMaterial,particle,
    650                                              e,(*theCuts)[currentCoupleIndex]);
     489// ======== Get/Set inline methods used at initialisation ================
     490
     491inline void G4VEmProcess::SetLambdaBinning(G4int nbins)
     492{
     493  nLambdaBins = nbins;
     494}
     495
     496//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     497
     498inline G4int G4VEmProcess::LambdaBinning() const
     499{
     500  return nLambdaBins;
     501}
     502
     503//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     504
     505inline void G4VEmProcess::SetMinKinEnergy(G4double e)
     506{
     507  minKinEnergy = e;
     508}
     509
     510//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     511
     512inline G4double G4VEmProcess::MinKinEnergy() const
     513{
     514  return minKinEnergy;
     515}
     516
     517//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     518
     519inline void G4VEmProcess::SetMaxKinEnergy(G4double e)
     520{
     521  maxKinEnergy = e;
     522}
     523
     524//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     525
     526inline G4double G4VEmProcess::MaxKinEnergy() const
     527{
     528  return maxKinEnergy;
     529}
     530
     531//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     532
     533inline void G4VEmProcess::SetPolarAngleLimit(G4double val)
     534{
     535  if(val < 0.0)     polarAngleLimit = 0.0;
     536  else if(val > pi) polarAngleLimit = pi;
     537  else              polarAngleLimit = val;
     538}
     539
     540//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     541
     542inline G4double G4VEmProcess::PolarAngleLimit() const
     543{
     544  return polarAngleLimit;
     545}
     546
     547//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     548
     549inline const G4PhysicsTable* G4VEmProcess::LambdaTable() const
     550{
     551  return theLambdaTable;
     552}
     553
     554//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     555
     556inline const G4ParticleDefinition* G4VEmProcess::Particle() const
     557{
     558  return particle;
     559}
     560
     561//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     562
     563inline const G4ParticleDefinition* G4VEmProcess::SecondaryParticle() const
     564{
     565  return secondaryParticle;
     566}
     567
     568//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     569
     570inline void G4VEmProcess::SetLambdaFactor(G4double val)
     571{
     572  if(val > 0.0 && val <= 1.0) { lambdaFactor = val; }
     573}
     574
     575//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     576
     577inline void G4VEmProcess::SetIntegral(G4bool val)
     578{
     579  if(particle && particle != theGamma) { integral = val; }
     580  if(integral) { buildLambdaTable = true; }
     581}
     582
     583//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     584
     585inline G4bool G4VEmProcess::IsIntegral() const
     586{
     587  return integral;
     588}
     589
     590//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     591
     592inline void G4VEmProcess::SetApplyCuts(G4bool val)
     593{
     594  applyCuts = val;
     595}
     596
     597//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     598
     599inline void G4VEmProcess::SetBuildTableFlag(G4bool val)
     600{
     601  buildLambdaTable = val;
     602  if(!val) { integral = false; }
     603}
     604
     605//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     606
     607inline G4ParticleChangeForGamma* G4VEmProcess::GetParticleChange()
     608{
     609  return &fParticleChange;
     610}
     611
     612//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     613
     614inline void G4VEmProcess::SetParticle(const G4ParticleDefinition* p)
     615{
     616  particle = p;
     617  currentParticle = p;
     618}
     619
     620//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     621
     622inline void G4VEmProcess::SetSecondaryParticle(const G4ParticleDefinition* p)
     623{
     624  secondaryParticle = p;
     625}
     626
     627//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     628
     629inline void G4VEmProcess::SetStartFromNullFlag(G4bool val)
     630{
     631  startFromNull = val;
    651632}
    652633
  • trunk/source/processes/electromagnetic/utils/include/G4VEnergyLossProcess.hh

    r1196 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VEnergyLossProcess.hh,v 1.89 2009/07/03 14:39:17 vnivanch Exp $
     26// $Id: G4VEnergyLossProcess.hh,v 1.92 2010/04/28 14:43:13 vnivanch Exp $
    2727// GEANT4 tag $Name:
    2828//
     
    196196  // Sampling of secondaries in vicinity of geometrical boundary
    197197  void SampleSubCutSecondaries(std::vector<G4Track*>&, const G4Step&,
    198                                G4VEmModel* model, G4int matIdx,
    199                                G4double& extraEdep);
     198                               G4VEmModel* model, G4int matIdx);
    200199
    201200  // PostStep sampling of secondaries
     
    418417  // Run time method for simulation of ionisation
    419418  //------------------------------------------------------------------------
     419
     420  // access atom on which interaction happens
     421  const G4Element* GetCurrentElement() const;
    420422
    421423  // sample range at the end of a step
     
    553555};
    554556
    555 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    556 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     557// ======== Run time inline methods ================
    557558
    558559inline size_t G4VEnergyLossProcess::CurrentMaterialCutsCoupleIndex() const
     
    586587//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    587588
    588 inline void G4VEnergyLossProcess::SetFluctModel(G4VEmFluctuationModel* p)
    589 {
    590   fluctModel = p;
    591 }
    592 
    593 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    594 
    595 inline G4VEmFluctuationModel* G4VEnergyLossProcess::FluctModel()
    596 {
    597   return fluctModel;
    598 }
    599 
    600 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    601 
    602 inline void G4VEnergyLossProcess::SetParticle(const G4ParticleDefinition* p)
    603 {
    604   particle = p;
    605 }
    606 
    607 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    608 
    609 inline void G4VEnergyLossProcess::SetSecondaryParticle(const G4ParticleDefinition* p)
    610 {
    611   secondaryParticle = p;
    612 }
    613 
    614 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    615 
    616 inline void G4VEnergyLossProcess::SetBaseParticle(const G4ParticleDefinition* p)
    617 {
    618   baseParticle = p;
    619 }
    620 
    621 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    622 
    623 inline const G4ParticleDefinition* G4VEnergyLossProcess::Particle() const
    624 {
    625   return particle;
    626 }
    627 
    628 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    629 
    630 inline const G4ParticleDefinition* G4VEnergyLossProcess::BaseParticle() const
    631 {
    632   return baseParticle;
    633 }
    634 
    635 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    636 
    637 inline const G4ParticleDefinition* G4VEnergyLossProcess::SecondaryParticle() const
    638 {
    639   return secondaryParticle;
    640 }
    641 
    642 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    643 
    644 inline void G4VEnergyLossProcess::SetLossFluctuations(G4bool val)
    645 {
    646   lossFluctuationFlag = val;
    647 }
    648 
    649 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    650 
    651 inline void G4VEnergyLossProcess::SetRandomStep(G4bool val)
    652 {
    653   rndmStepFlag = val;
    654 }
    655 
    656 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    657 
    658 inline void G4VEnergyLossProcess::SetIntegral(G4bool val)
    659 {
    660   integral = val;
    661 }
    662 
    663 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    664  
    665 inline G4bool G4VEnergyLossProcess::IsIntegral() const
    666 {
    667   return integral;
    668 }
    669 
    670 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    671 
    672 inline void G4VEnergyLossProcess::SetIonisation(G4bool val)
    673 {
    674   isIonisation = val;
    675   if(val) aGPILSelection = CandidateForSelection;
    676   else    aGPILSelection = NotCandidateForSelection;
    677 }
    678 
    679 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    680 
    681 inline G4bool G4VEnergyLossProcess::IsIonisationProcess() const
    682 {
    683   return isIonisation;
    684 }
    685 
    686 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    687 
    688 inline void G4VEnergyLossProcess::SetLinearLossLimit(G4double val)
    689 {
    690   linLossLimit = val;
    691 }
    692 
    693 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    694 
    695 inline void G4VEnergyLossProcess::SetMinSubRange(G4double val)
    696 {
    697   minSubRange = val;
    698 }
    699 
    700 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    701 
    702 inline void G4VEnergyLossProcess::SetLambdaFactor(G4double val)
    703 {
    704   if(val > 0.0 && val <= 1.0) lambdaFactor = val;
    705 }
    706 
    707 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    708 
    709 void G4VEnergyLossProcess::SetStepFunction(G4double v1, G4double v2)
    710 {
    711   dRoverRange = v1;
    712   finalRange = v2;
    713   if (dRoverRange > 0.999) dRoverRange = 1.0;
    714   currentCouple = 0;
    715   mfpKinEnergy  = DBL_MAX;
    716 }
    717 
    718 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    719 
    720 inline void G4VEnergyLossProcess::SetLowestEnergyLimit(G4double val)
    721 {
    722   lowestKinEnergy = val;
    723 }
    724 
    725 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    726 
    727 inline G4int G4VEnergyLossProcess::NumberOfSubCutoffRegions() const
    728 {
    729   return nSCoffRegions;
    730 }
    731 
    732 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    733 
    734 inline G4int G4VEnergyLossProcess::NumberOfDERegions() const
    735 {
    736   return nDERegions;
    737 }
    738 
    739 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    740 
    741 inline void G4VEnergyLossProcess::SetDEDXBinning(G4int nbins)
    742 {
    743   nBins = nbins;
    744 }
    745 
    746 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    747 
    748 inline void G4VEnergyLossProcess::SetLambdaBinning(G4int nbins)
    749 {
    750   nBins = nbins;
    751 }
    752 
    753 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    754 
    755 inline void G4VEnergyLossProcess::SetDEDXBinningForCSDARange(G4int nbins)
    756 {
    757   nBinsCSDA = nbins;
    758 }
    759 
    760 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    761 
    762 inline void G4VEnergyLossProcess::SetMinKinEnergy(G4double e)
    763 {
    764   minKinEnergy = e;
    765 }
    766 
    767 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    768 
    769 inline G4double G4VEnergyLossProcess::MinKinEnergy() const
    770 {
    771   return minKinEnergy;
    772 }
    773 
    774 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    775 
    776 inline void G4VEnergyLossProcess::SetMaxKinEnergy(G4double e)
    777 {
    778   maxKinEnergy = e;
    779   if(e < maxKinEnergyCSDA) maxKinEnergyCSDA = e;
    780 }
    781 
    782 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    783 
    784 inline G4double G4VEnergyLossProcess::MaxKinEnergy() const
    785 {
    786   return maxKinEnergy;
    787 }
    788 
    789 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    790 
    791 inline void G4VEnergyLossProcess::SetMaxKinEnergyForCSDARange(G4double e)
    792 {
    793   maxKinEnergyCSDA = e;
    794 }
    795 
    796 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    797 
    798 inline G4double G4VEnergyLossProcess::GetDEDX(G4double& kineticEnergy,
    799                                         const G4MaterialCutsCouple* couple)
     589inline void
     590G4VEnergyLossProcess::DefineMaterial(const G4MaterialCutsCouple* couple)
     591{
     592  if(couple != currentCouple) {
     593    currentCouple   = couple;
     594    currentMaterial = couple->GetMaterial();
     595    currentMaterialIndex = couple->GetIndex();
     596    mfpKinEnergy = DBL_MAX;
     597  }
     598}
     599
     600//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     601
     602inline void G4VEnergyLossProcess::SetDynamicMassCharge(G4double massratio,
     603                                                       G4double charge2ratio)
     604{
     605  massRatio     = massratio;
     606  chargeSqRatio = charge2ratio;
     607  reduceFactor  = 1.0/(chargeSqRatio*massRatio);
     608}
     609
     610//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     611
     612inline G4double G4VEnergyLossProcess::GetDEDXForScaledEnergy(G4double e)
     613{
     614  G4double x = ((*theDEDXTable)[currentMaterialIndex]->Value(e))*chargeSqRatio;
     615  if(e < minKinEnergy) { x *= std::sqrt(e/minKinEnergy); }
     616  return x;
     617}
     618
     619//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     620
     621inline G4double G4VEnergyLossProcess::GetSubDEDXForScaledEnergy(G4double e)
     622{
     623  G4double x = ((*theDEDXSubTable)[currentMaterialIndex]->Value(e))*chargeSqRatio;
     624  if(e < minKinEnergy) { x *= std::sqrt(e/minKinEnergy); }
     625  return x;
     626}
     627
     628//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     629
     630inline G4double G4VEnergyLossProcess::GetIonisationForScaledEnergy(G4double e)
     631{
     632  //G4double x = 0.0;
     633  //  if(theIonisationTable) {
     634  G4double x = ((*theIonisationTable)[currentMaterialIndex]->Value(e))*chargeSqRatio;
     635  if(e < minKinEnergy) { x *= std::sqrt(e/minKinEnergy); }
     636  //}
     637  return x;
     638}
     639
     640//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     641
     642inline
     643G4double G4VEnergyLossProcess::GetSubIonisationForScaledEnergy(G4double e)
     644{
     645  //  G4double x = 0.0;
     646  //if(theIonisationSubTable) {
     647  G4double x = ((*theIonisationSubTable)[currentMaterialIndex]->Value(e))*chargeSqRatio;
     648  if(e < minKinEnergy) { x *= std::sqrt(e/minKinEnergy); }
     649  //}
     650  return x;
     651}
     652
     653//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     654
     655inline G4double G4VEnergyLossProcess::GetScaledRangeForScaledEnergy(G4double e)
     656{
     657  G4double x = ((*theRangeTableForLoss)[currentMaterialIndex])->Value(e);
     658  if(e < minKinEnergy) { x *= std::sqrt(e/minKinEnergy); }
     659  return x;
     660}
     661
     662//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     663
     664inline G4double
     665G4VEnergyLossProcess::GetLimitScaledRangeForScaledEnergy(G4double e)
     666{
     667  G4double x;
     668
     669  if (e < maxKinEnergyCSDA) {
     670    x = ((*theCSDARangeTable)[currentMaterialIndex])->Value(e);
     671    if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
     672  } else {
     673    x = theRangeAtMaxEnergy[currentMaterialIndex] +
     674         (e - maxKinEnergyCSDA)/theDEDXAtMaxEnergy[currentMaterialIndex];
     675  }
     676  return x;
     677}
     678
     679//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     680
     681inline G4double G4VEnergyLossProcess::ScaledKinEnergyForLoss(G4double r)
     682{
     683  G4PhysicsVector* v = (*theInverseRangeTable)[currentMaterialIndex];
     684  G4double rmin = v->Energy(0);
     685  G4double e = 0.0;
     686  if(r >= rmin) { e = v->Value(r); }
     687  else if(r > 0.0) {
     688    G4double x = r/rmin;
     689    e = minKinEnergy*x*x;
     690  }
     691  return e;
     692}
     693
     694//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     695
     696inline G4double G4VEnergyLossProcess::GetLambdaForScaledEnergy(G4double e)
     697{
     698  return chargeSqRatio*(((*theLambdaTable)[currentMaterialIndex])->Value(e));
     699}
     700
     701//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     702
     703inline G4double
     704G4VEnergyLossProcess::GetDEDX(G4double& kineticEnergy,
     705                              const G4MaterialCutsCouple* couple)
    800706{
    801707  DefineMaterial(couple);
     
    805711//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    806712
    807 inline G4double G4VEnergyLossProcess::GetDEDXForSubsec(G4double& kineticEnergy,
    808                                         const G4MaterialCutsCouple* couple)
     713inline G4double
     714G4VEnergyLossProcess::GetDEDXForSubsec(G4double& kineticEnergy,
     715                                                const G4MaterialCutsCouple* couple)
    809716{
    810717  DefineMaterial(couple);
     
    814721//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    815722
    816 inline G4double G4VEnergyLossProcess::GetRange(G4double& kineticEnergy,
    817                                          const G4MaterialCutsCouple* couple)
     723inline G4double
     724G4VEnergyLossProcess::GetRange(G4double& kineticEnergy,
     725                               const G4MaterialCutsCouple* couple)
    818726{
    819727  G4double x = fRange;
     
    831739//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    832740
    833 inline G4double G4VEnergyLossProcess::GetCSDARange(
    834        G4double& kineticEnergy, const G4MaterialCutsCouple* couple)
     741inline G4double
     742G4VEnergyLossProcess::GetCSDARange(G4double& kineticEnergy,
     743                                   const G4MaterialCutsCouple* couple)
    835744{
    836745  DefineMaterial(couple);
     
    844753//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    845754
    846 inline G4double G4VEnergyLossProcess::GetRangeForLoss(
    847                 G4double& kineticEnergy,
    848                 const G4MaterialCutsCouple* couple)
     755inline G4double
     756G4VEnergyLossProcess::GetRangeForLoss(G4double& kineticEnergy,
     757                                      const G4MaterialCutsCouple* couple)
    849758{
    850759  DefineMaterial(couple);
     
    859768//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    860769
    861 inline G4double G4VEnergyLossProcess::GetKineticEnergy(
    862                 G4double& range,
    863                 const G4MaterialCutsCouple* couple)
     770inline G4double
     771G4VEnergyLossProcess::GetKineticEnergy(G4double& range,
     772                                       const G4MaterialCutsCouple* couple)
    864773{
    865774  DefineMaterial(couple);
     
    871780//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    872781
    873 inline G4double G4VEnergyLossProcess::GetLambda(G4double& kineticEnergy,
    874                                           const G4MaterialCutsCouple* couple)
     782inline G4double
     783G4VEnergyLossProcess::GetLambda(G4double& kineticEnergy,
     784                                const G4MaterialCutsCouple* couple)
    875785{
    876786  DefineMaterial(couple);
    877787  G4double x = 0.0;
    878   if(theLambdaTable) x = GetLambdaForScaledEnergy(kineticEnergy*massRatio);
     788  if(theLambdaTable) { x = GetLambdaForScaledEnergy(kineticEnergy*massRatio); }
    879789  return x;
    880 }
    881 
    882 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    883 
    884 inline G4bool G4VEnergyLossProcess::TablesAreBuilt() const
    885 {
    886   return  tablesAreBuilt;
    887 }
    888 
    889 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    890 
    891 inline G4PhysicsTable* G4VEnergyLossProcess::DEDXTable() const
    892 {
    893   return theDEDXTable;
    894 }
    895 
    896 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    897 
    898 inline G4PhysicsTable* G4VEnergyLossProcess::DEDXTableForSubsec() const
    899 {
    900   return theDEDXSubTable;
    901 }
    902 
    903 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    904 
    905 inline G4PhysicsTable* G4VEnergyLossProcess::DEDXunRestrictedTable() const
    906 {
    907   return theDEDXunRestrictedTable;
    908 }
    909 
    910 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    911 
    912 inline G4PhysicsTable* G4VEnergyLossProcess::IonisationTable() const
    913 {
    914   G4PhysicsTable* t = theDEDXTable;
    915   if(theIonisationTable) t = theIonisationTable;
    916   return t;
    917 }
    918 
    919 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    920 
    921 inline G4PhysicsTable* G4VEnergyLossProcess::IonisationTableForSubsec() const
    922 {
    923   G4PhysicsTable* t = theDEDXSubTable;
    924   if(theIonisationSubTable) t = theIonisationSubTable;
    925   return t;
    926 }
    927 
    928 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    929 
    930 inline G4PhysicsTable* G4VEnergyLossProcess::CSDARangeTable() const
    931 {
    932   return theCSDARangeTable;
    933 }
    934 
    935 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    936 
    937 inline G4PhysicsTable* G4VEnergyLossProcess::RangeTableForLoss() const
    938 {
    939   return theRangeTableForLoss;
    940 }
    941 
    942 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    943 
    944 inline G4PhysicsTable* G4VEnergyLossProcess::InverseRangeTable() const
    945 {
    946   return theInverseRangeTable;
    947 }
    948 
    949 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    950 
    951 inline G4PhysicsTable* G4VEnergyLossProcess::LambdaTable()
    952 {
    953   return theLambdaTable;
    954 }
    955 
    956 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    957 
    958 inline G4PhysicsTable* G4VEnergyLossProcess::SubLambdaTable()
    959 {
    960   return theSubLambdaTable;
    961 }
    962 
    963 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    964 
    965 inline G4double G4VEnergyLossProcess::SampleRange()
    966 {
    967   G4double e = amu_c2*preStepKinEnergy/particle->GetPDGMass();
    968   G4double s = fRange*std::pow(10.,vstrag->Value(e));
    969   G4double x = fRange + G4RandGauss::shoot(0.0,s);
    970   if(x > 0.0) fRange = x;
    971   return fRange;
    972 }
    973 
    974 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    975 
    976 inline void G4VEnergyLossProcess::SetDynamicMassCharge(G4double massratio,
    977                                                        G4double charge2ratio)
    978 {
    979   massRatio     = massratio;
    980   chargeSqRatio = charge2ratio;
    981   reduceFactor  = 1.0/(chargeSqRatio*massRatio);
    982 }
    983 
    984 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    985 
    986 inline void G4VEnergyLossProcess::DefineMaterial(
    987             const G4MaterialCutsCouple* couple)
    988 {
    989   if(couple != currentCouple) {
    990     currentCouple   = couple;
    991     currentMaterial = couple->GetMaterial();
    992     currentMaterialIndex = couple->GetIndex();
    993     mfpKinEnergy = DBL_MAX;
    994   }
    995 }
    996 
    997 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    998 
    999 inline G4double G4VEnergyLossProcess::GetDEDXForScaledEnergy(G4double e)
    1000 {
    1001   G4double x = ((*theDEDXTable)[currentMaterialIndex]->Value(e))*chargeSqRatio;
    1002   if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
    1003   return x;
    1004 }
    1005 
    1006 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    1007 
    1008 inline G4double G4VEnergyLossProcess::GetSubDEDXForScaledEnergy(G4double e)
    1009 {
    1010   G4double x = ((*theDEDXSubTable)[currentMaterialIndex]->Value(e))*chargeSqRatio;
    1011   if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
    1012   return x;
    1013 }
    1014 
    1015 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    1016 
    1017 inline G4double G4VEnergyLossProcess::GetIonisationForScaledEnergy(G4double e)
    1018 {
    1019   //G4double x = 0.0;
    1020   //  if(theIonisationTable) {
    1021   G4double x = ((*theIonisationTable)[currentMaterialIndex]->Value(e))*chargeSqRatio;
    1022   if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
    1023   //}
    1024   return x;
    1025 }
    1026 
    1027 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    1028 
    1029 inline
    1030 G4double G4VEnergyLossProcess::GetSubIonisationForScaledEnergy(G4double e)
    1031 {
    1032   //  G4double x = 0.0;
    1033   //if(theIonisationSubTable) {
    1034   G4double x = ((*theIonisationSubTable)[currentMaterialIndex]->Value(e))*chargeSqRatio;
    1035   if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
    1036   //}
    1037   return x;
    1038 }
    1039 
    1040 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    1041 
    1042 inline G4double G4VEnergyLossProcess::GetScaledRangeForScaledEnergy(G4double e)
    1043 {
    1044   G4double x = ((*theRangeTableForLoss)[currentMaterialIndex])->Value(e);
    1045   if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
    1046   return x;
    1047 }
    1048 
    1049 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    1050 
    1051 inline G4double G4VEnergyLossProcess::GetLimitScaledRangeForScaledEnergy(
    1052                 G4double e)
    1053 {
    1054   G4double x;
    1055 
    1056   if (e < maxKinEnergyCSDA) {
    1057     x = ((*theCSDARangeTable)[currentMaterialIndex])->Value(e);
    1058     if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
    1059   } else {
    1060     x = theRangeAtMaxEnergy[currentMaterialIndex] +
    1061          (e - maxKinEnergyCSDA)/theDEDXAtMaxEnergy[currentMaterialIndex];
    1062   }
    1063   return x;
    1064 }
    1065 
    1066 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    1067 
    1068 inline G4double G4VEnergyLossProcess::ScaledKinEnergyForLoss(G4double r)
    1069 {
    1070   G4PhysicsVector* v = (*theInverseRangeTable)[currentMaterialIndex];
    1071   G4double rmin = v->Energy(0);
    1072   G4double e = 0.0;
    1073   if(r >= rmin) { e = v->Value(r); }
    1074   else if(r > 0.0) {
    1075     G4double x = r/rmin;
    1076     e = minKinEnergy*x*x;
    1077   }
    1078   return e;
    1079 }
    1080 
    1081 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    1082 
    1083 inline G4double G4VEnergyLossProcess::GetLambdaForScaledEnergy(G4double e)
    1084 {
    1085   return chargeSqRatio*(((*theLambdaTable)[currentMaterialIndex])->Value(e));
    1086790}
    1087791
     
    1111815//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    1112816
     817inline G4double G4VEnergyLossProcess::SampleRange()
     818{
     819  G4double e = amu_c2*preStepKinEnergy/particle->GetPDGMass();
     820  G4double s = fRange*std::pow(10.,vstrag->Value(e));
     821  G4double x = fRange + G4RandGauss::shoot(0.0,s);
     822  if(x > 0.0) { fRange = x; }
     823  return fRange;
     824}
     825
     826// ======== Get/Set inline methods used at initialisation ================
     827
     828inline void G4VEnergyLossProcess::SetFluctModel(G4VEmFluctuationModel* p)
     829{
     830  fluctModel = p;
     831}
     832
     833//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     834
     835inline G4VEmFluctuationModel* G4VEnergyLossProcess::FluctModel()
     836{
     837  return fluctModel;
     838}
     839
     840//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     841
     842inline void G4VEnergyLossProcess::SetParticle(const G4ParticleDefinition* p)
     843{
     844  particle = p;
     845}
     846
     847//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     848
     849inline void G4VEnergyLossProcess::SetSecondaryParticle(const G4ParticleDefinition* p)
     850{
     851  secondaryParticle = p;
     852}
     853
     854//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     855
     856inline void G4VEnergyLossProcess::SetBaseParticle(const G4ParticleDefinition* p)
     857{
     858  baseParticle = p;
     859}
     860
     861//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     862
     863inline const G4ParticleDefinition* G4VEnergyLossProcess::Particle() const
     864{
     865  return particle;
     866}
     867
     868//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     869
     870inline const G4ParticleDefinition* G4VEnergyLossProcess::BaseParticle() const
     871{
     872  return baseParticle;
     873}
     874
     875//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     876
     877inline const G4ParticleDefinition* G4VEnergyLossProcess::SecondaryParticle() const
     878{
     879  return secondaryParticle;
     880}
     881
     882//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     883
     884inline void G4VEnergyLossProcess::SetLossFluctuations(G4bool val)
     885{
     886  lossFluctuationFlag = val;
     887}
     888
     889//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     890
     891inline void G4VEnergyLossProcess::SetRandomStep(G4bool val)
     892{
     893  rndmStepFlag = val;
     894}
     895
     896//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     897
     898inline void G4VEnergyLossProcess::SetIntegral(G4bool val)
     899{
     900  integral = val;
     901}
     902
     903//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     904 
     905inline G4bool G4VEnergyLossProcess::IsIntegral() const
     906{
     907  return integral;
     908}
     909
     910//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     911
     912inline void G4VEnergyLossProcess::SetIonisation(G4bool val)
     913{
     914  isIonisation = val;
     915  if(val) { aGPILSelection = CandidateForSelection; }
     916  else    { aGPILSelection = NotCandidateForSelection; }
     917}
     918
     919//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     920
     921inline G4bool G4VEnergyLossProcess::IsIonisationProcess() const
     922{
     923  return isIonisation;
     924}
     925
     926//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     927
     928inline void G4VEnergyLossProcess::SetLinearLossLimit(G4double val)
     929{
     930  linLossLimit = val;
     931}
     932
     933//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     934
     935inline void G4VEnergyLossProcess::SetMinSubRange(G4double val)
     936{
     937  minSubRange = val;
     938}
     939
     940//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     941
     942inline void G4VEnergyLossProcess::SetLambdaFactor(G4double val)
     943{
     944  if(val > 0.0 && val <= 1.0) { lambdaFactor = val; }
     945}
     946
     947//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     948
     949void G4VEnergyLossProcess::SetStepFunction(G4double v1, G4double v2)
     950{
     951  dRoverRange = v1;
     952  finalRange = v2;
     953  if (dRoverRange > 0.999) { dRoverRange = 1.0; }
     954  currentCouple = 0;
     955  mfpKinEnergy  = DBL_MAX;
     956}
     957
     958//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     959
     960inline void G4VEnergyLossProcess::SetLowestEnergyLimit(G4double val)
     961{
     962  lowestKinEnergy = val;
     963}
     964
     965//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     966
     967inline G4int G4VEnergyLossProcess::NumberOfSubCutoffRegions() const
     968{
     969  return nSCoffRegions;
     970}
     971
     972//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     973
     974inline G4int G4VEnergyLossProcess::NumberOfDERegions() const
     975{
     976  return nDERegions;
     977}
     978
     979//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     980
     981inline void G4VEnergyLossProcess::SetDEDXBinning(G4int nbins)
     982{
     983  nBins = nbins;
     984}
     985
     986//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     987
     988inline void G4VEnergyLossProcess::SetLambdaBinning(G4int nbins)
     989{
     990  nBins = nbins;
     991}
     992
     993//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     994
     995inline void G4VEnergyLossProcess::SetDEDXBinningForCSDARange(G4int nbins)
     996{
     997  nBinsCSDA = nbins;
     998}
     999
     1000//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     1001
     1002inline void G4VEnergyLossProcess::SetMinKinEnergy(G4double e)
     1003{
     1004  minKinEnergy = e;
     1005}
     1006
     1007//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     1008
     1009inline G4double G4VEnergyLossProcess::MinKinEnergy() const
     1010{
     1011  return minKinEnergy;
     1012}
     1013
     1014//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     1015
     1016inline void G4VEnergyLossProcess::SetMaxKinEnergy(G4double e)
     1017{
     1018  maxKinEnergy = e;
     1019  if(e < maxKinEnergyCSDA) { maxKinEnergyCSDA = e; }
     1020}
     1021
     1022//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     1023
     1024inline G4double G4VEnergyLossProcess::MaxKinEnergy() const
     1025{
     1026  return maxKinEnergy;
     1027}
     1028
     1029//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     1030
     1031inline void G4VEnergyLossProcess::SetMaxKinEnergyForCSDARange(G4double e)
     1032{
     1033  maxKinEnergyCSDA = e;
     1034}
     1035
     1036
     1037//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     1038
     1039inline G4bool G4VEnergyLossProcess::TablesAreBuilt() const
     1040{
     1041  return  tablesAreBuilt;
     1042}
     1043
     1044//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     1045
     1046inline G4PhysicsTable* G4VEnergyLossProcess::DEDXTable() const
     1047{
     1048  return theDEDXTable;
     1049}
     1050
     1051//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     1052
     1053inline G4PhysicsTable* G4VEnergyLossProcess::DEDXTableForSubsec() const
     1054{
     1055  return theDEDXSubTable;
     1056}
     1057
     1058//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     1059
     1060inline G4PhysicsTable* G4VEnergyLossProcess::DEDXunRestrictedTable() const
     1061{
     1062  return theDEDXunRestrictedTable;
     1063}
     1064
     1065//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     1066
     1067inline G4PhysicsTable* G4VEnergyLossProcess::IonisationTable() const
     1068{
     1069  G4PhysicsTable* t = theDEDXTable;
     1070  if(theIonisationTable) { t = theIonisationTable; }
     1071  return t;
     1072}
     1073
     1074//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     1075
     1076inline G4PhysicsTable* G4VEnergyLossProcess::IonisationTableForSubsec() const
     1077{
     1078  G4PhysicsTable* t = theDEDXSubTable;
     1079  if(theIonisationSubTable) { t = theIonisationSubTable; }
     1080  return t;
     1081}
     1082
     1083//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     1084
     1085inline G4PhysicsTable* G4VEnergyLossProcess::CSDARangeTable() const
     1086{
     1087  return theCSDARangeTable;
     1088}
     1089
     1090//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     1091
     1092inline G4PhysicsTable* G4VEnergyLossProcess::RangeTableForLoss() const
     1093{
     1094  return theRangeTableForLoss;
     1095}
     1096
     1097//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     1098
     1099inline G4PhysicsTable* G4VEnergyLossProcess::InverseRangeTable() const
     1100{
     1101  return theInverseRangeTable;
     1102}
     1103
     1104//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     1105
     1106inline G4PhysicsTable* G4VEnergyLossProcess::LambdaTable()
     1107{
     1108  return theLambdaTable;
     1109}
     1110
     1111//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     1112
     1113inline G4PhysicsTable* G4VEnergyLossProcess::SubLambdaTable()
     1114{
     1115  return theSubLambdaTable;
     1116}
     1117
     1118//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     1119
    11131120#endif
  • trunk/source/processes/electromagnetic/utils/include/G4VMultipleScattering.hh

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VMultipleScattering.hh,v 1.62 2009/10/29 17:56:04 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4VMultipleScattering.hh,v 1.63 2010/03/10 18:29:51 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    154154  // The function overloads the corresponding function of the base
    155155  // class.
    156   inline G4double PostStepGetPhysicalInteractionLength(
     156  G4double PostStepGetPhysicalInteractionLength(
    157157                                            const G4Track&,
    158158                                            G4double  previousStepSize,
     
    160160
    161161  // Along step actions
    162   inline G4VParticleChange* AlongStepDoIt(const G4Track&, const G4Step&);
     162  G4VParticleChange* AlongStepDoIt(const G4Track&, const G4Step&);
    163163
    164164  // Post step actions
    165   inline G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&);
     165  G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&);
    166166
    167167  // This method does not used for tracking, it is intended only for tests
    168   inline G4double ContinuousStepLimit(const G4Track& track,
    169                                       G4double previousStepSize,
    170                                       G4double currentMinimalStep,
    171                                       G4double& currentSafety);
     168  G4double ContinuousStepLimit(const G4Track& track,
     169                               G4double previousStepSize,
     170                               G4double currentMinimalStep,
     171                               G4double& currentSafety);
    172172
    173173  //------------------------------------------------------------------------
     
    318318};
    319319
    320 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    321 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    322 
    323 inline G4double G4VMultipleScattering::ContinuousStepLimit(
    324                                        const G4Track& track,
    325                                        G4double previousStepSize,
    326                                        G4double currentMinimalStep,
    327                                        G4double& currentSafety)
    328 {
    329   return GetContinuousStepLimit(track,previousStepSize,currentMinimalStep,
    330                                 currentSafety);
    331 }
    332 
    333 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    334 
    335 inline void G4VMultipleScattering::SetBinning(G4int nbins)
    336 {
    337   nBins = nbins;
    338 }
    339 
    340 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    341 
    342 inline G4int G4VMultipleScattering::Binning() const
    343 {
    344   return nBins;
    345 }
    346 
    347 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    348 
    349 inline void G4VMultipleScattering::SetMinKinEnergy(G4double e)
    350 {
    351   minKinEnergy = e;
    352 }
    353 
    354 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    355 
    356 inline G4double G4VMultipleScattering::MinKinEnergy() const
    357 {
    358   return minKinEnergy;
    359 }
    360 
    361 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    362 
    363 inline void G4VMultipleScattering::SetMaxKinEnergy(G4double e)
    364 {
    365   maxKinEnergy = e;
    366 }
    367 
    368 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    369 
    370 inline G4double G4VMultipleScattering::MaxKinEnergy() const
    371 {
    372   return maxKinEnergy;
    373 }
    374 
    375 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    376 
    377 inline  void G4VMultipleScattering::SetBuildLambdaTable(G4bool val)
    378 {
    379   buildLambdaTable = val;
    380 }
    381 
    382 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    383 
    384 inline G4PhysicsTable* G4VMultipleScattering::LambdaTable() const
    385 {
    386   return theLambdaTable;
    387 }
    388 
    389 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    390 
    391 inline  const G4ParticleDefinition* G4VMultipleScattering::Particle() const
    392 {
    393   return currentParticle;
    394 }
    395 
    396 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    397 
    398 inline G4VEmModel* G4VMultipleScattering::SelectModel(G4double kinEnergy)
    399 {
    400   return modelManager->SelectModel(kinEnergy, currentMaterialIndex);
    401 }
    402 
    403 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    404 
    405 inline G4VEmModel* G4VMultipleScattering::SelectModelForMaterial(
    406                    G4double kinEnergy, size_t& idxRegion) const
    407 {
    408   return modelManager->SelectModel(kinEnergy, idxRegion);
    409 }
    410 
    411 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    412 
    413 inline  G4bool G4VMultipleScattering::LateralDisplasmentFlag() const
    414 {
    415   return latDisplasment;
    416 }
    417 
    418 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    419 
    420 inline  void G4VMultipleScattering::SetLateralDisplasmentFlag(G4bool val)
    421 {
    422   latDisplasment = val;
    423 }
    424 
    425 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    426 
    427 inline  G4double G4VMultipleScattering::Skin() const
    428 {
    429   return skin;
    430 }
    431 
    432 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    433 
    434 inline  void G4VMultipleScattering::SetSkin(G4double val)
    435 {
    436   if(val < 1.0) skin = 0.0;
    437   else          skin = val;
    438 }
    439 
    440 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    441 
    442 inline  G4double G4VMultipleScattering::RangeFactor() const
    443 {
    444   return facrange;
    445 }
    446 
    447 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    448 
    449 inline  void G4VMultipleScattering::SetRangeFactor(G4double val)
    450 {
    451   if(val > 0.0) facrange = val;
    452 }
    453 
    454 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    455 
    456 inline  G4double G4VMultipleScattering::GeomFactor() const
    457 {
    458   return facgeom;
    459 }
    460 
    461 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    462 
    463 inline  void G4VMultipleScattering::SetGeomFactor(G4double val)
    464 {
    465   if(val > 0.0) facgeom = val;
    466 }
    467 
    468 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    469 
    470 inline  G4double G4VMultipleScattering::PolarAngleLimit() const
    471 {
    472   return polarAngleLimit;
    473 }
    474 
    475 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    476 
    477 inline  void G4VMultipleScattering::SetPolarAngleLimit(G4double val)
    478 {
    479   if(val < 0.0)     polarAngleLimit = 0.0;
    480   else if(val > pi) polarAngleLimit = pi;
    481   else              polarAngleLimit = val;
    482 }
    483 
    484 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    485 
    486 inline G4MscStepLimitType G4VMultipleScattering::StepLimitType() const
    487 {
    488   return stepLimit;
    489 }
    490 
    491 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    492 
    493 inline void G4VMultipleScattering::SetStepLimitType(G4MscStepLimitType val)
    494 {
    495   stepLimit = val;
    496   if(val == fMinimal) facrange = 0.2;
     320// ======== Run time inline methods ================
     321
     322inline const G4MaterialCutsCouple*
     323G4VMultipleScattering::CurrentMaterialCutsCouple() const
     324{
     325  return currentCouple;
     326}
     327
     328//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     329
     330inline
     331void G4VMultipleScattering::DefineMaterial(const G4MaterialCutsCouple* couple)
     332{
     333  if(couple != currentCouple) {
     334    currentCouple   = couple;
     335    currentMaterialIndex = couple->GetIndex();
     336  }
    497337}
    498338
     
    509349    x = currentModel->CrossSection(currentCouple,p,e);
    510350  }
    511   if(x > DBL_MIN) x = 1./x;
    512   else            x = DBL_MAX;
     351  if(x > DBL_MIN) { x = 1./x; }
     352  else            { x = DBL_MAX; }
    513353  return x;
    514354}
     
    516356//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    517357
    518 inline
    519 void G4VMultipleScattering::DefineMaterial(const G4MaterialCutsCouple* couple)
    520 {
    521   if(couple != currentCouple) {
    522     currentCouple   = couple;
    523     currentMaterialIndex = couple->GetIndex();
    524   }
    525 }
    526 
    527 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    528 
    529 inline const G4MaterialCutsCouple*
    530 G4VMultipleScattering::CurrentMaterialCutsCouple() const
    531 {
    532   return currentCouple;
    533 }
    534 
    535 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    536 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    537 
    538 // Follwoing methods are virtual, they are inlined because they applied at
    539 // each simulation step and some compilers may inline these methods
    540 
    541 inline G4double
    542 G4VMultipleScattering::PostStepGetPhysicalInteractionLength(
    543               const G4Track&, G4double, G4ForceCondition* condition)
    544 {
    545   *condition = Forced;
    546   return DBL_MAX;
    547 }
    548 
    549 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    550 
    551 inline G4VParticleChange*
    552 G4VMultipleScattering::AlongStepDoIt(const G4Track& track, const G4Step& step)
    553 {
    554   if(currentModel->IsActive(track.GetKineticEnergy())) {
    555     fParticleChange.ProposeTrueStepLength(currentModel->ComputeTrueStepLength(step.GetStepLength()));
    556   }
    557   return &fParticleChange;
    558 }
    559 
    560 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    561 
    562 inline G4VParticleChange*
    563 G4VMultipleScattering::PostStepDoIt(const G4Track& track, const G4Step& step)
    564 {
    565   fParticleChange.Initialize(track);
    566   if(currentModel->IsActive(track.GetKineticEnergy())) {
    567     currentModel->SampleScattering(track.GetDynamicParticle(),
    568                                    step.GetPostStepPoint()->GetSafety());
    569   }
    570   return &fParticleChange;
     358inline G4VEmModel* G4VMultipleScattering::SelectModel(G4double kinEnergy)
     359{
     360  return modelManager->SelectModel(kinEnergy, currentMaterialIndex);
     361}
     362
     363//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     364
     365inline G4VEmModel* G4VMultipleScattering::SelectModelForMaterial(
     366                   G4double kinEnergy, size_t& idxRegion) const
     367{
     368  return modelManager->SelectModel(kinEnergy, idxRegion);
     369}
     370
     371// ======== Get/Set inline methods used at initialisation ================
     372
     373inline void G4VMultipleScattering::SetBinning(G4int nbins)
     374{
     375  nBins = nbins;
     376}
     377
     378//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     379
     380inline G4int G4VMultipleScattering::Binning() const
     381{
     382  return nBins;
     383}
     384
     385//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     386
     387inline void G4VMultipleScattering::SetMinKinEnergy(G4double e)
     388{
     389  minKinEnergy = e;
     390}
     391
     392//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     393
     394inline G4double G4VMultipleScattering::MinKinEnergy() const
     395{
     396  return minKinEnergy;
     397}
     398
     399//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     400
     401inline void G4VMultipleScattering::SetMaxKinEnergy(G4double e)
     402{
     403  maxKinEnergy = e;
     404}
     405
     406//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     407
     408inline G4double G4VMultipleScattering::MaxKinEnergy() const
     409{
     410  return maxKinEnergy;
     411}
     412
     413//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     414
     415inline  void G4VMultipleScattering::SetBuildLambdaTable(G4bool val)
     416{
     417  buildLambdaTable = val;
     418}
     419
     420//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     421
     422inline G4PhysicsTable* G4VMultipleScattering::LambdaTable() const
     423{
     424  return theLambdaTable;
     425}
     426
     427//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     428
     429inline  const G4ParticleDefinition* G4VMultipleScattering::Particle() const
     430{
     431  return currentParticle;
     432}
     433
     434//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     435
     436inline  G4bool G4VMultipleScattering::LateralDisplasmentFlag() const
     437{
     438  return latDisplasment;
     439}
     440
     441//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     442
     443inline  void G4VMultipleScattering::SetLateralDisplasmentFlag(G4bool val)
     444{
     445  latDisplasment = val;
     446}
     447
     448//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     449
     450inline  G4double G4VMultipleScattering::Skin() const
     451{
     452  return skin;
     453}
     454
     455//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     456
     457inline  void G4VMultipleScattering::SetSkin(G4double val)
     458{
     459  if(val < 1.0) { skin = 0.0; }
     460  else          { skin = val; }
     461}
     462
     463//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     464
     465inline  G4double G4VMultipleScattering::RangeFactor() const
     466{
     467  return facrange;
     468}
     469
     470//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     471
     472inline  void G4VMultipleScattering::SetRangeFactor(G4double val)
     473{
     474  if(val > 0.0) facrange = val;
     475}
     476
     477//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     478
     479inline  G4double G4VMultipleScattering::GeomFactor() const
     480{
     481  return facgeom;
     482}
     483
     484//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     485
     486inline  void G4VMultipleScattering::SetGeomFactor(G4double val)
     487{
     488  if(val > 0.0) facgeom = val;
     489}
     490
     491//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     492
     493inline  G4double G4VMultipleScattering::PolarAngleLimit() const
     494{
     495  return polarAngleLimit;
     496}
     497
     498//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     499
     500inline  void G4VMultipleScattering::SetPolarAngleLimit(G4double val)
     501{
     502  if(val < 0.0)            { polarAngleLimit = 0.0; }
     503  else if(val > CLHEP::pi) { polarAngleLimit = CLHEP::pi; }
     504  else                     { polarAngleLimit = val; }
     505}
     506
     507//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     508
     509inline G4MscStepLimitType G4VMultipleScattering::StepLimitType() const
     510{
     511  return stepLimit;
     512}
     513
     514//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     515
     516inline void G4VMultipleScattering::SetStepLimitType(G4MscStepLimitType val)
     517{
     518  stepLimit = val;
     519  if(val == fMinimal) { facrange = 0.2; }
    571520}
    572521
  • trunk/source/processes/electromagnetic/utils/src/G4EmCalculator.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4EmCalculator.cc,v 1.49 2009/11/22 17:58:39 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4EmCalculator.cc,v 1.53 2010/04/13 10:58:03 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    9494  currentMaterial    = 0;
    9595  currentParticle    = 0;
     96  lambdaParticle     = 0;
    9697  baseParticle       = 0;
    9798  currentLambda      = 0;
     
    102103  currentParticleName= "";
    103104  currentMaterialName= "";
     105  currentName        = "";
     106  lambdaName         = "";
    104107  theGenericIon      = G4GenericIon::GenericIon();
    105108  ionEffCharge       = new G4ionEffectiveCharge();
     
    113116{
    114117  delete ionEffCharge;
    115   for (G4int i=0; i<nLocalMaterials; i++) {
     118  for (G4int i=0; i<nLocalMaterials; ++i) {
    116119    delete localCouples[i];
    117120  }
     
    310313    G4int idx = couple->GetIndex();
    311314    FindLambdaTable(p, processName);
     315
    312316    if(currentLambda) {
    313317      G4double e = kinEnergy*massRatio;
    314318      res = (((*currentLambda)[idx])->Value(e))*chargeSquare;
    315319      if(verbose>0) {
    316         G4cout << "E(MeV)= " << kinEnergy/MeV
     320        G4cout << "G4EmCalculator::GetXSPerVolume: E(MeV)= " << kinEnergy/MeV
    317321               << " cross(cm-1)= " << res*cm
    318322               << "  " <<  p->GetParticleName()
    319323               << " in " <<  mat->GetName();
    320324        if(verbose>1)
    321           G4cout << "  idx= " << idx << "  e(MeV)= " << e
     325          G4cout << "  idx= " << idx << "  Escaled((MeV)= " << e
    322326                 << "  q2= " << chargeSquare;
    323327        G4cout << G4endl;
     
    350354  G4double res = DBL_MAX;
    351355  G4double x = GetCrossSectionPerVolume(kinEnergy,p, processName, mat,region);
    352   if(x > 0.0) res = 1.0/x;
     356  if(x > 0.0) { res = 1.0/x; }
    353357  if(verbose>1) {
    354358    G4cout << "G4EmCalculator::GetMeanFreePath: E(MeV)= " << kinEnergy/MeV
     
    495499             << " in " <<  currentMaterialName
    496500             << " Zi^2= " << chargeSquare
     501             << " isIon=" << isIon
    497502             << G4endl;
    498503    }
     
    516521      lManager->GetEnergyLossProcessVector();
    517522    G4int n = vel.size();
    518     for(G4int i=0; i<n; i++) {
     523    for(G4int i=0; i<n; ++i) {
    519524      const G4ParticleDefinition* p = (vel[i])->Particle();
    520       if((!isIon && p == part) || (isIon && p == theGenericIon))
     525      if((!isIon && p == part) || (isIon && p == theGenericIon)) {
    521526        dedx += ComputeDEDX(kinEnergy,part,(vel[i])->GetProcessName(),mat,cut);
     527      }
    522528    }
    523529  }
     
    619625      }
    620626      if(verbose>0) {
    621         G4cout << "E(MeV)= " << kinEnergy/MeV
     627        G4cout << "G4EmCalculator::ComputeXSPerVolume: E(MeV)= " << kinEnergy/MeV
    622628               << " cross(cm-1)= " << res*cm
     629               << " cut(keV)= " << cut/keV
    623630               << "  " <<  p->GetParticleName()
    624631               << " in " <<  mat->GetName()
     
    686693  return ComputeCrossSectionPerAtom(kinEnergy,FindParticle(particle),
    687694                                    processName,
    688                                     elm->GetZ(),elm->GetA(),cut);
     695                                    elm->GetZ(),elm->GetN(),cut);
    689696}
    690697
     
    886893  currentMaterial = material;
    887894  currentMaterialName = material->GetName();
    888   for (G4int i=0; i<nLocalMaterials; i++) {
     895  for (G4int i=0; i<nLocalMaterials; ++i) {
    889896    if(material == localMaterials[i] && cut == localCuts[i]) {
    890897      currentCouple = localCouples[i];
     
    911918{
    912919  // Search for the process
    913   if (p != currentParticle || processName != currentName) {
    914     currentName     = processName;
    915     currentLambda   = 0;
     920  if (!currentLambda || p != lambdaParticle || processName != lambdaName) {
     921    lambdaName     = processName;
     922    currentLambda  = 0;
     923    lambdaParticle = p;
    916924
    917925    G4String partname =  p->GetParticleName();
     
    924932    lManager->GetEnergyLossProcessVector();
    925933    G4int n = vel.size();
    926     for(G4int i=0; i<n; i++) {
    927       if((vel[i])->GetProcessName() == currentName &&
     934    for(G4int i=0; i<n; ++i) {
     935      if((vel[i])->GetProcessName() == lambdaName &&
    928936         (vel[i])->Particle() == part)
    929937        {
    930938          currentLambda = (vel[i])->LambdaTable();
    931939          isApplicable    = true;
    932           break;
     940          if(verbose>1) {
     941            G4cout << "G4VEnergyLossProcess is found out: "
     942                   << currentName << G4endl;
     943          }
     944          return;
    933945        }
    934946    }
     
    938950      const std::vector<G4VEmProcess*> vem = lManager->GetEmProcessVector();
    939951      G4int n = vem.size();
    940       for(G4int i=0; i<n; i++) {
    941         if((vem[i])->GetProcessName() == currentName &&
     952      for(G4int i=0; i<n; ++i) {
     953        if((vem[i])->GetProcessName() == lambdaName &&
    942954           (vem[i])->Particle() == part)
    943955        {
    944956          currentLambda = (vem[i])->LambdaTable();
    945957          isApplicable    = true;
    946           break;
     958          if(verbose>1) {
     959            G4cout << "G4VEmProcess is found out: "
     960                   << currentName << G4endl;
     961          }
     962          return;
    947963        }
    948964      }
     
    954970        lManager->GetMultipleScatteringVector();
    955971      G4int n = vmsc.size();
    956       for(G4int i=0; i<n; i++) {
    957         if((vmsc[i])->GetProcessName() == currentName &&
     972      for(G4int i=0; i<n; ++i) {
     973        if((vmsc[i])->GetProcessName() == lambdaName &&
    958974           (vmsc[i])->Particle() == part)
    959975        {
    960976          currentLambda = (vmsc[i])->LambdaTable();
    961977          isApplicable    = true;
    962           break;
     978          if(verbose>1) {
     979            G4cout << "G4VMultipleScattering is found out: "
     980                   << currentName << G4endl;
     981          }
     982          return;
    963983        }
    964984      }
     
    10021022  G4int n = vel.size();
    10031023  G4VEnergyLossProcess* elproc = 0;
    1004   for(G4int i=0; i<n; i++) {
     1024  for(G4int i=0; i<n; ++i) {
    10051025    //    G4cout << "i= " << i << " part= "
    10061026    //  << (vel[i])->Particle()->GetParticleName()
     
    10231043    currentModel = elproc->SelectModelForMaterial(scaledEnergy, idx);
    10241044    G4double eth = currentModel->LowEnergyLimit();
    1025     loweModel = elproc->SelectModelForMaterial(eth - CLHEP::eV, idx);
     1045    if(eth > 0.0) {
     1046      loweModel = elproc->SelectModelForMaterial(eth - CLHEP::eV, idx);
     1047    }
    10261048  }
    10271049
     
    10301052    const std::vector<G4VEmProcess*> vem = lManager->GetEmProcessVector();
    10311053    G4int n = vem.size();
    1032     for(G4int i=0; i<n; i++) {
     1054    for(G4int i=0; i<n; ++i) {
    10331055      if((vem[i])->GetProcessName() == currentName &&
    10341056         (vem[i])->Particle() == part)
     
    10361058        currentModel = (vem[i])->SelectModelForMaterial(kinEnergy, idx);
    10371059        G4double eth = currentModel->LowEnergyLimit();
    1038         loweModel = (vem[i])->SelectModelForMaterial(eth - CLHEP::eV, idx);
     1060        if(eth > 0.0) {
     1061          loweModel = (vem[i])->SelectModelForMaterial(eth - CLHEP::eV, idx);
     1062        }
    10391063        break;
    10401064      }
     
    10471071      lManager->GetMultipleScatteringVector();
    10481072    G4int n = vmsc.size();
    1049     for(G4int i=0; i<n; i++) {
     1073    for(G4int i=0; i<n; ++i) {
    10501074      if((vmsc[i])->GetProcessName() == currentName &&
    10511075         (vmsc[i])->Particle() == part)
     
    10531077        currentModel = (vmsc[i])->SelectModelForMaterial(kinEnergy, idx);
    10541078        G4double eth = currentModel->LowEnergyLimit();
    1055         loweModel = (vmsc[i])->SelectModelForMaterial(eth - CLHEP::eV, idx); 
     1079        if(eth > 0.0) {
     1080          loweModel = (vmsc[i])->SelectModelForMaterial(eth - CLHEP::eV, idx);
     1081        }
    10561082        break;
    10571083      }
     
    10821108  const G4ParticleDefinition* part = p;
    10831109 
    1084   if(p->GetParticleType() == "nucleus" &&
    1085      partname != "deuteron" &&
    1086      partname != "triton") { part = theGenericIon; }
     1110  if(p->GetParticleType() == "nucleus"
     1111     && currentParticleName != "deuteron" 
     1112     && currentParticleName != "triton"
     1113     && currentParticleName != "alpha+"
     1114     && currentParticleName != "helium"
     1115     && currentParticleName != "hydrogen"
     1116     ) { part = theGenericIon; }
    10871117 
    10881118  G4LossTableManager* lManager = G4LossTableManager::Instance();
     
    10901120    lManager->GetEnergyLossProcessVector();
    10911121  G4int n = vel.size();
    1092   for(G4int i=0; i<n; i++) {
     1122  for(G4int i=0; i<n; ++i) {
    10931123    if( (vel[i])->Particle() == part ) {
    10941124      elp = vel[i];
  • trunk/source/processes/electromagnetic/utils/src/G4EmConfigurator.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4EmConfigurator.cc,v 1.6 2009/11/22 19:48:30 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4EmConfigurator.cc,v 1.8 2010/06/04 15:33:56 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    6161#include "G4VMultipleScattering.hh"
    6262
    63 enum PType {unknown=0, eloss, discrete, msc};
    64 
    65 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    66 
    67 G4EmConfigurator::G4EmConfigurator()
     63//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     64
     65G4EmConfigurator::G4EmConfigurator(G4int val):verbose(val)
    6866{
    6967  index = -10;
     
    7472G4EmConfigurator::~G4EmConfigurator()
    7573{}
    76 
    77 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    78 
    79 void G4EmConfigurator::AddExtraEmModel(const G4String& particleName,
    80                                        G4VEmModel* em,
    81                                        G4VEmFluctuationModel* fm)
    82 {
    83   particleList.push_back(particleName);
    84   modelList.push_back(em);
    85   flucModelList.push_back(fm);
    86 }
    87 
    88 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    89 
    90 void G4EmConfigurator::AddModelForRegion(const G4String& particleName,
    91                                          const G4String& processName,
    92                                          const G4String& modelName,
    93                                          const G4String& regionName,
    94                                          G4double emin, G4double emax,
    95                                          const G4String& flucModelName)
    96 {
    97   particles.push_back(particleName);
    98   processes.push_back(processName);
    99   models.push_back(modelName);
    100   regions.push_back(regionName);
    101   flucModels.push_back(flucModelName);
    102   lowEnergy.push_back(emin);
    103   highEnergy.push_back(emax);
    104 }
    10574
    10675//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    11483                                       G4VEmFluctuationModel* fm)
    11584{
    116   AddExtraEmModel(particleName, mod, fm);
    117   G4String fname = "";
    118   if(fm) fname = fm->GetName();
    119   G4String mname = "";
    120   if(mod) mname = mod->GetName();
    121   AddModelForRegion(particleName, processName, mname, regionName,
    122                     emin, emax, fname);
     85  if(1 < verbose) {
     86    G4cout << " G4EmConfigurator::SetExtraEmModel " << mod->GetName()
     87           << " for " << particleName
     88           << " and " << processName
     89           << " in the region <" << regionName
     90           << "> Emin(MeV)= " << emin/MeV
     91           << " Emax(MeV)= " << emax/MeV
     92           << G4endl;
     93  }
     94  if(mod || fm) {
     95    models.push_back(mod);
     96    flucModels.push_back(fm);
     97  } else {
     98    models.push_back(new G4DummyModel());
     99    flucModels.push_back(0);
     100  }
     101
     102  particles.push_back(particleName);
     103  processes.push_back(processName);
     104  regions.push_back(regionName);
     105  lowEnergy.push_back(emin);
     106  highEnergy.push_back(emax);
    123107}
    124108
     
    127111void G4EmConfigurator::AddModels()
    128112{
     113  size_t n = models.size();
     114  if(0 < verbose) {
     115    G4cout << "### G4EmConfigurator::AddModels n= " << n << G4endl;
     116  }
     117  if(n > 0) {
     118    for(size_t i=0; i<n; ++i) {
     119      if(models[i]) {
     120        G4Region* reg = FindRegion(regions[i]);
     121        if(reg) {
     122          --index;
     123          SetModelForRegion(models[i],flucModels[i],reg,
     124                            particles[i],processes[i],
     125                            lowEnergy[i],highEnergy[i]);
     126        }
     127      }
     128    }
     129  }
     130  Clear();
     131}
     132
     133//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     134
     135void G4EmConfigurator::SetModelForRegion(G4VEmModel* mod,
     136                                         G4VEmFluctuationModel* fm,
     137                                         G4Region* reg,
     138                                         const G4String& particleName,
     139                                         const G4String& processName,
     140                                         G4double emin, G4double emax)
     141{
     142  if(1 < verbose) {
     143    G4cout << " G4EmConfigurator::SetModelForRegion: " << mod->GetName()
     144           << G4endl;
     145    G4cout << " For " << particleName
     146           << " and " << processName
     147           << " in the region <" << reg->GetName()
     148           << " Emin(MeV)= " << emin/MeV
     149           << " Emax(MeV)= " << emax/MeV;
     150    if(fm) { G4cout << " FLmodel " << fm->GetName(); }
     151    G4cout << G4endl;
     152  }
     153  G4ParticleTable::G4PTblDicIterator* theParticleIterator =
     154    G4ParticleTable::GetParticleTable()->GetIterator();
     155
     156  theParticleIterator->reset();
     157  while( (*theParticleIterator)() ) {
     158    const G4ParticleDefinition* part = theParticleIterator->value();
     159
     160    //G4cout << particleName << " " << part->GetParticleName() << G4endl;
     161
     162    if((part->GetParticleName() == particleName) ||
     163       (particleName == "all") ||
     164       (particleName == "charged" && part->GetPDGCharge() != 0.0)) {
     165
     166      // search for process
     167      G4ProcessManager* pmanager = part->GetProcessManager();
     168      G4ProcessVector* plist = pmanager->GetProcessList();
     169      G4int np = pmanager->GetProcessListLength();
     170 
     171      //G4cout << processName << " in list of " << np << G4endl;
     172
     173      G4VProcess* proc = 0;
     174      for(G4int i=0; i<np; i++) {
     175        if(processName == (*plist)[i]->GetProcessName()) {
     176          proc = (*plist)[i];
     177          break;
     178        }
     179      }
     180      if(!proc) {
     181        G4cout << "### G4EmConfigurator WARNING: fails to find a process <"
     182               << processName << "> for " << particleName << G4endl;
     183        return;
     184
     185      }
     186
     187      if(mod) {
     188        if(!UpdateModelEnergyRange(mod, emin,emax)) { return; }
     189      }
     190      // classify process
     191      G4int ii = proc->GetProcessSubType();
     192      if(10 == ii && mod) {
     193        G4VMultipleScattering* p = static_cast<G4VMultipleScattering*>(proc);
     194        p->AddEmModel(index,mod,reg);
     195        if(1 < verbose) {
     196          G4cout << "### Added msc model order= " << index << " for "
     197                 << particleName << " and " << processName << G4endl;
     198        }
     199        return;
     200      } else if(2 <= ii && 4 >= ii) {
     201        G4VEnergyLossProcess* p = static_cast<G4VEnergyLossProcess*>(proc);
     202        if(!mod && fm) {
     203          p->SetFluctModel(fm);
     204        } else {
     205          p->AddEmModel(index,mod,fm,reg);
     206          if(1 < verbose) {
     207            G4cout << "### Added eloss model order= " << index << " for "
     208                   << particleName << " and " << processName << G4endl;
     209          }
     210        }
     211        return;
     212      } else if(mod) {
     213        G4VEmProcess* p = static_cast<G4VEmProcess*>(proc);
     214        p->AddEmModel(index,mod,reg);
     215        if(1 < verbose) {
     216          G4cout << "### Added em model order= " << index << " for "
     217                 << particleName << " and " << processName << G4endl;
     218        }
     219        return;
     220      } else {
     221        return;
     222      }
     223    }
     224  }
     225}
     226
     227//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     228
     229void
     230G4EmConfigurator::PrepareModels(const G4ParticleDefinition* aParticle,
     231                                G4VEnergyLossProcess* p)
     232{
    129233  size_t n = particles.size();
    130   //G4cout << " G4EmConfigurator::AddModels n= " << n << G4endl;
     234  if(1 < verbose) {
     235    G4cout << " G4EmConfigurator::PrepareModels for EnergyLoss n= "
     236           << n << G4endl;
     237  }
    131238  if(n > 0) {
    132     for(size_t i=0; i<n; i++) {
    133       SetModelForRegion(particles[i],processes[i],models[i],regions[i],
    134                         flucModels[i],lowEnergy[i],highEnergy[i]);
     239    G4String particleName = aParticle->GetParticleName();
     240    G4String processName  = p->GetProcessName();
     241    //G4cout <<  particleName << "  " <<  processName << G4endl;
     242    for(size_t i=0; i<n; ++i) {
     243      //G4cout <<  particles[i] << "  " <<  processes[i] << G4endl;
     244      if(processName == processes[i]) {
     245        if((particleName == particles[i]) ||
     246           (particles[i] == "all") ||
     247           (particles[i] == "charged" && aParticle->GetPDGCharge() != 0.0)) {
     248          G4Region* reg = FindRegion(regions[i]);
     249          //G4cout << "Region " << reg << G4endl;
     250          if(reg) {
     251            --index;
     252            G4VEmModel* mod = models[i];
     253            G4VEmFluctuationModel* fm = flucModels[i];
     254            if(mod) {
     255              if(UpdateModelEnergyRange(mod, lowEnergy[i], highEnergy[i])) {
     256                p->AddEmModel(index,mod,fm,reg);
     257                if(1 < verbose) {
     258                  G4cout << "### Added eloss model order= " << index << " for "
     259                         << particleName << " and " << processName << G4endl;
     260                }
     261              }
     262            } else if(fm) {
     263              p->SetFluctModel(fm);
     264            }
     265          }
     266        }
     267      }
    135268    }
    136269  }
     270}
     271
     272//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     273
     274void
     275G4EmConfigurator::PrepareModels(const G4ParticleDefinition* aParticle,
     276                                G4VEmProcess* p)
     277{
     278  size_t n = particles.size();
     279  if(1 < verbose) {
     280    G4cout << " G4EmConfigurator::PrepareModels for EM process n= "
     281           << n << G4endl;
     282  }
     283  if(n > 0) {
     284    G4String particleName = aParticle->GetParticleName();
     285    G4String processName  = p->GetProcessName();
     286    //G4cout <<  particleName << "  " <<  particleName << G4endl;
     287    for(size_t i=0; i<n; ++i) {
     288      if(processName == processes[i]) {
     289        if((particleName == particles[i]) ||
     290           (particles[i] == "all") ||
     291           (particles[i] == "charged" && aParticle->GetPDGCharge() != 0.0)) {
     292          G4Region* reg = FindRegion(regions[i]);
     293          //G4cout << "Region " << reg << G4endl;
     294          if(reg) {
     295            --index;
     296            G4VEmModel* mod = models[i];
     297            if(mod) {
     298              if(UpdateModelEnergyRange(mod, lowEnergy[i], highEnergy[i])) {
     299                p->AddEmModel(index,mod,reg);
     300                if(1 < verbose) {
     301                  G4cout << "### Added em model order= " << index << " for "
     302                         << particleName << " and " << processName << G4endl;
     303                }
     304              }
     305            }
     306          }
     307        }
     308      }
     309    }
     310  }
     311}
     312
     313//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     314
     315void
     316G4EmConfigurator::PrepareModels(const G4ParticleDefinition* aParticle,
     317                                G4VMultipleScattering* p)
     318{
     319  size_t n = particles.size();
     320  if(1 < verbose) {
     321    G4cout << " G4EmConfigurator::PrepareModels for MSC process n= "
     322           << n << G4endl;
     323  }
     324
     325  if(n > 0) {
     326    G4String particleName = aParticle->GetParticleName();
     327    G4String processName  = p->GetProcessName();
     328    for(size_t i=0; i<n; ++i) {
     329      if(processName == processes[i]) {
     330        if((particleName == particles[i]) ||
     331           (particles[i] == "all") ||
     332           (particles[i] == "charged" && aParticle->GetPDGCharge() != 0.0)) {
     333          G4Region* reg = FindRegion(regions[i]);
     334          if(reg) {
     335            --index;
     336            G4VEmModel* mod = models[i];
     337            if(mod) {
     338              if(UpdateModelEnergyRange(mod, lowEnergy[i], highEnergy[i])) {
     339                p->AddEmModel(index,mod,reg);
     340                G4cout << "### Added msc model order= " << index << " for "
     341                       << particleName << " and " << processName << G4endl;
     342              }
     343            }
     344          }
     345        }
     346      }
     347    }
     348  }
     349}
     350
     351//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     352
     353void G4EmConfigurator::Clear()
     354{
    137355  particles.clear();
    138356  processes.clear();
     
    146364//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    147365
    148 void G4EmConfigurator::SetModelForRegion(const G4String& particleName,
    149                                          const G4String& processName,
    150                                          const G4String& modelName,
    151                                          const G4String& regionName,
    152                                          const G4String& flucModelName,
    153                                          G4double emin, G4double emax)
    154 {
    155   //G4cout << " G4EmConfigurator::SetModelForRegion" << G4endl;
    156 
    157   // new set
    158   --index;
    159 
    160   G4ParticleTable::G4PTblDicIterator* theParticleIterator =
    161     G4ParticleTable::GetParticleTable()->GetIterator();
    162 
    163   theParticleIterator->reset();
    164   while( (*theParticleIterator)() ) {
    165     const G4ParticleDefinition* part = theParticleIterator->value();
    166 
    167     //G4cout << particleName << " " << part->GetParticleName() << G4endl;
    168 
    169     if(particleName == part->GetParticleName() ||
    170        (particleName == "charged" && part->GetPDGCharge() != 0.0) ) {
    171 
    172 
    173       // search for process
    174       G4ProcessManager* pmanager = part->GetProcessManager();
    175       G4ProcessVector* plist = pmanager->GetProcessList();
    176       G4int np = pmanager->GetProcessListLength();
    177  
    178       //G4cout << processName << " in list of " << np << G4endl;
    179 
    180       G4VProcess* proc = 0;
    181       for(G4int i=0; i<np; i++) {
    182         if(processName == (*plist)[i]->GetProcessName()) {
    183           proc = (*plist)[i];
    184           break;
    185         }
    186       }
    187       if(!proc) {
    188         G4cout << "### G4EmConfigurator WARNING: fails to find a process <"
    189                << processName << "> for " << particleName << G4endl;
    190        
    191       } else {
    192 
    193         // classify process
    194         PType ptype = discrete;
    195         G4int ii = proc->GetProcessSubType();
    196         if(10 == ii) ptype = msc;
    197         else if(2 <= ii && 4 >= ii) ptype = eloss;
    198 
    199         // find out model     
    200         G4VEmModel* mod = 0;
    201         G4VEmFluctuationModel* fluc = 0;
    202 
    203         G4int nm = modelList.size();
    204         //G4cout << "Search model " << modelName << " in " << nm << G4endl;
    205 
    206         for(G4int i=0; i<nm; i++) {
    207           G4String mname = "";
    208           if(modelList[i]) mname = modelList[i]->GetName();
    209           G4String fname = "";
    210           if(flucModelList[i]) fname = flucModelList[i]->GetName();
    211           if(modelName == mname && flucModelName == fname &&
    212              (particleList[i] == "" || particleList[i] == particleName) ) {
    213             mod  = modelList[i];
    214             fluc = flucModelList[i];
    215             break;
    216           }
    217         }
    218 
    219         if("dummy" == modelName) mod = new G4DummyModel();
    220 
    221         if(!mod) {
    222 
    223           // set fluctuation model for ionisation processes
    224           if(fluc && ptype == eloss) {
    225             G4VEnergyLossProcess* p = static_cast<G4VEnergyLossProcess*>(proc);
    226             p->SetFluctModel(fluc);
    227          
    228           } else {
    229             G4cout << "### G4EmConfigurator WARNING: fails to find a model <"
    230                    << modelName << "> for process <"
    231                    << processName << "> and " << particleName
    232                    << G4endl;
    233             if(flucModelName != "") {
    234               G4cout << "                            fluctuation model <"
    235                      << flucModelName << G4endl;
    236             }
    237           }
    238         } else {
    239 
    240           // search for region
    241           G4Region* reg = 0;
    242           G4RegionStore* regStore = G4RegionStore::GetInstance();
    243           G4String r = regionName;
    244           if(r == "" || r == "world" || r == "World") r = "DefaultRegionForTheWorld";
    245           reg = regStore->GetRegion(r, true);
    246           if(!reg) {
    247             G4cout << "### G4EmConfigurator WARNING: fails to find a region <"
    248                    << r << "> for model <" << modelName << "> of the process "
    249                    << processName << " and " << particleName << G4endl;
    250             return;
    251           }
    252 
    253           // energy limits
    254           G4double e1 = std::max(emin,mod->LowEnergyLimit());
    255           G4double e2 = std::min(emax,mod->HighEnergyLimit());
    256           if(e2 < e1) e2 = e1;
    257           mod->SetLowEnergyLimit(e1);
    258           mod->SetHighEnergyLimit(e2);
    259 
    260           //G4cout << "index= " << index << " e1= " << e1 << " e2= " << e2 << G4endl;
    261 
    262           // added model
    263           if(ptype == eloss) {
    264             G4VEnergyLossProcess* p = static_cast<G4VEnergyLossProcess*>(proc);
    265             p->AddEmModel(index,mod,fluc,reg);
    266             //G4cout << "### Added eloss model order= " << index << " for "
    267             //     << particleName << " and " << processName << "  " << mod << G4endl;
    268           } else if(ptype == discrete) {
    269             G4VEmProcess* p = static_cast<G4VEmProcess*>(proc);
    270             p->AddEmModel(index,mod,reg);
    271           } else if(ptype == msc) {
    272             //G4cout << "### Added msc model order= " << index << " for "
    273             //     << particleName << " and " << processName << "  " << mod << G4endl;
    274             G4VMultipleScattering* p = static_cast<G4VMultipleScattering*>(proc);
    275             p->AddEmModel(index,mod,reg);
    276           }
    277         }
    278       }
    279     }
    280   }
    281 }
    282 
    283 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    284 
    285 
    286 
    287 
    288 
    289 
    290 
    291 
     366G4Region* G4EmConfigurator::FindRegion(const G4String& regionName)
     367{
     368  // search for region
     369  G4Region* reg = 0;
     370  G4RegionStore* regStore = G4RegionStore::GetInstance();
     371  G4String r = regionName;
     372  if(r == "" || r == "world" || r == "World") {
     373    r = "DefaultRegionForTheWorld";
     374  }
     375  reg = regStore->GetRegion(r, true);
     376  if(!reg) {
     377    G4cout << "### G4EmConfigurator WARNING: fails to find a region <"
     378           << r << G4endl;
     379  } else if(verbose > 1) {
     380    G4cout << "### G4EmConfigurator finds out G4Region <" << r << ">"
     381           << G4endl;
     382  }
     383  return reg; 
     384}
     385
     386//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     387
     388G4bool G4EmConfigurator::UpdateModelEnergyRange(G4VEmModel* mod,
     389                                                G4double emin, G4double emax)
     390{
     391  // energy limits
     392  G4double e1 = std::max(emin,mod->LowEnergyLimit());
     393  G4double e2 = std::min(emax,mod->HighEnergyLimit());
     394  if(e2 <= e1) {
     395    G4cout << "### G4EmConfigurator WARNING: empty energy interval"
     396           << " for <" << mod->GetName()
     397           << ">  Emin(MeV)= " << e1/CLHEP::MeV
     398           << ">  Emax(MeV)= " << e2/CLHEP::MeV
     399           << G4endl;
     400    return false;       
     401  }
     402  mod->SetLowEnergyLimit(e1);
     403  mod->SetHighEnergyLimit(e2);
     404  if(verbose > 1) {
     405    G4cout << "### G4EmConfigurator for " << mod->GetName()
     406           << " Emin(MeV)= " << e1/MeV << " Emax(MeV)= " << e2/MeV
     407           << G4endl;
     408  }
     409  return true;
     410}
     411
     412//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
  • trunk/source/processes/electromagnetic/utils/src/G4EmCorrections.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4EmCorrections.cc,v 1.54 2009/10/29 17:56:36 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4EmCorrections.cc,v 1.58 2010/06/04 09:28:46 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    6868#include "G4ProductionCutsTable.hh"
    6969#include "G4MaterialCutsCouple.hh"
     70#include "G4AtomicShells.hh"
    7071
    7172//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    123124  G4double sum = (2.0*(Barkas + Bloch) + Mott);
    124125
    125   if(verbose > 1)
     126  if(verbose > 1) {
    126127    G4cout << "EmCorrections: E(MeV)= " << e/MeV << " Barkas= " << Barkas
    127128           << " Bloch= " << Bloch << " Mott= " << Mott
    128            << " Sum= " << sum << G4endl;
    129 
     129           << " Sum= " << sum << " q2= " << q2 << G4endl;
     130  }
    130131  sum *= material->GetElectronDensity() * q2 *  twopi_mc2_rcl2 /beta2;
    131132  return sum;
     
    165166//   Other corrections from S.P.Ahlen Rev. Mod. Phys., Vol 52, No1, 1980
    166167  SetupKinematics(p, mat, e);
    167   if(tau <= 0.0) return 0.0;
     168  if(tau <= 0.0) { return 0.0; }
    168169
    169170  G4double Barkas = BarkasCorrection (p, mat, e);
     
    180181  sum *= material->GetElectronDensity() * q2 *  twopi_mc2_rcl2 /beta2;
    181182
    182   if(verbose > 1) G4cout << " Sum= " << sum << G4endl;
     183  if(verbose > 1) { G4cout << " Sum= " << sum << G4endl; }
    183184  return sum;
    184185}
     
    219220    sum = ComputeIonCorrections(p,couple->GetMaterial(),e) - rest/e;
    220221
    221     if(verbose > 1) G4cout << " Sum= " << sum << " dSum= " << rest/e << G4endl;
     222    if(verbose > 1) { G4cout << " Sum= " << sum << " dSum= " << rest/e << G4endl; }
    222223  }
    223224  return sum;
     
    267268    }
    268269    G4double e0= 13.6*eV*Z2;
    269     term += f*atomDensity[i]*KShell(shells.GetBindingEnergy(iz,0)/e0,ba2/Z2)/Z;
     270    term += f*atomDensity[i]*KShell(G4AtomicShells::GetBindingEnergy(iz,0)/e0,ba2/Z2)/Z;
    270271  }
    271272
     
    293294      G4double e0= 13.6*eV*Z2*0.25;
    294295      G4double f = 0.125;
    295       G4int nmax = std::min(4,shells.GetNumberOfShells(iz));
     296      G4int nmax = std::min(4,G4AtomicShells::GetNumberOfShells(iz));
    296297      for(G4int j=1; j<nmax; j++) {
    297         G4double ne = G4double(shells.GetNumberOfElectrons(iz,j));
    298         G4double e1 = shells.GetBindingEnergy(iz,j);
     298        G4double ne = G4double(G4AtomicShells::GetNumberOfElectrons(iz,j));
     299        G4double e1 = G4AtomicShells::GetBindingEnergy(iz,j);
    299300        //   G4cout << "LShell: j= " << j << " ne= " << ne << " e(eV)= " << e/eV
    300301        //  << " e0(eV)= " << e0/eV << G4endl;
     
    417418  for (G4int i = 0; i<numberOfElements; i++) {
    418419
     420    G4double res = 0.0;
    419421    G4double Z = (*theElementVector)[i]->GetZ();
    420422    G4int   iz = G4int(Z);
     
    426428    }
    427429    G4double e0= 13.6*eV*Z2;
    428     term += f*atomDensity[i]*KShell(shells.GetBindingEnergy(iz,0)/e0,ba2/Z2)/Z;
     430    res += f*KShell(G4AtomicShells::GetBindingEnergy(iz,0)/e0,ba2/Z2);
    429431    if(2 < iz) {
    430432      G4double Zeff = Z - ZD[10];
     
    434436      f = 0.125;
    435437      G4double eta = ba2/Z2;
    436       G4int ntot = shells.GetNumberOfShells(iz);
     438      G4int ntot = G4AtomicShells::GetNumberOfShells(iz);
    437439      G4int nmax = std::min(4, ntot);
    438440      G4double norm   = 0.0;
    439441      G4double eshell = 0.0;
    440       for(G4int j=1; j<nmax; j++) {
    441         G4double x = G4double(shells.GetNumberOfElectrons(iz,j));
    442         G4double e1 = shells.GetBindingEnergy(iz,j);
    443         norm   += x;
    444         eshell += e1*x;
    445         term += f*x*atomDensity[i]*LShell(e1/e0,eta)/Z;
     442      for(G4int j=1; j<nmax; ++j) {
     443        G4double e1 = G4AtomicShells::GetBindingEnergy(iz,j);
     444        G4int ne = G4AtomicShells::GetNumberOfElectrons(iz,j);
     445        norm   += ne;
     446        eshell += e1*ne;
     447        res += f*ne*LShell(e1/e0,eta);
    446448      }
    447       if(10 < iz) {
     449      if(ntot > nmax) {
    448450        eshell /= norm;
    449451        G4double eeff = eshell*eta;
    450         for(G4int k=nmax; k<ntot; k++) {
    451           G4double x = G4double(shells.GetNumberOfElectrons(iz,k));
    452           G4double e1 = shells.GetBindingEnergy(iz,k);
    453           term += f*x*atomDensity[i]*LShell(e1/e0,eeff/e1)/Z;
    454           //          term += f*x*atomDensity[i]*LShell(eshell/e0,eeff/e1)/Z;
     452        for(G4int k=nmax; k<ntot; ++k) {
     453          G4int ne = G4AtomicShells::GetNumberOfElectrons(iz,k);
     454          G4double e1 = G4AtomicShells::GetBindingEnergy(iz,k);
     455          res += f*ne*LShell(e1/e0,eeff/e1);
     456          //res += f*ne*LShell(e1/eshell,eeff/e1);
    455457        }
     458      }
    456459        /*
    457460        if(28 >= iz) {
    458           term += f*(Z - 10.)*atomDensity[i]*LShell(eshell,HM[iz-11]*eta)/Z;
     461          res += f*(Z - 10.)*LShell(eshell,HM[iz-11]*eta);
    459462        } else if(32 >= iz) {
    460           term += f*18.0*atomDensity[i]*LShell(eshell,HM[iz-11]*eta)/Z;
     463          res += f*18.0*LShell(eshell,HM[iz-11]*eta);
    461464        } else if(60 >= iz) {
    462           term += f*18.0*atomDensity[i]*LShell(eshell,HM[iz-11]*eta)/Z;
    463           term += f*(Z - 28.)*atomDensity[i]*LShell(eshell,HN[iz-33]*eta)/Z;
     465          res += f*18.0*LShell(eshell,HM[iz-11]*eta);
     466          res += f*(Z - 28.)*LShell(eshell,HN[iz-33]*eta);
    464467        } else {
    465           term += f*18.0*atomDensity[i]*LShell(eshell,HM[53]*eta)/Z;
    466           term += f*32.0*atomDensity[i]*LShell(eshell,HN[30]*eta)/Z;
    467           term += f*(Z - 60.)*atomDensity[i]*LShell(eshell,150.*eta)/Z;
     468          res += f*18.0*LShell(eshell,HM[50]*eta);
     469          res += f*32.0*LShell(eshell,HN[30]*eta);
     470          res += f*(Z - 60.)*LShell(eshell,150.*eta);
    468471        }
    469472        */
    470       }
    471     }
    472     //term += atomDensity[i]*MSH[iz]/(ba2*ba2);
     473    }
     474    //term += atomDensity[i]*(res/Z + MSH[iz]/(ba2*ba2));
     475    term += res*atomDensity[i]/Z;
    473476  }
    474477
    475478  term /= material->GetTotNbOfAtomsPerVolume();
     479  //if(charge < 0.0) { term = -term; }
    476480  return term;
    477481}
     
    552556
    553557  BarkasTerm *= 1.29*charge/material->GetTotNbOfAtomsPerVolume();
     558
     559  // temporary protection
     560  if(charge < -7.0 ) { BarkasTerm *= (-7.0/charge); }
     561
    554562  return BarkasTerm;
    555563}
     
    574582  } while (del > 0.01*term);
    575583
    576   return -y2*term;
     584  G4double res = -y2*term;
     585  // temporary protection
     586  if(q2 > 49. && res < -0.2) { res = -0.2; }
     587
     588  return res;
    577589}
    578590
     
    808820  ionList[idx]  = ion;
    809821  stopData[idx] = vv;
    810   if(verbose>1) G4cout << "End data set " << G4endl;
     822  if(verbose>1) { G4cout << "End data set " << G4endl; }
    811823}
    812824
     
    13951407    18.2
    13961408  };
    1397   for(i=0; i<53; i++) {HM[i] = hm[i];}
    1398   for(i=0; i<31; i++) {HN[i] = hn[i];}
     1409  for(i=0; i<53; ++i) {HM[i] = hm[i];}
     1410  for(i=0; i<31; ++i) {HN[i] = hn[i];}
    13991411
    14001412  const G4double mm[93] = {
  • trunk/source/processes/electromagnetic/utils/src/G4EmElementSelector.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4EmElementSelector.cc,v 1.11 2009/09/29 11:31:37 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4EmElementSelector.cc,v 1.12 2010/04/27 16:59:52 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    5858                                         G4double emin,
    5959                                         G4double emax,
    60                                          G4bool /*spline*/):
     60                                         G4bool spline):
    6161  model(mod), material(mat), nbins(bins), cutEnergy(-1.0),
    6262  lowEnergy(emin), highEnergy(emax)
     
    6868  if(nElmMinusOne > 0) {
    6969    xSections.reserve(n);
    70     for(G4int i=0; i<n; ++i) {
    71       G4PhysicsLogVector* v = new G4PhysicsLogVector(lowEnergy,highEnergy,nbins);
    72       //v->SetSpline(spline);
     70    G4PhysicsLogVector* v0 = new G4PhysicsLogVector(lowEnergy,highEnergy,nbins);
     71    xSections.push_back(v0);
     72    v0->SetSpline(spline);
     73    for(G4int i=1; i<n; ++i) {
     74      G4PhysicsLogVector* v = new G4PhysicsLogVector(*v0);
     75      v->SetSpline(spline);
    7376      xSections.push_back(v);
    7477    }
     
    102105  const G4double* theAtomNumDensityVector = material->GetVecNbOfAtomsPerVolume();
    103106
    104   G4int i;
    105 
    106107  // loop over bins
    107108  for(G4int j=0; j<=nbins; ++j) {
     
    110111    cross = 0.0;
    111112    //G4cout << "j= " << j << " e(MeV)= " << e/MeV << G4endl;
    112     for (i=0; i<=nElmMinusOne; ++i) {
     113    for (G4int i=0; i<=nElmMinusOne; ++i) {
    113114      cross += theAtomNumDensityVector[i]*     
    114115        model->ComputeCrossSectionPerAtom(part, (*theElementVector)[i], e,
     
    119120
    120121  // xSections start from null, so use probabilities from the next bin
    121   if(DBL_MIN >= (*xSections[nElmMinusOne])[0]) {
    122     for (i=0; i<=nElmMinusOne; ++i) {
     122  if(0.0 == (*xSections[nElmMinusOne])[0]) {
     123    for (G4int i=0; i<=nElmMinusOne; ++i) {
    123124      xSections[i]->PutValue(0, (*xSections[i])[1]);
    124125    }
    125126  }
    126127  // xSections ends with null, so use probabilities from the previous bin
    127   if(DBL_MIN >= (*xSections[nElmMinusOne])[nbins]) {
    128     for (i=0; i<=nElmMinusOne; ++i) {
     128  if(0.0 == (*xSections[nElmMinusOne])[nbins]) {
     129    for (G4int i=0; i<=nElmMinusOne; ++i) {
    129130      xSections[i]->PutValue(nbins, (*xSections[i])[nbins-1]);
    130131    }
     
    134135    cross = (*xSections[nElmMinusOne])[j];
    135136    // only for positive X-section
    136     if(cross > DBL_MIN) {
    137       for (i=0; i<nElmMinusOne; ++i) {
     137    if(cross > 0.0) {
     138      for (G4int i=0; i<nElmMinusOne; ++i) {
    138139        G4double x = (*xSections[i])[j]/cross;
    139140        xSections[i]->PutValue(j, x);
  • trunk/source/processes/electromagnetic/utils/src/G4EmModelManager.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4EmModelManager.cc,v 1.58 2009/10/29 18:07:08 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4EmModelManager.cc,v 1.60 2010/04/12 18:28:40 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    420420  size_t idx = 1;
    421421  if(secondaryParticle) {
    422     if( secondaryParticle == G4Gamma::Gamma() )           idx = 0;
    423     else if( secondaryParticle == G4Positron::Positron()) idx = 2;
    424   }
    425 
    426   if(numOfCouples > theCuts.size()) {theCuts.resize(numOfCouples);}
     422    if( secondaryParticle == G4Gamma::Gamma() )           { idx = 0; }
     423    else if( secondaryParticle == G4Positron::Positron()) { idx = 2; }
     424  }
     425
     426  if(numOfCouples > theCuts.size()) { theCuts.resize(numOfCouples); }
    427427  if(minSubRange < 1.0 && numOfCouples > theSubCuts.size()) {
    428428    theSubCuts.resize(numOfCouples);
     
    460460        G4double tcutmax =
    461461          theCoupleTable->ConvertRangeToEnergy(secondaryParticle,material,rcut);
    462         if(tcutmax < subcut) subcut = tcutmax;
    463       }
    464     }
    465 
     462        if(tcutmax < subcut) { subcut = tcutmax; }
     463      }
     464    }
     465    /*
    466466    G4int nm = setOfRegionModels[reg]->NumberOfModels();
    467467    for(G4int j=0; j<nm; ++j) {
    468468
    469469      G4VEmModel* model = models[setOfRegionModels[reg]->ModelIndex(j)];
    470 
    471470      G4double tcutmin = model->MinEnergyCut(particle, couple);
    472471
    473       if(cut < tcutmin) cut = tcutmin;
    474       if(subcut < tcutmin) subcut = tcutmin;
     472      if(cut < tcutmin)    { cut = tcutmin; }
     473      if(subcut < tcutmin) { subcut = tcutmin; }
    475474      if(1 < verboseLevel) {
    476475            G4cout << "The model # " << j
     
    482481      }
    483482    }
     483    */
    484484    theCuts[i] = cut;
    485     if(minSubRange < 1.0) theSubCuts[i] = subcut;
     485    if(minSubRange < 1.0) { theSubCuts[i] = subcut; }
    486486  }
    487487
     
    497497    }
    498498  }
    499   if(1 == nn) severalModels = false;
     499  if(1 == nn) { severalModels = false; }
    500500
    501501  if(1 < verboseLevel) {
  • trunk/source/processes/electromagnetic/utils/src/G4EmProcessOptions.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4EmProcessOptions.cc,v 1.27 2009/10/29 19:25:28 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4EmProcessOptions.cc,v 1.28 2010/04/27 16:59:52 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    7979{
    8080  theManager->SetLossFluctuations(val);
     81}
     82
     83//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     84
     85void G4EmProcessOptions::SetSubCutoff(G4bool val, const G4Region* r)
     86{
     87  theManager->SetSubCutoff(val, r);
     88}
     89
     90//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     91
     92void G4EmProcessOptions::SetIntegral(G4bool val)
     93{
     94  theManager->SetIntegral(val);
     95}
     96
     97//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     98
     99void G4EmProcessOptions::SetMinSubRange(G4double val)
     100{
     101  theManager->SetMinSubRange(val);
     102}
     103
     104//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     105
     106void G4EmProcessOptions::SetMinEnergy(G4double val)
     107{
     108  theManager->SetMinEnergy(val);
     109}
     110
     111//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     112
     113void G4EmProcessOptions::SetMaxEnergy(G4double val)
     114{
     115  theManager->SetMaxEnergy(val);
     116}
     117
     118//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     119
     120void G4EmProcessOptions::SetMaxEnergyForCSDARange(G4double val)
     121{
     122  theManager->SetMaxEnergyForCSDARange(val);
     123}
     124
     125//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     126
     127void G4EmProcessOptions::SetMaxEnergyForMuons(G4double val)
     128{
     129  theManager->SetMaxEnergyForMuons(val);
     130}
     131
     132//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     133
     134void G4EmProcessOptions::SetDEDXBinning(G4int val)
     135{
     136  theManager->SetDEDXBinning(val);
     137}
     138
     139//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     140
     141void G4EmProcessOptions::SetDEDXBinningForCSDARange(G4int val)
     142{
     143  theManager->SetDEDXBinningForCSDARange(val);
     144}
     145
     146//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     147
     148void G4EmProcessOptions::SetLambdaBinning(G4int val)
     149{
     150  theManager->SetLambdaBinning(val);
     151}
     152
     153//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     154
     155void G4EmProcessOptions::SetStepFunction(G4double v1, G4double v2)
     156{
     157  theManager->SetStepFunction(v1, v2);
     158}
     159
     160//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     161
     162void G4EmProcessOptions::SetRandomStep(G4bool val)
     163{
     164  theManager->SetRandomStep(val);
     165}
     166
     167//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     168
     169void G4EmProcessOptions::SetApplyCuts(G4bool val)
     170{
     171  const std::vector<G4VEmProcess*>& w =
     172        theManager->GetEmProcessVector();
     173  std::vector<G4VEmProcess*>::const_iterator itp;
     174  for(itp = w.begin(); itp != w.end(); itp++) {
     175    G4VEmProcess* q = *itp;
     176    if(q) { q->SetApplyCuts(val); }
     177  }
     178}
     179
     180//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     181
     182void G4EmProcessOptions::SetBuildCSDARange(G4bool val)
     183{
     184  theManager->SetBuildCSDARange(val);
     185}
     186
     187//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     188
     189void G4EmProcessOptions::SetVerbose(G4int val, const G4String& name)
     190{
     191  G4bool all = false;
     192  if("all" == name) { all = true; }
     193  const std::vector<G4VEnergyLossProcess*>& v =
     194        theManager->GetEnergyLossProcessVector();
     195
     196  if(all) {
     197    theManager->SetVerbose(val);
     198    return;
     199  }
     200
     201  std::vector<G4VEnergyLossProcess*>::const_iterator itr;
     202  for(itr = v.begin(); itr != v.end(); ++itr) {
     203    G4VEnergyLossProcess* p = *itr;
     204    if(p) {
     205      if (p->GetProcessName() == name) { p->SetVerboseLevel(val); }
     206    }
     207  }
     208  const std::vector<G4VEmProcess*>& w =
     209        theManager->GetEmProcessVector();
     210  std::vector<G4VEmProcess*>::const_iterator itp;
     211  for(itp = w.begin(); itp != w.end(); itp++) {
     212    G4VEmProcess* q = *itp;
     213    if(q) {
     214      if (q->GetProcessName() == name) { q->SetVerboseLevel(val); }
     215    }
     216  }
     217  const std::vector<G4VMultipleScattering*>& u =
     218        theManager->GetMultipleScatteringVector();
     219  std::vector<G4VMultipleScattering*>::const_iterator itm;
     220  for(itm = u.begin(); itm != u.end(); itm++) {
     221    G4VMultipleScattering* s = *itm;
     222    if(s) {
     223      if (s->GetProcessName() == name) { s->SetVerboseLevel(val); }
     224    }
     225  }
     226}
     227
     228//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     229
     230void G4EmProcessOptions::SetLambdaFactor(G4double val)
     231{
    81232  const std::vector<G4VEnergyLossProcess*>& v =
    82233        theManager->GetEnergyLossProcessVector();
     
    84235  for(itr = v.begin(); itr != v.end(); itr++) {
    85236    G4VEnergyLossProcess* p = *itr;
    86     if(p) p->SetLossFluctuations(val);
    87   }
    88 }
    89 
    90 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    91 
    92 void G4EmProcessOptions::SetSubCutoff(G4bool val, const G4Region* r)
    93 {
    94   theManager->SetSubCutoff(val);
    95   const std::vector<G4VEnergyLossProcess*>& v =
    96         theManager->GetEnergyLossProcessVector();
    97   std::vector<G4VEnergyLossProcess*>::const_iterator itr;
    98   for(itr = v.begin(); itr != v.end(); itr++) {
    99     G4VEnergyLossProcess* p = *itr;
    100     if(p) p->ActivateSubCutoff(val, r);
    101   }
    102 }
    103 
    104 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    105 
    106 void G4EmProcessOptions::SetIntegral(G4bool val)
    107 {
    108   theManager->SetIntegral(val);
    109   const std::vector<G4VEnergyLossProcess*>& v =
    110         theManager->GetEnergyLossProcessVector();
    111   std::vector<G4VEnergyLossProcess*>::const_iterator itr;
    112   for(itr = v.begin(); itr != v.end(); itr++) {
    113     G4VEnergyLossProcess* p = *itr;
    114     if(p) p->SetIntegral(val);
    115   }
    116 }
    117 
    118 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    119 
    120 void G4EmProcessOptions::SetMinSubRange(G4double val)
    121 {
    122   theManager->SetMinSubRange(val);
    123   const std::vector<G4VEnergyLossProcess*>& v =
    124         theManager->GetEnergyLossProcessVector();
    125   std::vector<G4VEnergyLossProcess*>::const_iterator itr;
    126   for(itr = v.begin(); itr != v.end(); itr++) {
    127     G4VEnergyLossProcess* p = *itr;
    128     if(p) p->SetMinSubRange(val);
    129   }
    130 }
    131 
    132 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    133 
    134 void G4EmProcessOptions::SetMinEnergy(G4double val)
    135 {
    136   theManager->SetMinEnergy(val);
    137   const std::vector<G4VEnergyLossProcess*>& v =
    138         theManager->GetEnergyLossProcessVector();
    139   std::vector<G4VEnergyLossProcess*>::const_iterator itr;
    140   for(itr = v.begin(); itr != v.end(); itr++) {
    141     G4VEnergyLossProcess* p = *itr;
    142     if(p) p->SetMinKinEnergy(val);
    143   }
    144   const std::vector<G4VEmProcess*>& w =
    145         theManager->GetEmProcessVector();
    146   std::vector<G4VEmProcess*>::const_iterator itp;
    147   for(itp = w.begin(); itp != w.end(); itp++) {
    148     G4VEmProcess* q = *itp;
    149     if(q) q->SetMinKinEnergy(val);
    150   }
    151   const std::vector<G4VMultipleScattering*>& u =
    152         theManager->GetMultipleScatteringVector();
    153   std::vector<G4VMultipleScattering*>::const_iterator itm;
    154   for(itm = u.begin(); itm != u.end(); itm++) {
    155     G4VMultipleScattering* s = *itm;
    156     if(s) s->SetMinKinEnergy(val);
    157   }
    158 }
    159 
    160 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    161 
    162 void G4EmProcessOptions::SetMaxEnergy(G4double val)
    163 {
    164   theManager->SetMaxEnergy(val);
    165   const std::vector<G4VEnergyLossProcess*>& v =
    166         theManager->GetEnergyLossProcessVector();
    167   std::vector<G4VEnergyLossProcess*>::const_iterator itr;
    168   for(itr = v.begin(); itr != v.end(); itr++) {
    169     G4VEnergyLossProcess* p = *itr;
    170     if(p) p->SetMaxKinEnergy(val);
    171   }
    172   const std::vector<G4VEmProcess*>& w =
    173         theManager->GetEmProcessVector();
    174   std::vector<G4VEmProcess*>::const_iterator itp;
    175   for(itp = w.begin(); itp != w.end(); itp++) {
    176     G4VEmProcess* q = *itp;
    177     if(q) q->SetMaxKinEnergy(val);
    178   }
    179   const std::vector<G4VMultipleScattering*>& u =
    180         theManager->GetMultipleScatteringVector();
    181   std::vector<G4VMultipleScattering*>::const_iterator itm;
    182   for(itm = u.begin(); itm != u.end(); itm++) {
    183     G4VMultipleScattering* s = *itm;
    184     if(s) s->SetMaxKinEnergy(val);
    185   }
    186 }
    187 
    188 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    189 
    190 void G4EmProcessOptions::SetMaxEnergyForCSDARange(G4double val)
    191 {
    192   theManager->SetMaxEnergyForCSDARange(val);
    193   const std::vector<G4VEnergyLossProcess*>& v =
    194         theManager->GetEnergyLossProcessVector();
    195   std::vector<G4VEnergyLossProcess*>::const_iterator itr;
    196   for(itr = v.begin(); itr != v.end(); itr++) {
    197     G4VEnergyLossProcess* p = *itr;
    198     if(p) p->SetMaxKinEnergyForCSDARange(val);
    199   }
    200 }
    201 
    202 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    203 
    204 void G4EmProcessOptions::SetMaxEnergyForMuons(G4double val)
    205 {
    206   theManager->SetMaxEnergyForMuons(val);
     237    if(p) { p->SetLambdaFactor(val); }
     238  }
     239}
     240
     241//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     242
     243void G4EmProcessOptions::ActivateDeexcitation(const G4String& pname,
     244                                              G4bool val,
     245                                              const G4String& reg)
     246{
     247  G4RegionStore* regionStore = G4RegionStore::GetInstance();
     248  const G4Region* r = 0;
     249  if(reg == "" || reg == "World") {
     250    r = regionStore->GetRegion("DefaultRegionForTheWorld", false);
     251  } else {
     252    r = regionStore->GetRegion(reg, false);
     253  }
     254  if(!r) {
     255    G4cout << "G4EmProcessOptions::ActivateDeexcitation ERROR: G4Region <"
     256           << reg << "> not found, the command ignored" << G4endl;
     257    return;
     258  }
     259
    207260  const std::vector<G4VEnergyLossProcess*>& v =
    208261        theManager->GetEnergyLossProcessVector();
     
    211264    G4VEnergyLossProcess* p = *itr;
    212265    if(p) {
    213       if(std::abs(p->Particle()->GetPDGMass() - 105.66*MeV) < MeV)
    214         p->SetMaxKinEnergy(val);
     266      if(pname == p->GetProcessName()) { p->ActivateDeexcitation(val,r); }
    215267    }
    216268  }
     
    221273    G4VEmProcess* q = *itp;
    222274    if(q) {
    223       if(std::abs(q->Particle()->GetPDGMass() - 105.66*MeV) < MeV)
    224         q->SetMaxKinEnergy(val);
    225     }
    226   }
    227   /*
    228   const std::vector<G4VMultipleScattering*>& u =
    229         theManager->GetMultipleScatteringVector();
    230   std::vector<G4VMultipleScattering*>::const_iterator itm;
    231   for(itm = u.begin(); itm != u.end(); itm++) {
    232     G4VMultipleScattering* s = *itm;
    233     if(s) {
    234       if(std::abs(s->Particle()->GetPDGMass() - 105.66*MeV) < MeV)
    235         s->SetMaxKinEnergy(val);
    236     }
    237   }
    238   */
    239 }
    240 
    241 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    242 
    243 void G4EmProcessOptions::SetDEDXBinning(G4int val)
    244 {
    245   theManager->SetDEDXBinning(val);
    246   const std::vector<G4VEnergyLossProcess*>& v =
    247         theManager->GetEnergyLossProcessVector();
    248   std::vector<G4VEnergyLossProcess*>::const_iterator itr;
    249   for(itr = v.begin(); itr != v.end(); itr++) {
    250     G4VEnergyLossProcess* p = *itr;
    251     if(p) p->SetDEDXBinning(val);
    252   }
    253 }
    254 
    255 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    256 
    257 void G4EmProcessOptions::SetDEDXBinningForCSDARange(G4int val)
    258 {
    259   theManager->SetDEDXBinningForCSDARange(val);
    260   const std::vector<G4VEnergyLossProcess*>& v =
    261         theManager->GetEnergyLossProcessVector();
    262   std::vector<G4VEnergyLossProcess*>::const_iterator itr;
    263   for(itr = v.begin(); itr != v.end(); itr++) {
    264     G4VEnergyLossProcess* p = *itr;
    265     if(p) p->SetDEDXBinningForCSDARange(val);
    266   }
    267 }
    268 
    269 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    270 
    271 void G4EmProcessOptions::SetLambdaBinning(G4int val)
    272 {
    273   theManager->SetLambdaBinning(val);
     275      if(pname == q->GetProcessName()) { q->ActivateDeexcitation(val,r); }
     276    }
     277  }
     278}
     279
     280//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     281
     282void G4EmProcessOptions::SetMscStepLimitation(G4MscStepLimitType val)
     283{
     284  const std::vector<G4VMultipleScattering*>& u =
     285        theManager->GetMultipleScatteringVector();
     286  std::vector<G4VMultipleScattering*>::const_iterator itm;
     287  for(itm = u.begin(); itm != u.end(); itm++) {
     288    if(*itm) (*itm)->SetStepLimitType(val);
     289  }
     290}
     291
     292//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     293
     294void G4EmProcessOptions::SetMscLateralDisplacement(G4bool val)
     295{
     296  const std::vector<G4VMultipleScattering*>& u =
     297        theManager->GetMultipleScatteringVector();
     298  std::vector<G4VMultipleScattering*>::const_iterator itm;
     299  for(itm = u.begin(); itm != u.end(); itm++) {
     300    if(*itm) { (*itm)->SetLateralDisplasmentFlag(val); }
     301  }
     302}
     303
     304//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     305
     306void G4EmProcessOptions::SetSkin(G4double val)
     307{
     308  if(val < 0.0) return;
     309  const std::vector<G4VMultipleScattering*>& u =
     310        theManager->GetMultipleScatteringVector();
     311  std::vector<G4VMultipleScattering*>::const_iterator itm;
     312  for(itm = u.begin(); itm != u.end(); itm++) {
     313    if(*itm) { (*itm)->SetSkin(val); }
     314  }
     315}
     316
     317//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     318
     319void G4EmProcessOptions::SetMscRangeFactor(G4double val)
     320{
     321  if(val < 0.0) return;
     322  const std::vector<G4VMultipleScattering*>& u =
     323        theManager->GetMultipleScatteringVector();
     324  std::vector<G4VMultipleScattering*>::const_iterator itm;
     325  for(itm = u.begin(); itm != u.end(); itm++) {
     326    if(*itm) { (*itm)->SetRangeFactor(val); }
     327  }
     328}
     329
     330//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     331
     332void G4EmProcessOptions::SetMscGeomFactor(G4double val)
     333{
     334  if(val < 0.0) { return; }
     335  const std::vector<G4VMultipleScattering*>& u =
     336        theManager->GetMultipleScatteringVector();
     337  std::vector<G4VMultipleScattering*>::const_iterator itm;
     338  for(itm = u.begin(); itm != u.end(); itm++) {
     339    if(*itm) { (*itm)->SetGeomFactor(val); }
     340  }
     341}
     342
     343//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     344
     345void G4EmProcessOptions::SetPolarAngleLimit(G4double val)
     346{
     347  const std::vector<G4VMultipleScattering*>& u =
     348        theManager->GetMultipleScatteringVector();
     349  std::vector<G4VMultipleScattering*>::const_iterator itm;
     350  for(itm = u.begin(); itm != u.end(); itm++) {
     351    if(*itm) { (*itm)->SetPolarAngleLimit(val); }
     352  }
    274353  const std::vector<G4VEmProcess*>& w =
    275354        theManager->GetEmProcessVector();
     
    277356  for(itp = w.begin(); itp != w.end(); itp++) {
    278357    G4VEmProcess* q = *itp;
    279     if(q) q->SetLambdaBinning(val);
    280   }
    281   const std::vector<G4VMultipleScattering*>& u =
    282         theManager->GetMultipleScatteringVector();
    283   std::vector<G4VMultipleScattering*>::const_iterator itm;
    284   for(itm = u.begin(); itm != u.end(); itm++) {
    285     G4VMultipleScattering* s = *itm;
    286     if(s) s->SetBinning(val);
    287   }
    288 }
    289 
    290 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    291 
    292 void G4EmProcessOptions::SetStepFunction(G4double v1, G4double v2)
    293 {
    294   theManager->SetStepFunction(v1, v2);
    295   const std::vector<G4VEnergyLossProcess*>& v =
    296         theManager->GetEnergyLossProcessVector();
    297   std::vector<G4VEnergyLossProcess*>::const_iterator itr;
    298   for(itr = v.begin(); itr != v.end(); itr++) {
    299     G4VEnergyLossProcess* p = *itr;
    300     if(p) p->SetStepFunction(v1, v2);
    301   }
    302 }
    303 
    304 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    305 
    306 void G4EmProcessOptions::SetRandomStep(G4bool val)
    307 {
    308   theManager->SetRandomStep(val);
    309   const std::vector<G4VEnergyLossProcess*>& v =
    310         theManager->GetEnergyLossProcessVector();
    311   std::vector<G4VEnergyLossProcess*>::const_iterator itr;
    312   for(itr = v.begin(); itr != v.end(); itr++) {
    313     G4VEnergyLossProcess* p = *itr;
    314     if(p) p->SetRandomStep(val);
    315   }
    316 }
    317 
    318 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    319 
    320 void G4EmProcessOptions::SetApplyCuts(G4bool val)
    321 {
    322   const std::vector<G4VEmProcess*>& w =
    323         theManager->GetEmProcessVector();
    324   std::vector<G4VEmProcess*>::const_iterator itp;
    325   for(itp = w.begin(); itp != w.end(); itp++) {
    326     G4VEmProcess* q = *itp;
    327     if(q) q->SetApplyCuts(val);
    328   }
    329 }
    330 
    331 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    332 
    333 void G4EmProcessOptions::SetBuildCSDARange(G4bool val)
    334 {
    335   theManager->SetBuildCSDARange(val);
    336 }
    337 
    338 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    339 
    340 void G4EmProcessOptions::SetVerbose(G4int val, const G4String& name)
    341 {
    342   G4bool all = false;
    343   if("all" == name) all = true;
    344   const std::vector<G4VEnergyLossProcess*>& v =
    345         theManager->GetEnergyLossProcessVector();
    346 
    347   if(all) theManager->SetVerbose(val);
    348 
    349   std::vector<G4VEnergyLossProcess*>::const_iterator itr;
    350   for(itr = v.begin(); itr != v.end(); itr++) {
    351     G4VEnergyLossProcess* p = *itr;
    352     if(p) {
    353       if(all) p->SetVerboseLevel(val);
    354       else if (p->GetProcessName() == name) p->SetVerboseLevel(val);
    355     }
    356   }
    357   const std::vector<G4VEmProcess*>& w =
    358         theManager->GetEmProcessVector();
    359   std::vector<G4VEmProcess*>::const_iterator itp;
    360   for(itp = w.begin(); itp != w.end(); itp++) {
    361     G4VEmProcess* q = *itp;
    362     if(q) {
    363       if(all) q->SetVerboseLevel(val);
    364       else if (q->GetProcessName() == name) q->SetVerboseLevel(val);
    365     }
    366   }
    367   const std::vector<G4VMultipleScattering*>& u =
    368         theManager->GetMultipleScatteringVector();
    369   std::vector<G4VMultipleScattering*>::const_iterator itm;
    370   for(itm = u.begin(); itm != u.end(); itm++) {
    371     G4VMultipleScattering* s = *itm;
    372     if(s) {
    373       if(all) s->SetVerboseLevel(val);
    374       else if (s->GetProcessName() == name) s->SetVerboseLevel(val);
    375     }
    376   }
    377 }
    378 
    379 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    380 
    381 void G4EmProcessOptions::SetLambdaFactor(G4double val)
    382 {
    383   const std::vector<G4VEnergyLossProcess*>& v =
    384         theManager->GetEnergyLossProcessVector();
    385   std::vector<G4VEnergyLossProcess*>::const_iterator itr;
    386   for(itr = v.begin(); itr != v.end(); itr++) {
    387     G4VEnergyLossProcess* p = *itr;
    388     if(p) p->SetLambdaFactor(val);
    389   }
    390 
    391 }
    392 
    393 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    394 
    395 void G4EmProcessOptions::ActivateDeexcitation(const G4String& pname,
    396                                               G4bool val,
    397                                               const G4String& reg)
    398 {
    399   G4RegionStore* regionStore = G4RegionStore::GetInstance();
    400   const G4Region* r = 0;
    401   if(reg == "" || reg == "World") {
    402     r = regionStore->GetRegion("DefaultRegionForTheWorld", false);
    403   } else {
    404     r = regionStore->GetRegion(reg, false);
    405   }
    406   if(!r) {
    407     G4cout << "G4EmProcessOptions::ActivateDeexcitation ERROR: G4Region <"
    408            << reg << "> not found, the command ignored" << G4endl;
    409     return;
    410   }
    411 
    412   const std::vector<G4VEnergyLossProcess*>& v =
    413         theManager->GetEnergyLossProcessVector();
    414   std::vector<G4VEnergyLossProcess*>::const_iterator itr;
    415   for(itr = v.begin(); itr != v.end(); itr++) {
    416     G4VEnergyLossProcess* p = *itr;
    417     if(p) {
    418       if(pname == p->GetProcessName()) p->ActivateDeexcitation(val,r);
    419     }
    420   }
    421   const std::vector<G4VEmProcess*>& w =
    422         theManager->GetEmProcessVector();
    423   std::vector<G4VEmProcess*>::const_iterator itp;
    424   for(itp = w.begin(); itp != w.end(); itp++) {
    425     G4VEmProcess* q = *itp;
    426     if(q) {
    427       if(pname == q->GetProcessName()) q->ActivateDeexcitation(val,r);
    428     }
    429   }
    430 }
    431 
    432 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    433 
    434 void G4EmProcessOptions::SetMscStepLimitation(G4MscStepLimitType val)
    435 {
    436   const std::vector<G4VMultipleScattering*>& u =
    437         theManager->GetMultipleScatteringVector();
    438   std::vector<G4VMultipleScattering*>::const_iterator itm;
    439   for(itm = u.begin(); itm != u.end(); itm++) {
    440     if(*itm) (*itm)->SetStepLimitType(val);
    441   }
    442 }
    443 
    444 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    445 
    446 void G4EmProcessOptions::SetMscLateralDisplacement(G4bool val)
    447 {
    448   const std::vector<G4VMultipleScattering*>& u =
    449         theManager->GetMultipleScatteringVector();
    450   std::vector<G4VMultipleScattering*>::const_iterator itm;
    451   for(itm = u.begin(); itm != u.end(); itm++) {
    452     if(*itm) (*itm)->SetLateralDisplasmentFlag(val);
    453   }
    454 }
    455 
    456 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    457 
    458 void G4EmProcessOptions::SetSkin(G4double val)
    459 {
    460   if(val < 0.0) return;
    461   const std::vector<G4VMultipleScattering*>& u =
    462         theManager->GetMultipleScatteringVector();
    463   std::vector<G4VMultipleScattering*>::const_iterator itm;
    464   for(itm = u.begin(); itm != u.end(); itm++) {
    465     if(*itm) {
    466       (*itm)->SetSkin(val);
    467     }
    468   }
    469 }
    470 
    471 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    472 
    473 void G4EmProcessOptions::SetMscRangeFactor(G4double val)
    474 {
    475   if(val < 0.0) return;
    476   const std::vector<G4VMultipleScattering*>& u =
    477         theManager->GetMultipleScatteringVector();
    478   std::vector<G4VMultipleScattering*>::const_iterator itm;
    479   for(itm = u.begin(); itm != u.end(); itm++) {
    480     if(*itm) (*itm)->SetRangeFactor(val);
    481   }
    482 }
    483 
    484 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    485 
    486 void G4EmProcessOptions::SetMscGeomFactor(G4double val)
    487 {
    488   if(val < 0.0) return;
    489   const std::vector<G4VMultipleScattering*>& u =
    490         theManager->GetMultipleScatteringVector();
    491   std::vector<G4VMultipleScattering*>::const_iterator itm;
    492   for(itm = u.begin(); itm != u.end(); itm++) {
    493     if(*itm) (*itm)->SetGeomFactor(val);
    494   }
    495 }
    496 
    497 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    498 
    499 void G4EmProcessOptions::SetPolarAngleLimit(G4double val)
    500 {
    501   const std::vector<G4VMultipleScattering*>& u =
    502         theManager->GetMultipleScatteringVector();
    503   std::vector<G4VMultipleScattering*>::const_iterator itm;
    504   for(itm = u.begin(); itm != u.end(); itm++) {
    505     if(*itm) (*itm)->SetPolarAngleLimit(val);
    506   }
    507   const std::vector<G4VEmProcess*>& w =
    508         theManager->GetEmProcessVector();
    509   std::vector<G4VEmProcess*>::const_iterator itp;
    510   for(itp = w.begin(); itp != w.end(); itp++) {
    511     G4VEmProcess* q = *itp;
    512     if(q) q->SetPolarAngleLimit(val);
     358    if(q) { q->SetPolarAngleLimit(val); }
    513359  }
    514360}
  • trunk/source/processes/electromagnetic/utils/src/G4LossTableManager.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4LossTableManager.cc,v 1.97 2009/10/29 19:25:28 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4LossTableManager.cc,v 1.101 2010/06/04 15:33:56 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    7070// 12-02-07 Add SetSkin, SetLinearLossLimit (V.Ivanchenko)
    7171// 18-06-07 Move definition of msc parameters to G4EmProcessOptions (V.Ivanchenko)
    72 // 21-02-08 Add G4EmSaturation (V.Ivanchenko)
     72// 21-02-08 Added G4EmSaturation (V.Ivanchenko)
     73// 12-04-10 Added PreparePhsyicsTables and BuildPhysicsTables entries (V.Ivanchenko)
    7374//
    7475// Class Description:
     
    9697#include "G4EmTableType.hh"
    9798#include "G4LossTableBuilder.hh"
     99#include "G4Region.hh"
    98100
    99101G4LossTableManager* G4LossTableManager::theInstance = 0;
     
    114116G4LossTableManager::~G4LossTableManager()
    115117{
    116   for (G4int i=0; i<n_loss; i++) {
    117     if( loss_vector[i] ) delete loss_vector[i];
     118  for (G4int i=0; i<n_loss; ++i) {
     119    if( loss_vector[i] ) { delete loss_vector[i]; }
    118120  }
    119121  size_t msc = msc_vector.size();
    120   for (size_t j=0; j<msc; j++) {
    121     if( msc_vector[j] ) delete msc_vector[j];
     122  for (size_t j=0; j<msc; ++j) {
     123    if( msc_vector[j] ) { delete msc_vector[j]; }
    122124  }
    123125  size_t emp = emp_vector.size();
    124   for (size_t k=0; k<emp; k++) {
    125     if( emp_vector[k] ) delete emp_vector[k];
     126  for (size_t k=0; k<emp; ++k) {
     127    if( emp_vector[k] ) { delete emp_vector[k]; }
    126128  }
    127129  size_t mod = mod_vector.size();
    128   for (size_t a=0; a<mod; a++) {
    129     if( mod_vector[a] ) delete mod_vector[a];
     130  for (size_t a=0; a<mod; ++a) {
     131    if( mod_vector[a] ) { delete mod_vector[a]; }
    130132  }
    131133  size_t fmod = fmod_vector.size();
    132   for (size_t b=0; b<fmod; b++) {
    133     if( fmod_vector[b] ) delete fmod_vector[b];
     134  for (size_t b=0; b<fmod; ++b) {
     135    if( fmod_vector[b] ) { delete fmod_vector[b]; }
    134136  }
    135137  Clear();
     
    146148  n_loss = 0;
    147149  run = 0;
    148   //  first_entry = true;
     150  startInitialisation = false;
    149151  all_tables_are_built = false;
    150   all_tables_are_stored = false;
    151152  currentLoss = 0;
    152153  currentParticle = 0;
     154  firstParticle = 0;
    153155  lossFluctuationFlag = true;
    154156  subCutoffFlag = false;
     
    158160  maxFinalStep = 0.0;
    159161  minKinEnergy = 0.1*keV;
    160   maxKinEnergy = 100.0*TeV;
    161   maxKinEnergyForMuons = 100.*TeV;
    162   theMessenger = new G4EnergyLossMessenger();
    163   theElectron  = G4Electron::Electron();
    164   tableBuilder = new G4LossTableBuilder();
    165   emCorrections= new G4EmCorrections();
    166   emSaturation = new G4EmSaturation();
    167   emConfigurator = new G4EmConfigurator();
     162  maxKinEnergy = 10.0*TeV;
     163  nbinsLambda  = 77;
     164  nbinsPerDecade = 7;
     165  maxKinEnergyForMuons = 10.*TeV;
    168166  integral = true;
    169167  integralActive = false;
     
    178176  factorForAngleLimit = 1.0;
    179177  verbose = 1;
     178  theMessenger = new G4EnergyLossMessenger();
     179  theElectron  = G4Electron::Electron();
     180  tableBuilder = new G4LossTableBuilder();
     181  emCorrections= new G4EmCorrections();
     182  emSaturation = new G4EmSaturation();
     183  emConfigurator = new G4EmConfigurator(verbose);
    180184  tableBuilder->SetSplineFlag(splineFlag);
    181185}
     
    207211void G4LossTableManager::Register(G4VEnergyLossProcess* p)
    208212{
    209   n_loss++;
     213  ++n_loss;
    210214  loss_vector.push_back(p);
    211215  part_vector.push_back(0);
     
    217221  isActive.push_back(true);
    218222  all_tables_are_built = false;
    219   if(!lossFluctuationFlag) p->SetLossFluctuations(false);
    220   if(subCutoffFlag)        p->ActivateSubCutoff(true);
    221   if(rndmStepFlag)         p->SetRandomStep(true);
    222   if(stepFunctionActive)   p->SetStepFunction(maxRangeVariation, maxFinalStep);
    223   if(integralActive)       p->SetIntegral(integral);
    224   if(minEnergyActive)      p->SetMinKinEnergy(minKinEnergy);
    225   if(maxEnergyActive)      p->SetMaxKinEnergy(maxKinEnergy);
     223  if(!lossFluctuationFlag) { p->SetLossFluctuations(false); }
     224  if(subCutoffFlag)        { p->ActivateSubCutoff(true); }
     225  if(rndmStepFlag)         { p->SetRandomStep(true); }
     226  if(stepFunctionActive)   { p->SetStepFunction(maxRangeVariation, maxFinalStep); }
     227  if(integralActive)       { p->SetIntegral(integral); }
     228  if(minEnergyActive)      { p->SetMinKinEnergy(minKinEnergy); }
     229  if(maxEnergyActive)      { p->SetMaxKinEnergy(maxKinEnergy); }
    226230  if(verbose > 1)
    227231    G4cout << "G4LossTableManager::Register G4VEnergyLossProcess : "
     
    233237void G4LossTableManager::DeRegister(G4VEnergyLossProcess* p)
    234238{
    235   for (G4int i=0; i<n_loss; i++) {
    236     if(loss_vector[i] == p) loss_vector[i] = 0;
     239  for (G4int i=0; i<n_loss; ++i) {
     240    if(loss_vector[i] == p) { loss_vector[i] = 0; }
    237241  }
    238242}
     
    254258{
    255259  size_t msc = msc_vector.size();
    256   for (size_t i=0; i<msc; i++) {
    257     if(msc_vector[i] == p) msc_vector[i] = 0;
     260  for (size_t i=0; i<msc; ++i) {
     261    if(msc_vector[i] == p) { msc_vector[i] = 0; }
    258262  }
    259263}
     
    275279{
    276280  size_t emp = emp_vector.size();
    277   for (size_t i=0; i<emp; i++) {
    278     if(emp_vector[i] == p) emp_vector[i] = 0;
     281  for (size_t i=0; i<emp; ++i) {
     282    if(emp_vector[i] == p) { emp_vector[i] = 0; }
    279283  }
    280284}
     
    296300{
    297301  size_t n = mod_vector.size();
    298   for (size_t i=0; i<n; i++) {
    299     if(mod_vector[i] == p) mod_vector[i] = 0;
     302  for (size_t i=0; i<n; ++i) {
     303    if(mod_vector[i] == p) { mod_vector[i] = 0; }
    300304  }
    301305}
     
    317321{
    318322  size_t n = fmod_vector.size();
    319   for (size_t i=0; i<n; i++) {
    320     if(fmod_vector[i] == p) fmod_vector[i] = 0;
     323  for (size_t i=0; i<n; ++i) {
     324    if(fmod_vector[i] == p) { fmod_vector[i] = 0; }
    321325  }
    322326}
     
    336340     G4VEnergyLossProcess* p)
    337341{
    338   n_loss++;
     342  ++n_loss;
    339343  loss_vector.push_back(p);
    340344  part_vector.push_back(part);
     
    349353//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
    350354
    351 void G4LossTableManager::EnergyLossProcessIsInitialised(
    352                    const G4ParticleDefinition* particle,
    353                    G4VEnergyLossProcess* p)
    354 {
    355   if (run == 0 || (particle == firstParticle && all_tables_are_built) ) {
     355void
     356G4LossTableManager::PreparePhysicsTable(const G4ParticleDefinition* particle,
     357                                        G4VEnergyLossProcess* p)
     358{
     359  if (1 < verbose) {
     360    G4cout << "G4LossTableManager::PreparePhysicsTable for "
     361           << particle->GetParticleName()
     362           << " and " << p->GetProcessName() << " run= " << run << G4endl;
     363  }
     364  // start initialisation for the first run
     365  startInitialisation = true;
     366
     367  if( 0 == run ) {
     368    emConfigurator->PrepareModels(particle, p);
     369
     370    // initialise particles for given process
     371    for (G4int j=0; j<n_loss; ++j) {
     372      if (p == loss_vector[j]) {
     373        if (!part_vector[j]) { part_vector[j] = particle; }
     374      }
     375    }
     376  }
     377}
     378
     379//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
     380
     381void
     382G4LossTableManager::PreparePhysicsTable(const G4ParticleDefinition* particle,
     383                                        G4VEmProcess* p)
     384{
     385  if (1 < verbose) {
     386    G4cout << "G4LossTableManager::PreparePhysicsTable for "
     387           << particle->GetParticleName()
     388           << " and " << p->GetProcessName() << G4endl;
     389  }
     390  // start initialisation for the first run
     391  if( 0 == run ) {
     392    emConfigurator->PrepareModels(particle, p);
     393  }
     394  startInitialisation = true;
     395}
     396
     397//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
     398
     399void
     400G4LossTableManager::PreparePhysicsTable(const G4ParticleDefinition* particle,
     401                                        G4VMultipleScattering* p)
     402{
     403  if (1 < verbose) {
     404    G4cout << "G4LossTableManager::PreparePhysicsTable for "
     405           << particle->GetParticleName()
     406           << " and " << p->GetProcessName() << G4endl;
     407  }
     408  // start initialisation for the first run
     409  if( 0 == run ) {
     410    emConfigurator->PrepareModels(particle, p);
     411  }
     412}
     413
     414//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
     415
     416void
     417G4LossTableManager::BuildPhysicsTable(const G4ParticleDefinition*)
     418{
     419  if(0 == run && startInitialisation) {
     420    emConfigurator->Clear();
     421  }
     422}
     423
     424//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
     425
     426void G4LossTableManager::BuildPhysicsTable(
     427     const G4ParticleDefinition* aParticle,
     428     G4VEnergyLossProcess* p)
     429{
     430  if(1 < verbose) {
     431    G4cout << "### G4LossTableManager::BuildDEDXTable() is requested for "
     432           << aParticle->GetParticleName()
     433           << " and process " << p->GetProcessName()
     434           << G4endl;
     435  }
     436  // clear configurator
     437  if(0 == run && startInitialisation) {
     438    emConfigurator->Clear();
     439    firstParticle = aParticle;
     440  }
     441  startInitialisation = false;
     442
     443  // initialisation before any table is built
     444  if ( aParticle == firstParticle ) {
    356445    all_tables_are_built = true;
    357446
    358     if(1 < verbose)
    359       G4cout << "### G4LossTableManager start initilisation of tables"
     447    if(1 < verbose) {
     448      G4cout << "### G4LossTableManager start initilisation for first particle "
     449             << firstParticle->GetParticleName()
    360450             << G4endl;
    361     for (G4int i=0; i<n_loss; i++) {
     451    }
     452    for (G4int i=0; i<n_loss; ++i) {
    362453      G4VEnergyLossProcess* el = loss_vector[i];
    363454
     
    365456        const G4ProcessManager* pm = el->GetProcessManager();
    366457        isActive[i] = pm->GetProcessActivation(el);
     458        if(0 == run) { base_part_vector[i] = el->BaseParticle(); }
    367459        tables_are_built[i] = false;
    368         all_tables_are_built = false;
    369         if(!isActive[i]) el->SetIonisation(false);
     460        all_tables_are_built= false;
     461        if(!isActive[i]) { el->SetIonisation(false); }
    370462 
    371463        if(1 < verbose) {
     
    374466                 << "  active= " << pm->GetProcessActivation(el)
    375467                 << "  table= " << tables_are_built[i]
    376                  << "  isIonisation= " << el->IsIonisationProcess()
    377                  << G4endl;
     468                 << "  isIonisation= " << el->IsIonisationProcess();
     469          if(base_part_vector[i]) {
     470            G4cout << "  base particle " << base_part_vector[i]->GetParticleName();
     471          }
     472          G4cout << G4endl;
    378473        }
    379474      } else {
     
    382477      }
    383478    }
    384     if (0 == run) firstParticle = particle;
    385     run++;
    386   }
    387 
    388   currentParticle = 0;
    389 
    390   SetParameters(p);
    391   for (G4int j=0; j<n_loss; j++) {
    392     if (p == loss_vector[j]) {
    393 
    394       if (!part_vector[j]) {
    395         part_vector[j] = particle;
    396         base_part_vector[j] = p->BaseParticle();
     479    ++run;
     480    currentParticle = 0;
     481  }
     482
     483  // Set run time parameters
     484  SetParameters(aParticle, p);
     485
     486  if (all_tables_are_built) { return; }
     487
     488  // Build tables for given particle
     489  all_tables_are_built = true;
     490
     491  for(G4int i=0; i<n_loss; ++i) {
     492    if(p == loss_vector[i] && !tables_are_built[i] && !base_part_vector[i]) {
     493      const G4ParticleDefinition* curr_part = part_vector[i];
     494      if(1 < verbose) {
     495        G4cout << "### BuildPhysicsTable for " << p->GetProcessName()
     496               << " and " << curr_part->GetParticleName()
     497               << " start BuildTable " << G4endl;
    397498      }
    398       if(maxEnergyForMuonsActive) {
    399         G4double dm = std::abs(particle->GetPDGMass() - 105.7*MeV);
    400         if(dm < 5.*MeV) p->SetMaxKinEnergy(maxKinEnergyForMuons);
    401       }
    402 
    403       if(1 < verbose) {
    404         G4cout << "For " << p->GetProcessName()
    405                << " for " << part_vector[j]->GetParticleName()
    406                << " tables_are_built= " << tables_are_built[j]
    407                << " procFlag= " << loss_vector[j]->TablesAreBuilt()
    408                << " all_tables_are_built= "     << all_tables_are_built
    409                << G4endl;
    410       }
    411     }
    412   }
    413 }
    414 
    415 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
    416 
    417 G4EnergyLossMessenger* G4LossTableManager::GetMessenger()
    418 {
    419   return theMessenger;
    420 }
    421 
    422 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
    423 
    424 void G4LossTableManager::ParticleHaveNoLoss(
    425      const G4ParticleDefinition* aParticle)
    426 {
    427   G4String s = " dE/dx table not found for "
    428              + aParticle->GetParticleName() + " !";
    429   G4Exception("G4LossTableManager::ParticleHaveNoLoss", "EM01",
    430               FatalException, s);
    431 
    432 }
    433 
    434 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
    435 
    436 G4bool G4LossTableManager::BuildCSDARange() const
    437 {
    438   return buildCSDARange;
    439 }
    440 
    441 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
    442 
    443 void G4LossTableManager::BuildPhysicsTable(
    444      const G4ParticleDefinition* aParticle,
    445      G4VEnergyLossProcess* p)
    446 {
    447   if(1 < verbose) {
    448     G4cout << "### G4LossTableManager::BuildDEDXTable() is requested for "
    449            << aParticle->GetParticleName()
    450            << " and process " << p->GetProcessName()
    451            << G4endl;
    452   }
    453   if (all_tables_are_built) return;
    454   all_tables_are_built = true;
    455 
    456   for(G4int i=0; i<n_loss; i++) {
    457     if(!tables_are_built[i] && !base_part_vector[i]) {
    458       const G4ParticleDefinition* curr_part = part_vector[i];
    459499      G4VEnergyLossProcess* curr_proc = BuildTables(curr_part);
    460       if(curr_proc) CopyTables(curr_part, curr_proc);
    461     }
    462   }
    463 
    464   for (G4int ii=0; ii<n_loss; ii++) {
    465     if ( !tables_are_built[ii] ) {
    466       all_tables_are_built = false;
    467       break;
    468     }
     500      if(curr_proc) { CopyTables(curr_part, curr_proc); }
     501    }
     502    if ( !tables_are_built[i] ) { all_tables_are_built = false; }
    469503  }
    470504
     
    473507           << "all_tables_are_built= " << all_tables_are_built
    474508           << G4endl;
    475 
    476     if(all_tables_are_built)
     509   
     510    if(all_tables_are_built) {
    477511      G4cout << "### All dEdx and Range tables are built #####" << G4endl;
     512    }
    478513  }
    479514}
     
    484519                                          G4VEnergyLossProcess* base_proc)
    485520{
    486   for (G4int j=0; j<n_loss; j++) {
     521  for (G4int j=0; j<n_loss; ++j) {
    487522
    488523    G4VEnergyLossProcess* proc = loss_vector[j];
    489     if(proc == base_proc || proc->Particle() == part)
    490       tables_are_built[j] = true;
     524    //if(proc == base_proc || proc->Particle() == part)
     525    //  tables_are_built[j] = true;
    491526
    492527    if (!tables_are_built[j] && part == base_part_vector[j]) {
     
    511546    }
    512547
    513     if (theElectron == part && theElectron == proc->SecondaryParticle() )
     548    if (theElectron == part && theElectron == proc->SecondaryParticle() ) {
    514549      proc->SetSecondaryRangeTable(base_proc->RangeTableForLoss());
     550    }
    515551  }
    516552}
     
    535571  G4int i;
    536572
    537   for (i=0; i<n_loss; i++) {
     573  for (i=0; i<n_loss; ++i) {
    538574    p = loss_vector[i];
    539575    if (p && aParticle == part_vector[i] && !tables_are_built[i]) {
     
    602638  std::vector<G4PhysicsTable*> listCSDA;
    603639
    604   for (i=0; i<n_dedx; i++) {
     640  for (i=0; i<n_dedx; ++i) {
    605641    p = loss_list[i];
    606642    p->SetIonisation(false);
     
    658694//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
    659695
     696G4EnergyLossMessenger* G4LossTableManager::GetMessenger()
     697{
     698  return theMessenger;
     699}
     700
     701//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
     702
     703void G4LossTableManager::ParticleHaveNoLoss(
     704     const G4ParticleDefinition* aParticle)
     705{
     706  G4String s = " dE/dx table not found for "
     707             + aParticle->GetParticleName() + " !";
     708  G4Exception("G4LossTableManager::ParticleHaveNoLoss", "EM01",
     709              FatalException, s);
     710
     711}
     712
     713//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
     714
     715G4bool G4LossTableManager::BuildCSDARange() const
     716{
     717  return buildCSDARange;
     718}
     719
     720//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
     721
    660722void G4LossTableManager::SetLossFluctuations(G4bool val)
    661723{
    662724  lossFluctuationFlag = val;
    663   for(G4int i=0; i<n_loss; i++) {
    664     if(loss_vector[i]) loss_vector[i]->SetLossFluctuations(val);
    665   }
    666 }
    667 
    668 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
    669 
    670 void G4LossTableManager::SetSubCutoff(G4bool val)
     725  for(G4int i=0; i<n_loss; ++i) {
     726    if(loss_vector[i]) { loss_vector[i]->SetLossFluctuations(val); }
     727  }
     728}
     729
     730//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
     731
     732void G4LossTableManager::SetSubCutoff(G4bool val, const G4Region* r)
    671733{
    672734  subCutoffFlag = val;
    673   for(G4int i=0; i<n_loss; i++) {
    674     if(loss_vector[i]) loss_vector[i]->ActivateSubCutoff(val);
     735  for(G4int i=0; i<n_loss; ++i) {
     736    if(loss_vector[i]) { loss_vector[i]->ActivateSubCutoff(val, r); }
    675737  }
    676738}
     
    682744  integral = val;
    683745  integralActive = true;
    684   for(G4int i=0; i<n_loss; i++) {
    685     if(loss_vector[i]) loss_vector[i]->SetIntegral(val);
     746  for(G4int i=0; i<n_loss; ++i) {
     747    if(loss_vector[i]) { loss_vector[i]->SetIntegral(val); }
    686748  }
    687749  size_t emp = emp_vector.size();
    688   for (size_t k=0; k<emp; k++) {
    689     if(emp_vector[k]) emp_vector[k]->SetIntegral(val);
     750  for (size_t k=0; k<emp; ++k) {
     751    if(emp_vector[k]) { emp_vector[k]->SetIntegral(val); }
    690752  }
    691753}
     
    696758{
    697759  minSubRange = val;
    698   for(G4int i=0; i<n_loss; i++) {
    699     if(loss_vector[i]) loss_vector[i]->SetMinSubRange(val);
     760  for(G4int i=0; i<n_loss; ++i) {
     761    if(loss_vector[i]) { loss_vector[i]->SetMinSubRange(val); }
    700762  }
    701763}
     
    706768{
    707769  rndmStepFlag = val;
    708   for(G4int i=0; i<n_loss; i++) {
    709     if(loss_vector[i]) loss_vector[i]->SetRandomStep(val);
     770  for(G4int i=0; i<n_loss; ++i) {
     771    if(loss_vector[i]) { loss_vector[i]->SetRandomStep(val); }
    710772  }
    711773}
     
    717779  minEnergyActive = true;
    718780  minKinEnergy = val;
    719   for(G4int i=0; i<n_loss; i++) {
    720     if(loss_vector[i]) loss_vector[i]->SetMinKinEnergy(val);
     781  for(G4int i=0; i<n_loss; ++i) {
     782    if(loss_vector[i]) { loss_vector[i]->SetMinKinEnergy(val); }
    721783  }
    722784  size_t msc = msc_vector.size();
    723   for (size_t j=0; j<msc; j++) {
    724     if(msc_vector[j]) msc_vector[j]->SetMinKinEnergy(val);
     785  for (size_t j=0; j<msc; ++j) {
     786    if(msc_vector[j]) { msc_vector[j]->SetMinKinEnergy(val); }
    725787  }
    726788  size_t emp = emp_vector.size();
    727   for (size_t k=0; k<emp; k++) {
    728     if(emp_vector[k]) emp_vector[k]->SetMinKinEnergy(val);
     789  for (size_t k=0; k<emp; ++k) {
     790    if(emp_vector[k]) { emp_vector[k]->SetMinKinEnergy(val); }
    729791  }
    730792}
     
    736798  maxEnergyActive = true;
    737799  maxKinEnergy = val;
    738   for(G4int i=0; i<n_loss; i++) {
    739     if(loss_vector[i]) loss_vector[i]->SetMaxKinEnergy(val);
     800  for(G4int i=0; i<n_loss; ++i) {
     801    if(loss_vector[i]) { loss_vector[i]->SetMaxKinEnergy(val); }
    740802  }
    741803  size_t msc = msc_vector.size();
    742   for (size_t j=0; j<msc; j++) {
    743     if(msc_vector[j]) msc_vector[j]->SetMaxKinEnergy(val);
     804  for (size_t j=0; j<msc; ++j) {
     805    if(msc_vector[j]) { msc_vector[j]->SetMaxKinEnergy(val); }
    744806  }
    745807  size_t emp = emp_vector.size();
    746   for (size_t k=0; k<emp; k++) {
    747     if(emp_vector[k]) emp_vector[k]->SetMaxKinEnergy(val);
     808  for (size_t k=0; k<emp; ++k) {
     809    if(emp_vector[k]) { emp_vector[k]->SetMaxKinEnergy(val); }
    748810  }
    749811}
     
    753815void G4LossTableManager::SetMaxEnergyForCSDARange(G4double val)
    754816{
    755   for(G4int i=0; i<n_loss; i++) {
    756     if(loss_vector[i]) loss_vector[i]->SetMaxKinEnergyForCSDARange(val);
     817  for(G4int i=0; i<n_loss; ++i) {
     818    if(loss_vector[i]) { loss_vector[i]->SetMaxKinEnergyForCSDARange(val); }
    757819  }
    758820}
     
    770832void G4LossTableManager::SetDEDXBinning(G4int val)
    771833{
    772   for(G4int i=0; i<n_loss; i++) {
    773     if(loss_vector[i]) loss_vector[i]->SetDEDXBinning(val);
     834  for(G4int i=0; i<n_loss; ++i) {
     835    if(loss_vector[i]) { loss_vector[i]->SetDEDXBinning(val); }
    774836  }
    775837}
     
    779841void G4LossTableManager::SetDEDXBinningForCSDARange(G4int val)
    780842{
    781   for(G4int i=0; i<n_loss; i++) {
    782     if(loss_vector[i]) loss_vector[i]->SetDEDXBinningForCSDARange(val);
     843  for(G4int i=0; i<n_loss; ++i) {
     844    if(loss_vector[i]) { loss_vector[i]->SetDEDXBinningForCSDARange(val); }
    783845  }
    784846}
     
    788850void G4LossTableManager::SetLambdaBinning(G4int val)
    789851{
     852  G4int n = val/G4int(std::log10(maxKinEnergy/minKinEnergy));
     853  if(n < 5) {
     854    G4cout << "G4LossTableManager::SetLambdaBinning WARNING "
     855           << "too small number of bins " << val << "  ignored"
     856           << G4endl;
     857    return;
     858  }
     859  nbinsLambda = val;
     860  nbinsPerDecade = n;
    790861  size_t msc = msc_vector.size();
    791   for (size_t j=0; j<msc; j++) {
    792     if(msc_vector[j]) msc_vector[j]->SetBinning(val);
     862  for (size_t j=0; j<msc; ++j) {
     863    if(msc_vector[j]) { msc_vector[j]->SetBinning(val); }
    793864  }
    794865  size_t emp = emp_vector.size();
    795   for (size_t k=0; k<emp; k++) {
    796     if(emp_vector[k]) emp_vector[k]->SetLambdaBinning(val);
    797   }
     866  for (size_t k=0; k<emp; ++k) {
     867    if(emp_vector[k]) { emp_vector[k]->SetLambdaBinning(val); }
     868  }
     869}
     870
     871//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
     872
     873G4int G4LossTableManager::GetNumberOfBinsPerDecade() const
     874{
     875  return nbinsPerDecade;
    798876}
    799877
     
    803881{
    804882  verbose = val;
    805   for(G4int i=0; i<n_loss; i++) {
    806     if(loss_vector[i]) loss_vector[i]->SetVerboseLevel(val);
     883  for(G4int i=0; i<n_loss; ++i) {
     884    if(loss_vector[i]) { loss_vector[i]->SetVerboseLevel(val); }
    807885  }
    808886  size_t msc = msc_vector.size();
    809   for (size_t j=0; j<msc; j++) {
    810     if(msc_vector[j]) msc_vector[j]->SetVerboseLevel(val);
     887  for (size_t j=0; j<msc; ++j) {
     888    if(msc_vector[j]) { msc_vector[j]->SetVerboseLevel(val); }
    811889  }
    812890  size_t emp = emp_vector.size();
    813   for (size_t k=0; k<emp; k++) {
    814     if(emp_vector[k]) emp_vector[k]->SetVerboseLevel(val);
    815   }
     891  for (size_t k=0; k<emp; ++k) {
     892    if(emp_vector[k]) { emp_vector[k]->SetVerboseLevel(val); }
     893  }
     894  emConfigurator->SetVerbose(val);
     895  //tableBuilder->SetVerbose(val);
     896  //emCorrections->SetVerbose(val);
     897  emSaturation->SetVerbose(val);
    816898}
    817899
     
    823905  maxRangeVariation = v1;
    824906  maxFinalStep = v2;
    825   for(G4int i=0; i<n_loss; i++) {
    826     if(loss_vector[i]) loss_vector[i]->SetStepFunction(v1, v2);
     907  for(G4int i=0; i<n_loss; ++i) {
     908    if(loss_vector[i]) { loss_vector[i]->SetStepFunction(v1, v2); }
    827909  }
    828910}
     
    832914void G4LossTableManager::SetLinearLossLimit(G4double val)
    833915{
    834   for(G4int i=0; i<n_loss; i++) {
    835     if(loss_vector[i]) loss_vector[i]->SetLinearLossLimit(val);
     916  for(G4int i=0; i<n_loss; ++i) {
     917    if(loss_vector[i]) { loss_vector[i]->SetLinearLossLimit(val); }
    836918  }
    837919}
     
    846928//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
    847929
    848 void G4LossTableManager::SetParameters(G4VEnergyLossProcess* p)
    849 {
    850   if(stepFunctionActive) p->SetStepFunction(maxRangeVariation, maxFinalStep);
    851   if(integralActive)     p->SetIntegral(integral);
    852   if(minEnergyActive)    p->SetMinKinEnergy(minKinEnergy);
    853   if(maxEnergyActive)    p->SetMaxKinEnergy(maxKinEnergy);
     930void
     931G4LossTableManager::SetParameters(const G4ParticleDefinition* aParticle,
     932                                  G4VEnergyLossProcess* p)
     933{
     934  if(stepFunctionActive) { p->SetStepFunction(maxRangeVariation, maxFinalStep); }
     935  if(integralActive)     { p->SetIntegral(integral); }
     936  if(minEnergyActive)    { p->SetMinKinEnergy(minKinEnergy); }
     937  if(maxEnergyActive)    { p->SetMaxKinEnergy(maxKinEnergy); }
    854938  p->SetVerboseLevel(verbose);
     939  if(maxEnergyForMuonsActive) {
     940    G4double dm = std::abs(aParticle->GetPDGMass() - 105.7*MeV);
     941    if(dm < 5.*MeV) { p->SetMaxKinEnergy(maxKinEnergyForMuons); }
     942  }
    855943}
    856944
     
    858946
    859947const std::vector<G4VEnergyLossProcess*>&
    860       G4LossTableManager::GetEnergyLossProcessVector()
     948G4LossTableManager::GetEnergyLossProcessVector()
    861949{
    862950  return loss_vector;
     
    873961
    874962const std::vector<G4VMultipleScattering*>&
    875       G4LossTableManager::GetMultipleScatteringVector()
     963G4LossTableManager::GetMultipleScatteringVector()
    876964{
    877965  return msc_vector;
     
    9251013void G4LossTableManager::SetFactorForAngleLimit(G4double val)
    9261014{
    927   if(val > 0.0) factorForAngleLimit = val;
     1015  if(val > 0.0) { factorForAngleLimit = val; }
    9281016}
    9291017
  • trunk/source/processes/electromagnetic/utils/src/G4VEmModel.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VEmModel.cc,v 1.30 2009/09/23 14:42:47 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4VEmModel.cc,v 1.35 2010/05/26 18:06:25 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    8080  G4int n = elmSelectors.size();
    8181  if(n > 0) {
    82     for(G4int i=0; i<n; i++) {
     82    for(G4int i=0; i<n; ++i) {
    8383      delete elmSelectors[i];
    8484    }
     
    121121  // initialise before run
    122122  flagDeexcitation = false;
    123 
    124   G4int nbins = G4int(std::log10(highLimit/lowLimit) + 0.5);
    125   if(nbins < 3) nbins = 3;
    126   G4bool spline = G4LossTableManager::Instance()->SplineFlag();
     123  G4LossTableManager* man = G4LossTableManager::Instance();
     124  G4bool spline = man->SplineFlag();
     125
     126  // two times less bins because probability functon is normalized
     127  // so correspondingly is more smooth
     128  G4int nbins = (man->GetNumberOfBinsPerDecade()/3)*
     129    G4int(std::log10(highLimit/lowLimit) + 0.5);
     130  if(nbins < 5) { nbins = 5; }
    127131
    128132  G4ProductionCutsTable* theCoupleTable=
     
    131135
    132136  // prepare vector
    133   if(numOfCouples > nSelectors) elmSelectors.reserve(numOfCouples);
     137  if(numOfCouples > nSelectors) {
     138    elmSelectors.reserve(numOfCouples);
     139    for(G4int i=nSelectors; i<numOfCouples; ++i) { elmSelectors.push_back(0); }
     140    nSelectors = numOfCouples;
     141  }
    134142
    135143  // initialise vector
    136   for(G4int i=0; i<numOfCouples; i++) {
     144  for(G4int i=0; i<numOfCouples; ++i) {
    137145    currentCouple = theCoupleTable->GetMaterialCutsCouple(i);
    138146    const G4Material* material = currentCouple->GetMaterial();
     
    141149    // selector already exist check if should be deleted
    142150    G4bool create = true;
    143     if(i < nSelectors) {
    144       if(elmSelectors[i]) {
    145         if(material == elmSelectors[i]->GetMaterial()) create = false;
    146         else delete elmSelectors[i];
    147       }
    148     } else {
    149       nSelectors++;
    150       elmSelectors.push_back(0);
     151    if(elmSelectors[i]) {
     152      if(material == elmSelectors[i]->GetMaterial()) { create = false; }
     153      else { delete elmSelectors[i]; }
    151154    }
    152155    if(create) {
     
    195198//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    196199
     200const G4Element* G4VEmModel::SelectRandomAtom(const G4Material* material,
     201                                              const G4ParticleDefinition* pd,
     202                                              G4double kinEnergy,
     203                                              G4double tcut,
     204                                              G4double tmax)
     205{
     206  const G4ElementVector* theElementVector = material->GetElementVector();
     207  G4int n = material->GetNumberOfElements() - 1;
     208  currentElement = (*theElementVector)[n];
     209  if (n > 0) {
     210    G4double x = G4UniformRand()*
     211                 G4VEmModel::CrossSectionPerVolume(material,pd,kinEnergy,tcut,tmax);
     212    for(G4int i=0; i<n; ++i) {
     213      if (x <= xsec[i]) {
     214        currentElement = (*theElementVector)[i];
     215        break;
     216      }
     217    }
     218  }
     219  return currentElement;
     220}
     221
     222//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     223
    197224G4double G4VEmModel::ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
    198225                                                G4double, G4double, G4double,
     
    217244//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    218245
     246G4double G4VEmModel::ChargeSquareRatio(const G4Track& track)
     247{
     248  return GetChargeSquareRatio(track.GetDefinition(),
     249                              track.GetMaterial(), track.GetKineticEnergy());
     250}
     251
     252//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     253
    219254G4double G4VEmModel::GetChargeSquareRatio(const G4ParticleDefinition* p,
    220255                                          const G4Material*, G4double)
  • trunk/source/processes/electromagnetic/utils/src/G4VEmProcess.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VEmProcess.cc,v 1.79 2009/11/10 20:30:55 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4VEmProcess.cc,v 1.87 2010/05/10 13:35:32 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    5353// 27-10-07 Virtual functions moved to source (V.Ivanchenko)
    5454// 24-06-09 Removed hidden bin in G4PhysicsVector (V.Ivanchenko)
     55// 17-02-10 Added pointer currentParticle (VI)
    5556//
    5657// Class Description:
     
    9899  currentModel(0),
    99100  particle(0),
     101  currentParticle(0),
    100102  currentCouple(0)
    101103{
     
    165167  G4VEmFluctuationModel* fm = 0;
    166168  modelManager->AddEmModel(order, p, fm, region);
    167   if(p) p->SetParticleChange(pParticleChange);
     169  if(p) { p->SetParticleChange(pParticleChange); }
    168170}
    169171
     
    205207void G4VEmProcess::PreparePhysicsTable(const G4ParticleDefinition& part)
    206208{
    207   if(!particle) particle = &part;
     209  if(!particle) { SetParticle(&part); }
    208210  if(1 < verboseLevel) {
    209211    G4cout << "G4VEmProcess::PreparePhysicsTable() for "
     
    214216  }
    215217
    216   (G4LossTableManager::Instance())->EmConfigurator()->AddModels();
     218  (G4LossTableManager::Instance())->PreparePhysicsTable(&part, this);
    217219
    218220  if(particle == &part) {
     
    230232    }
    231233
    232     theCuts = modelManager->Initialise(particle,secondaryParticle,2.,verboseLevel);
     234    theCuts = modelManager->Initialise(particle,secondaryParticle,
     235                                       2.,verboseLevel);
    233236    const G4ProductionCutsTable* theCoupleTable=
    234237          G4ProductionCutsTable::GetProductionCutsTable();
     
    242245    }
    243246  }
    244   // Sub Cutoff and Deexcitation
     247  // Deexcitation
    245248  if (nDERegions>0) {
    246249
     
    287290  }
    288291
     292  (G4LossTableManager::Instance())->BuildPhysicsTable(particle);
    289293  if(buildLambdaTable) {
    290294    BuildLambdaTable();
     
    294298  // reduce printout for nuclear stopping
    295299  G4bool gproc = true;
    296   if(GetProcessName() == "nuclearStopping" &&
     300  G4int st = GetProcessSubType();
     301  if(st == fCoulombScattering && part.GetParticleType() == "nucleus" &&
    297302     partname != "GenericIon" && partname != "alpha") { gproc = false; }
    298303
     
    354359           << particle->GetParticleName()
    355360           << G4endl;
    356     if(2 < verboseLevel) {
    357       G4cout << *theLambdaTable << G4endl;
    358     }
    359361  }
    360362}
     
    385387  if(verboseLevel > 2 && buildLambdaTable) {
    386388    G4cout << "      LambdaTable address= " << theLambdaTable << G4endl;
    387     if(theLambdaTable) G4cout << (*theLambdaTable) << G4endl;
     389    if(theLambdaTable) { G4cout << (*theLambdaTable) << G4endl; }
    388390  }
    389391}
     
    399401  *condition = NotForced;
    400402  G4double x = DBL_MAX;
    401   if(previousStepSize <= DBL_MIN) theNumberOfInteractionLengthLeft = -1.0;
     403  if(previousStepSize <= DBL_MIN) { theNumberOfInteractionLengthLeft = -1.0; }
    402404  InitialiseStep(track);
    403   if(!currentModel->IsActive(preStepKinEnergy)) return x;
     405  if(!currentModel->IsActive(preStepKinEnergy)) { return x; }
    404406
    405407  if(preStepKinEnergy < mfpKinEnergy) {
     
    428430      G4cout << "G4VEmProcess::PostStepGetPhysicalInteractionLength ";
    429431      G4cout << "[ " << GetProcessName() << "]" << G4endl;
    430       G4cout << " for " << particle->GetParticleName()
     432      G4cout << " for " << currentParticle->GetParticleName()
    431433             << " in Material  " <<  currentMaterial->GetName()
    432434             << " Ekin(MeV)= " << preStepKinEnergy/MeV
     
    461463  // Do not make anything if particle is stopped, the annihilation then
    462464  // should be performed by the AtRestDoIt!
    463   if (track.GetTrackStatus() == fStopButAlive) return &fParticleChange;
     465  if (track.GetTrackStatus() == fStopButAlive) { return &fParticleChange; }
    464466
    465467  G4double finalT = track.GetKineticEnergy();
     
    469471    G4double lx = GetLambda(finalT, currentCouple);
    470472    if(preStepLambda<lx && 1 < verboseLevel) {
    471       G4cout << "WARING: for " << particle->GetParticleName()
     473      G4cout << "WARING: for " << currentParticle->GetParticleName()
    472474             << " and " << GetProcessName()
    473475             << " E(MeV)= " << finalT/MeV
     
    483485
    484486  SelectModel(finalT, currentCoupleIndex);
    485   if(!currentModel->IsActive(finalT)) return &fParticleChange;
     487  if(!currentModel->IsActive(finalT)) { return &fParticleChange; }
    486488  if(useDeexcitation) {
    487489    currentModel->SetDeexcitationFlag(idxDERegions[currentCoupleIndex]);
     
    662664    SelectModel(kineticEnergy, currentCoupleIndex);
    663665    cross = currentModel->CrossSectionPerVolume(currentMaterial,
    664                                                 particle,kineticEnergy);
    665   }
    666 
     666                                                currentParticle,kineticEnergy);
     667  }
     668
     669  if(cross < 0.0) { cross = 0.0; }
    667670  return cross;
    668671}
     
    676679  *condition = NotForced;
    677680  return G4VEmProcess::MeanFreePath(track);
     681}
     682
     683//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     684
     685G4double G4VEmProcess::MeanFreePath(const G4Track& track)
     686{
     687  DefineMaterial(track.GetMaterialCutsCouple());
     688  preStepLambda = GetCurrentLambda(track.GetKineticEnergy());
     689  G4double x = DBL_MAX;
     690  if(DBL_MIN < preStepLambda) x = 1.0/preStepLambda;
     691  return x;
     692}
     693
     694//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     695
     696G4double
     697G4VEmProcess::ComputeCrossSectionPerAtom(G4double kineticEnergy,
     698                                         G4double Z, G4double A, G4double cut)
     699{
     700  SelectModel(kineticEnergy, currentCoupleIndex);
     701  G4double x = 0.0;
     702  if(currentModel) {
     703   x = currentModel->ComputeCrossSectionPerAtom(currentParticle,kineticEnergy,
     704                                                 Z,A,cut);
     705  }
     706  return x;
    678707}
    679708
     
    714743    theEnergyOfCrossSectionMax[i] = emax;
    715744    theCrossSectionMax[i] = smax;
    716     if(2 < verboseLevel) {
     745    if(1 < verboseLevel) {
    717746      G4cout << "For " << particle->GetParticleName()
    718747             << " Max CS at i= " << i << " emax(MeV)= " << emax/MeV
     
    733762
    734763//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     764
     765const G4Element* G4VEmProcess::GetCurrentElement() const
     766{
     767  const G4Element* elm = 0;
     768  if(currentModel) {elm = currentModel->GetCurrentElement(); }
     769  return elm;
     770}
     771
     772//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
  • trunk/source/processes/electromagnetic/utils/src/G4VEnergyLossProcess.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VEnergyLossProcess.cc,v 1.158 2009/10/29 18:07:08 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4VEnergyLossProcess.cc,v 1.167 2010/05/26 10:41:34 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    336336{
    337337  modelManager->AddEmModel(order, p, fluc, region);
    338   if(p) p->SetParticleChange(pParticleChange, fluc);
     338  if(p) { p->SetParticleChange(pParticleChange, fluc); }
    339339}
    340340
     
    406406    particle = &part;
    407407    if(part.GetParticleType() == "nucleus") {
    408       if(!theGenericIon) theGenericIon = G4GenericIon::GenericIon();
     408      if(!theGenericIon) { theGenericIon = G4GenericIon::GenericIon(); }
    409409      if(particle == theGenericIon) { isIon = true; }
    410410      else if(part.GetPDGCharge() > eplus) {
     
    426426      lManager->RegisterExtraParticle(&part, this);
    427427    }
     428    if(1 < verboseLevel) {
     429      G4cout << "### G4VEnergyLossProcess::PreparePhysicsTable() end for "
     430             << part.GetParticleName() << G4endl;
     431    }
    428432    return;
    429433  }
    430434
    431435  Clean();
    432   lManager->EmConfigurator()->AddModels();
     436  lManager->PreparePhysicsTable(&part, this);
    433437
    434438  // Base particle and set of models can be defined here
     
    502506        G4bool reg = false;
    503507        for(G4int i=0; i<nSCoffRegions; ++i) {
    504           if( pcuts == scoffRegions[i]->GetProductionCuts()) reg = true;
     508          if( pcuts == scoffRegions[i]->GetProductionCuts()) { reg = true; }
    505509        }
    506510        idxSCoffRegions[j] = reg;
     
    509513        G4bool reg = false;
    510514        for(G4int i=0; i<nDERegions; ++i) {
    511           if( pcuts == deRegions[i]->GetProductionCuts()) reg = true;
     515          if( pcuts == deRegions[i]->GetProductionCuts()) { reg = true; }
    512516        }
    513517        idxDERegions[j] = reg;
     
    515519    }
    516520  }
    517 
    518   lManager->EnergyLossProcessIsInitialised(particle, this);
    519521
    520522  if (1 < verboseLevel) {
     
    568570
    569571  // Added tracking cut to avoid tracking artifacts
    570   if(isIonisation) fParticleChange.SetLowEnergyLimit(lowestKinEnergy);
     572  if(isIonisation) { fParticleChange.SetLowEnergyLimit(lowestKinEnergy); }
    571573
    572574  if(1 < verboseLevel) {
     
    574576           << GetProcessName()
    575577           << " and particle " << part.GetParticleName();
    576     if(isIonisation) G4cout << "  isIonisation  flag = 1";
     578    if(isIonisation) { G4cout << "  isIonisation  flag = 1"; }
    577579    G4cout << G4endl;
    578580  }
     
    590592  }
    591593  G4PhysicsTable* table = 0;
    592   G4double emin = minKinEnergy;
    593594  G4double emax = maxKinEnergy;
    594595  G4int bin = nBins;
     
    619620    G4cout << numOfCouples << " materials"
    620621           << " minKinEnergy= " << minKinEnergy
    621            << " maxKinEnergy= " << maxKinEnergy
     622           << " maxKinEnergy= " << emax
     623           << " nbin= " << bin
    622624           << " EmTableType= " << tType
    623625           << " table= " << table
     
    642644        theCoupleTable->GetMaterialCutsCouple(i);
    643645      if(!bVector) {
    644         aVector = new G4PhysicsLogVector(emin, emax, bin);
     646        aVector = new G4PhysicsLogVector(minKinEnergy, emax, bin);
    645647        bVector = aVector;
    646648      } else {
    647649        aVector = new G4PhysicsLogVector(*bVector);
    648650      }
    649       //      G4PhysicsVector* aVector = new G4PhysicsLogVector(emin, emax, bin);
    650651      aVector->SetSpline(splineFlag);
    651652
    652653      modelManager->FillDEDXVector(aVector, couple, tType);
    653       if(splineFlag) aVector->FillSecondDerivatives();
     654      if(splineFlag) { aVector->FillSecondDerivatives(); }
    654655
    655656      // Insert vector for this material into the table
     
    701702
    702703  G4bool splineFlag = (G4LossTableManager::Instance())->SplineFlag();
     704  G4PhysicsLogVector* aVector = 0;
     705  G4PhysicsLogVector* bVector = 0;
    703706
    704707  for(size_t i=0; i<numOfCouples; ++i) {
     
    709712      const G4MaterialCutsCouple* couple =
    710713        theCoupleTable->GetMaterialCutsCouple(i);
    711       G4double cut = (*theCuts)[i];
    712       if(fSubRestricted == tType) cut = (*theSubCuts)[i];
    713       G4PhysicsVector* aVector = LambdaPhysicsVector(couple, cut);
     714      if(!bVector) {
     715        aVector = new G4PhysicsLogVector(minKinEnergy, maxKinEnergy, nBins);
     716        bVector = aVector;
     717      } else {
     718        aVector = new G4PhysicsLogVector(*bVector);
     719      }
    714720      aVector->SetSpline(splineFlag);
    715721
    716722      modelManager->FillLambdaVector(aVector, couple, true, tType);
    717       if(splineFlag) aVector->FillSecondDerivatives();
     723      if(splineFlag) { aVector->FillSecondDerivatives(); }
    718724
    719725      // Insert vector for this material into the table
     
    881887    if(x > finalRange && y < currentMinStep) {
    882888      x = y + finalRange*(1.0 - dRoverRange)*(2.0 - finalRange/fRange);
    883     } else if (rndmStepFlag) {x = SampleRange();}
     889    } else if (rndmStepFlag) { x = SampleRange(); }
    884890    //G4cout<<GetProcessName()<<": e= "<<preStepKinEnergy
    885891    //  <<" range= "<<fRange <<" cMinSt="<<currentMinStep
     
    912918  preStepScaledEnergy = preStepKinEnergy*massRatio;
    913919  SelectModel(preStepScaledEnergy);
    914   if(!currentModel->IsActive(preStepScaledEnergy)) return x;
    915 
    916   if(isIon) {
    917     chargeSqRatio =
    918       currentModel->GetChargeSquareRatio(currPart,currentMaterial,preStepKinEnergy);
     920  if(!currentModel->IsActive(preStepScaledEnergy)) { return x; }
     921
     922  if(isIon) {
     923    chargeSqRatio = currentModel->ChargeSquareRatio(track);
    919924    reduceFactor  = 1.0/(chargeSqRatio*massRatio);
    920925  }
    921926  //G4cout << "q2= " << chargeSqRatio << " massRatio= " << massRatio << G4endl;
    922927  // initialisation for sampling of the interaction length
    923   if(previousStepSize <= DBL_MIN) theNumberOfInteractionLengthLeft = -1.0;
    924   if(theNumberOfInteractionLengthLeft < 0.0) mfpKinEnergy = DBL_MAX;
     928  if(previousStepSize <= DBL_MIN) { theNumberOfInteractionLengthLeft = -1.0; }
     929  if(theNumberOfInteractionLengthLeft < 0.0) { mfpKinEnergy = DBL_MAX; }
    925930
    926931  // compute mean free path
    927932  if(preStepScaledEnergy < mfpKinEnergy) {
    928     if (integral) ComputeLambdaForScaledEnergy(preStepScaledEnergy);
    929     else  preStepLambda = GetLambdaForScaledEnergy(preStepScaledEnergy);
    930     if(preStepLambda <= DBL_MIN) mfpKinEnergy = 0.0;
     933    if (integral) { ComputeLambdaForScaledEnergy(preStepScaledEnergy); }
     934    else  { preStepLambda = GetLambdaForScaledEnergy(preStepScaledEnergy); }
     935    if(preStepLambda <= DBL_MIN) { mfpKinEnergy = 0.0; }
    931936  }
    932937
     
    940945      // subtract NumberOfInteractionLengthLeft
    941946      SubtractNumberOfInteractionLengthLeft(previousStepSize);
    942       if(theNumberOfInteractionLengthLeft < 0.)
     947      if(theNumberOfInteractionLengthLeft < 0.) {
    943948        theNumberOfInteractionLengthLeft = perMillion;
     949      }
    944950    }
    945951
     
    966972      // subtract NumberOfInteractionLengthLeft
    967973      SubtractNumberOfInteractionLengthLeft(previousStepSize);
    968       if(theNumberOfInteractionLengthLeft < 0.)
     974      if(theNumberOfInteractionLengthLeft < 0.) {
    969975        theNumberOfInteractionLengthLeft = perMillion;
     976      }
    970977    }
    971978    currentInteractionLength = DBL_MAX;
     
    987994  // Get the actual (true) Step length
    988995  G4double length = step.GetStepLength();
    989   if(length <= DBL_MIN) return &fParticleChange;
     996  if(length <= DBL_MIN) { return &fParticleChange; }
    990997  G4double eloss  = 0.0;
    991   G4double esecdep = 0.0;
    992998 
    993999  /* 
     
    10711077
    10721078      // Check boundary
    1073       if(prePoint->GetStepStatus() == fGeomBoundary) yes = true;
     1079      if(prePoint->GetStepStatus() == fGeomBoundary) { yes = true; }
    10741080
    10751081      // Check PrePoint
     
    10831089        }
    10841090
    1085         if(preSafety < rcut) yes = true;
     1091        if(preSafety < rcut) { yes = true; }
    10861092
    10871093        // Check PostPoint
     
    10911097            postSafety =
    10921098              safetyHelper->ComputeSafety(step.GetPostStepPoint()->GetPosition());
    1093             if(postSafety < rcut) yes = true;
     1099            if(postSafety < rcut) { yes = true; }
    10941100          }
    10951101        }
     
    11031109        scTracks.clear();
    11041110        SampleSubCutSecondaries(scTracks, step,
    1105                                 currentModel,currentMaterialIndex,
    1106                                 esecdep);
     1111                                currentModel,currentMaterialIndex);
    11071112        // add bremsstrahlung sampling
    11081113        /*
     
    11121117                scTracks, step, (scProcesses[i])->
    11131118                SelectModelForMaterial(preStepKinEnergy, currentMaterialIndex),
    1114                 currentMaterialIndex,esecdep);
     1119                currentMaterialIndex);
    11151120          }
    11161121        }
     
    11231128            G4Track* t = scTracks[i];
    11241129            G4double e = t->GetKineticEnergy();
    1125             if (t->GetDefinition() == thePositron) e += 2.0*electron_mass_c2;
     1130            if (t->GetDefinition() == thePositron) { e += 2.0*electron_mass_c2; }
    11261131            esec += e;
    11271132            pParticleChange->AddSecondary(t);
     
    11331138
    11341139  // Corrections, which cannot be tabulated
    1135   currentModel->CorrectionsAlongStep(currentCouple, dynParticle,
    1136                                      eloss, esecdep, length);
     1140  if(isIon) {
     1141    G4double eadd = 0.0;
     1142    currentModel->CorrectionsAlongStep(currentCouple, dynParticle,
     1143                                       eloss, eadd, length);
     1144  }
    11371145
    11381146  // Sample fluctuations
     
    11401148    G4VEmFluctuationModel* fluc = currentModel->GetModelOfFluctuations();
    11411149    if(fluc &&
    1142       (eloss + esec + esecdep + lowestKinEnergy) < preStepKinEnergy) {
     1150      (eloss + esec + lowestKinEnergy) < preStepKinEnergy) {
    11431151
    11441152      G4double tmax =
     
    11581166    }
    11591167  }
    1160   // add low-energy subcutoff particles
    1161   eloss += esecdep;
    1162   if(eloss < 0.0) eloss = 0.0;
    11631168
    11641169  // deexcitation
    1165   else if (useDeexcitation) {
    1166     if(idxDERegions[currentMaterialIndex]) {
     1170  if (useDeexcitation) {
     1171    if(idxDERegions[currentMaterialIndex] && eloss > 0.0) {
    11671172      currentModel->SampleDeexcitationAlongStep(currentMaterial, track, eloss);
    1168       if(eloss < 0.0) eloss = 0.0;
     1173      if(eloss < 0.0) { eloss = 0.0; }
    11691174    }
    11701175  }
     
    12031208       const G4Step& step,
    12041209       G4VEmModel* model,
    1205        G4int idx,
    1206        G4double& /*extraEdep*/)
     1210       G4int idx)
    12071211{
    12081212  // Fast check weather subcutoff can work
    12091213  G4double subcut = (*theSubCuts)[idx];
    12101214  G4double cut = (*theCuts)[idx];
    1211   if(cut <= subcut) return;
     1215  if(cut <= subcut) { return; }
    12121216
    12131217  const G4Track* track = step.GetTrack();
     
    12181222
    12191223  // negligible probability to get any interaction
    1220   if(length*cross < perMillion) return;
     1224  if(length*cross < perMillion) { return; }
    12211225  /*     
    12221226  if(-1 < verboseLevel)
     
    12691273      if(addSec) {
    12701274        G4Track* t = new G4Track((*it), pretime + fragment*dt, r);
    1271         //G4Track* t = new G4Track((*it), pretime, r);
    12721275        t->SetTouchableHandle(track->GetTouchableHandle());
    12731276        tracks.push_back(t);
     
    12961299  G4double postStepScaledEnergy = finalT*massRatio;
    12971300
    1298   if(!currentModel->IsActive(postStepScaledEnergy)) return &fParticleChange;
     1301  if(!currentModel->IsActive(postStepScaledEnergy)) { return &fParticleChange; }
    12991302  /*
    13001303  if(-1 < verboseLevel) {
     
    15061509                                    G4bool mandatory)
    15071510{
    1508   G4bool res = true;
     1511  G4bool isRetrieved = false;
    15091512  G4String filename = GetPhysicsTableFileName(part,directory,tname,ascii);
    1510   G4bool yes = aTable->ExistPhysicsTable(filename);
    1511   if(yes) {
    1512     if(!aTable) aTable = G4PhysicsTableHelper::PreparePhysicsTable(0);
    1513     yes = G4PhysicsTableHelper::RetrievePhysicsTable(aTable,filename,ascii);
    1514 
    1515     if((G4LossTableManager::Instance())->SplineFlag()) {
    1516       size_t n = aTable->length();
    1517       for(size_t i=0; i<n; ++i) {
    1518         if((*aTable)[i]) {
    1519           (*aTable)[i]->SetSpline(true);
     1513  if(aTable) {
     1514    if(aTable->ExistPhysicsTable(filename)) {
     1515      if(G4PhysicsTableHelper::RetrievePhysicsTable(aTable,filename,ascii)) {
     1516        isRetrieved = true;
     1517        if((G4LossTableManager::Instance())->SplineFlag()) {
     1518          size_t n = aTable->length();
     1519          for(size_t i=0; i<n; ++i) {
     1520            if((*aTable)[i]) { (*aTable)[i]->SetSpline(true); }
     1521          }
    15201522        }
    1521       }
    1522     }
    1523   }
    1524   if(yes) {
    1525     if (0 < verboseLevel) {
    1526       G4cout << tname << " table for " << part->GetParticleName()
    1527              << " is Retrieved from <" << filename << ">"
    1528              << G4endl;
    1529     }
    1530   } else {
    1531     if(mandatory) res = false;
    1532     if(mandatory || 1 < verboseLevel) {
     1523        if (0 < verboseLevel) {
     1524          G4cout << tname << " table for " << part->GetParticleName()
     1525                 << " is Retrieved from <" << filename << ">"
     1526                 << G4endl;
     1527        }
     1528      }
     1529    }
     1530  }
     1531  if(mandatory && !isRetrieved) {
     1532    if(0 < verboseLevel) {
    15331533      G4cout << tname << " table for " << part->GetParticleName()
    15341534             << " from file <"
     
    15361536             << G4endl;
    15371537    }
    1538   }
    1539   return res;
     1538    return false;
     1539  }
     1540  return true;
    15401541}
    15411542
     
    15741575                                                (*theCuts)[currentMaterialIndex]);
    15751576  }
    1576 
     1577  if(cross < 0.0) { cross = 0.0; }
    15771578  return cross;
    15781579}
     
    15851586  preStepLambda = GetLambdaForScaledEnergy(track.GetKineticEnergy()*massRatio);
    15861587  G4double x = DBL_MAX;
    1587   if(DBL_MIN < preStepLambda) x = 1.0/preStepLambda;
     1588  if(DBL_MIN < preStepLambda) { x = 1.0/preStepLambda; }
    15881589  return x;
    15891590}
     
    16221623//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    16231624
    1624 G4PhysicsVector* G4VEnergyLossProcess::LambdaPhysicsVector(
    1625                  const G4MaterialCutsCouple* couple, G4double cut)
    1626 {
     1625G4PhysicsVector*
     1626G4VEnergyLossProcess::LambdaPhysicsVector(const G4MaterialCutsCouple* /*couple*/,
     1627                                          G4double /*cut*/)
     1628{
     1629  /*
    16271630  G4double tmin =
    16281631    std::max(MinPrimaryEnergy(particle, couple->GetMaterial(), cut),
    16291632             minKinEnergy);
    1630   if(tmin >= maxKinEnergy) tmin = 0.5*maxKinEnergy;
     1633  if(tmin >= maxKinEnergy) { tmin = 0.5*maxKinEnergy; }
    16311634  G4PhysicsVector* v = new G4PhysicsLogVector(tmin, maxKinEnergy, nBins);
     1635  */
     1636  G4PhysicsVector* v = new G4PhysicsLogVector(minKinEnergy, maxKinEnergy, nBins);
    16321637  v->SetSpline((G4LossTableManager::Instance())->SplineFlag());
    16331638  return v;
     
    16401645{
    16411646  G4bool add = true;
    1642   if(p->GetProcessName() != "eBrem") add = false;
     1647  if(p->GetProcessName() != "eBrem") { add = false; }
    16431648  if(add && nProcesses > 0) {
    16441649    for(G4int i=0; i<nProcesses; ++i) {
     
    16991704void G4VEnergyLossProcess::SetCSDARangeTable(G4PhysicsTable* p)
    17001705{
    1701   if(theCSDARangeTable != p) theCSDARangeTable = p;
     1706  if(theCSDARangeTable != p) { theCSDARangeTable = p; }
    17021707
    17031708  if(p) {
     
    17681773           << " and process " << GetProcessName() << G4endl;
    17691774  }
    1770   if(theLambdaTable != p) theLambdaTable = p;
     1775  if(theLambdaTable != p) { theLambdaTable = p; }
    17711776  tablesAreBuilt = true;
    17721777
     
    18221827//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    18231828
     1829const G4Element* G4VEnergyLossProcess::GetCurrentElement() const
     1830{
     1831  const G4Element* elm = 0;
     1832  if(currentModel) { elm = currentModel->GetCurrentElement(); }
     1833  return elm;
     1834}
     1835
     1836//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     1837
  • trunk/source/processes/electromagnetic/utils/src/G4VMscModel.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VMscModel.cc,v 1.13 2009/07/20 17:32:47 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4VMscModel.cc,v 1.16 2010/04/06 09:24:46 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    6161  facgeom(2.5),
    6262  facsafety(0.3),
    63   skin(3.0),
     63  skin(1.0),
    6464  dtrl(0.05),
    6565  lambdalimit(mm),
  • trunk/source/processes/electromagnetic/utils/src/G4VMultipleScattering.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VMultipleScattering.cc,v 1.77 2009/10/29 18:07:08 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4VMultipleScattering.cc,v 1.82 2010/04/12 11:45:03 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    9595  firstParticle(0),
    9696  stepLimit(fUseSafety),
    97   skin(3.0),
     97  skin(1.0),
    9898  facrange(0.04),
    9999  facgeom(2.5),
     
    144144  G4VEmFluctuationModel* fm = 0;
    145145  modelManager->AddEmModel(order, p, fm, region);
    146   if(p) p->SetParticleChange(pParticleChange);
     146  if(p) { p->SetParticleChange(pParticleChange); }
    147147}
    148148//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    170170{
    171171  return modelManager->GetModel(idx, ver);
    172 }
    173 
    174 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    175 
    176 void G4VMultipleScattering::BuildPhysicsTable(const G4ParticleDefinition& part)
    177 {
    178   G4String num = part.GetParticleName();
    179   if(1 < verboseLevel) {
    180     G4cout << "### G4VMultipleScattering::BuildPhysicsTable() for "
    181            << GetProcessName()
    182            << " and particle " << num
    183            << G4endl;
    184   }
    185 
    186   if (buildLambdaTable && firstParticle == &part) {
    187 
    188     const G4ProductionCutsTable* theCoupleTable=
    189           G4ProductionCutsTable::GetProductionCutsTable();
    190     size_t numOfCouples = theCoupleTable->GetTableSize();
    191 
    192     G4bool splineFlag = (G4LossTableManager::Instance())->SplineFlag();
    193 
    194     G4PhysicsLogVector* aVector = 0;
    195     G4PhysicsLogVector* bVector = 0;
    196 
    197     for (size_t i=0; i<numOfCouples; ++i) {
    198 
    199       if (theLambdaTable->GetFlag(i)) {
    200         // create physics vector and fill it
    201         const G4MaterialCutsCouple* couple =
    202           theCoupleTable->GetMaterialCutsCouple(i);
    203         if(!bVector) {
    204           aVector = static_cast<G4PhysicsLogVector*>(PhysicsVector(couple));
    205           bVector = aVector;
    206         } else {
    207           aVector = new G4PhysicsLogVector(*bVector);
    208         }       
    209         //G4PhysicsVector* aVector = PhysicsVector(couple);
    210         aVector->SetSpline(splineFlag);
    211         modelManager->FillLambdaVector(aVector, couple, false);
    212         if(splineFlag) aVector->FillSecondDerivatives();
    213         G4PhysicsTableHelper::SetPhysicsVector(theLambdaTable, i, aVector);
    214       }
    215     }
    216 
    217     if(1 < verboseLevel) {
    218       G4cout << "Lambda table is built for "
    219              << num
    220              << G4endl;
    221     }
    222   }
    223   if(verboseLevel>0 && ( num == "e-" || num == "mu+" || 
    224                          num == "proton" || num == "pi-" ||
    225                          num == "GenericIon")) {
    226     PrintInfoDefinition();
    227     if(2 < verboseLevel && theLambdaTable) G4cout << *theLambdaTable << G4endl;
    228   }
    229 
    230   if(1 < verboseLevel) {
    231     G4cout << "### G4VMultipleScattering::BuildPhysicsTable() done for "
    232            << GetProcessName()
    233            << " and particle " << num
    234            << G4endl;
    235   }
    236172}
    237173
     
    260196  }
    261197
     198  (G4LossTableManager::Instance())->PreparePhysicsTable(&part, this);
     199
    262200  if(1 < verboseLevel) {
    263201    G4cout << "### G4VMultipleScattering::PrepearPhysicsTable() for "
     
    267205           << G4endl;
    268206  }
    269 
    270   (G4LossTableManager::Instance())->EmConfigurator()->AddModels();
    271207
    272208  if(firstParticle == &part) {
     
    307243//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    308244
     245void G4VMultipleScattering::BuildPhysicsTable(const G4ParticleDefinition& part)
     246{
     247  G4String num = part.GetParticleName();
     248  if(1 < verboseLevel) {
     249    G4cout << "### G4VMultipleScattering::BuildPhysicsTable() for "
     250           << GetProcessName()
     251           << " and particle " << num
     252           << G4endl;
     253  }
     254
     255  (G4LossTableManager::Instance())->BuildPhysicsTable(firstParticle);
     256
     257  if (buildLambdaTable && firstParticle == &part) {
     258
     259    const G4ProductionCutsTable* theCoupleTable=
     260          G4ProductionCutsTable::GetProductionCutsTable();
     261    size_t numOfCouples = theCoupleTable->GetTableSize();
     262
     263    G4bool splineFlag = (G4LossTableManager::Instance())->SplineFlag();
     264
     265    G4PhysicsLogVector* aVector = 0;
     266    G4PhysicsLogVector* bVector = 0;
     267
     268    for (size_t i=0; i<numOfCouples; ++i) {
     269
     270      if (theLambdaTable->GetFlag(i)) {
     271        // create physics vector and fill it
     272        const G4MaterialCutsCouple* couple =
     273          theCoupleTable->GetMaterialCutsCouple(i);
     274        if(!bVector) {
     275          aVector = static_cast<G4PhysicsLogVector*>(PhysicsVector(couple));
     276          bVector = aVector;
     277        } else {
     278          aVector = new G4PhysicsLogVector(*bVector);
     279        }       
     280        //G4PhysicsVector* aVector = PhysicsVector(couple);
     281        aVector->SetSpline(splineFlag);
     282        modelManager->FillLambdaVector(aVector, couple, false);
     283        if(splineFlag) aVector->FillSecondDerivatives();
     284        G4PhysicsTableHelper::SetPhysicsVector(theLambdaTable, i, aVector);
     285      }
     286    }
     287
     288    if(1 < verboseLevel) {
     289      G4cout << "Lambda table is built for "
     290             << num
     291             << G4endl;
     292    }
     293  }
     294  if(verboseLevel>0 && ( num == "e-" || num == "mu+" || 
     295                         num == "proton" || num == "pi-" ||
     296                         num == "GenericIon")) {
     297    PrintInfoDefinition();
     298    if(2 < verboseLevel && theLambdaTable) G4cout << *theLambdaTable << G4endl;
     299  }
     300
     301  if(1 < verboseLevel) {
     302    G4cout << "### G4VMultipleScattering::BuildPhysicsTable() done for "
     303           << GetProcessName()
     304           << " and particle " << num
     305           << G4endl;
     306  }
     307}
     308
     309//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     310
    309311void G4VMultipleScattering::PrintInfoDefinition()
    310312{
     
    362364//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    363365
     366G4double
     367G4VMultipleScattering::PostStepGetPhysicalInteractionLength(
     368              const G4Track&, G4double, G4ForceCondition* condition)
     369{
     370  *condition = Forced;
     371  return DBL_MAX;
     372}
     373
     374//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     375
     376G4VParticleChange*
     377G4VMultipleScattering::AlongStepDoIt(const G4Track& track, const G4Step& step)
     378{
     379  if(currentModel->IsActive(track.GetKineticEnergy())) {
     380    fParticleChange.ProposeTrueStepLength(currentModel->ComputeTrueStepLength(step.GetStepLength()));
     381  }
     382  return &fParticleChange;
     383}
     384
     385//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     386
     387G4VParticleChange*
     388G4VMultipleScattering::PostStepDoIt(const G4Track& track, const G4Step& step)
     389{
     390  fParticleChange.Initialize(track);
     391  if(currentModel->IsActive(track.GetKineticEnergy())) {
     392    currentModel->SampleScattering(track.GetDynamicParticle(),
     393                                   step.GetPostStepPoint()->GetSafety());
     394  }
     395  return &fParticleChange;
     396}
     397
     398//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     399
    364400G4double G4VMultipleScattering::GetContinuousStepLimit(
    365401                                       const G4Track& track,
     
    371407  return AlongStepGetPhysicalInteractionLength(track,previousStepSize,currentMinimalStep,
    372408                                               currentSafety, selection);
     409}
     410
     411//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     412
     413G4double G4VMultipleScattering::ContinuousStepLimit(
     414                                       const G4Track& track,
     415                                       G4double previousStepSize,
     416                                       G4double currentMinimalStep,
     417                                       G4double& currentSafety)
     418{
     419  return GetContinuousStepLimit(track,previousStepSize,currentMinimalStep,
     420                                currentSafety);
    373421}
    374422
  • trunk/source/processes/electromagnetic/utils/test/testG4EnergyLossTables.cc

    r1199 r1315  
    2626//
    2727// $Id: testG4EnergyLossTables.cc,v 1.7 2006/06/29 19:55:29 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03-cand-01 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//-------------------------------------------------------------------
  • trunk/source/processes/electromagnetic/xrays/History

    r1196 r1315  
    1 $Id: History,v 1.70 2009/07/29 23:43:27 gum Exp $
     1$Id: History,v 1.71 2010/05/27 20:47:23 gum Exp $
    22-------------------------------------------------------------------
    33
     
    1717     * Reverse chronological order (last date on top), please *
    1818     ----------------------------------------------------------
     19
     2022 February 10: P. Gumplinger (xrays-V09-03-00)
     21- Scintillation rise time included, thanks to Martin Goettlich/DESY
    1922
    202329 July 09: P. Gumplinger (xrays-V09-02-00)
  • trunk/source/processes/electromagnetic/xrays/include/G4Scintillation.hh

    r1228 r1315  
    2525//
    2626//
    27 // $Id: G4Scintillation.hh,v 1.16 2009/07/29 23:45:20 gum Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     27// $Id: G4Scintillation.hh,v 1.17 2010/05/27 20:48:35 gum Exp $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
     
    146146        // have been tracked, the tracking of the primary resumes.
    147147
     148        void SetFiniteRiseTime(const G4bool state);
     149        // If set, the G4Scintillation process expects the user to have
     150        // set the constant material property FAST/SLOWSCINTILLATIONRISETIME.
     151
    148152        G4bool GetTrackSecondariesFirst() const;
    149153        // Returns the boolean flag for tracking secondaries first.
     154
     155        G4bool GetFiniteRiseTime() const;
     156        // Returns the boolean flag for a finite scintillation rise time.
    150157       
    151158        void SetScintillationYieldFactor(const G4double yieldfactor);
     
    198205
    199206        G4bool fTrackSecondariesFirst;
     207        G4bool fFiniteRiseTime;
    200208
    201209        G4double YieldFactor;
     
    204212
    205213private:
     214
     215        G4double single_exp(G4double t, G4double tau2);
     216        G4double bi_exp(G4double t, G4double tau1, G4double tau2);
     217
     218        // emission time distribution when there is a finite rise time
     219        G4double sample_time(G4double tau1, G4double tau2);
    206220
    207221        G4EmSaturation* emSaturation;
     
    229243
    230244inline
     245void G4Scintillation::SetFiniteRiseTime(const G4bool state)
     246{
     247        fFiniteRiseTime = state;
     248}
     249
     250inline
    231251G4bool G4Scintillation::GetTrackSecondariesFirst() const
    232252{
    233253        return fTrackSecondariesFirst;
     254}
     255
     256inline
     257G4bool G4Scintillation::GetFiniteRiseTime() const
     258{
     259        return fFiniteRiseTime;
    234260}
    235261
     
    296322}
    297323
     324inline
     325G4double G4Scintillation::single_exp(G4double t, G4double tau2)
     326{
     327         return exp(-1.0*t/tau2)/tau2;
     328}
     329
     330inline
     331G4double G4Scintillation::bi_exp(G4double t, G4double tau1, G4double tau2)
     332{
     333         return exp(-1.0*t/tau2)*(1-exp(-1.0*t/tau1))/tau2/tau2*(tau1+tau2);
     334}
     335
    298336#endif /* G4Scintillation_h */
  • trunk/source/processes/electromagnetic/xrays/src/G4Scintillation.cc

    r1228 r1315  
    2525//
    2626//
    27 // $Id: G4Scintillation.cc,v 1.30 2008/10/22 01:19:11 gum Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     27// $Id: G4Scintillation.cc,v 1.31 2010/05/27 20:49:40 gum Exp $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030////////////////////////////////////////////////////////////////////////
     
    3737// Created:     1998-11-07 
    3838// Author:      Peter Gumplinger
    39 // Updated:     2005-08-17 by Peter Gumplinger
     39// Updated:     2010-92-22 by Peter Gumplinger
     40//              > scintillation rise time included, thanks to
     41//              > Martin Goettlich/DESY
     42//              2005-08-17 by Peter Gumplinger
    4043//              > change variable name MeanNumPhotons -> MeanNumberOfPhotons
    4144//              2005-07-28 by Peter Gumplinger
     
    9396
    9497        fTrackSecondariesFirst = false;
     98        fFiniteRiseTime = false;
    9599
    96100        YieldFactor = 1.0;
     
    248252
    249253            G4double ScintillationTime = 0.*ns;
     254            G4double ScintillationRiseTime = 0.*ns;
    250255            G4PhysicsOrderedFreeVector* ScintillationIntegral = NULL;
    251256
     
    255260                   ScintillationTime   = aMaterialPropertiesTable->
    256261                                           GetConstProperty("FASTTIMECONSTANT");
     262                   if (fFiniteRiseTime) {
     263                      ScintillationRiseTime = aMaterialPropertiesTable->
     264                                  GetConstProperty("FASTSCINTILLATIONRISETIME");
     265                   }
    257266                   ScintillationIntegral =
    258267                   (G4PhysicsOrderedFreeVector*)((*theFastIntegralTable)(materialIndex));
     
    261270                   ScintillationTime   = aMaterialPropertiesTable->
    262271                                           GetConstProperty("SLOWTIMECONSTANT");
     272                   if (fFiniteRiseTime) {
     273                      ScintillationRiseTime = aMaterialPropertiesTable->
     274                                  GetConstProperty("SLOWSCINTILLATIONRISETIME");                   }
    263275                   ScintillationIntegral =
    264276                   (G4PhysicsOrderedFreeVector*)((*theSlowIntegralTable)(materialIndex));
     
    276288                 ScintillationTime   = aMaterialPropertiesTable->
    277289                                          GetConstProperty("FASTTIMECONSTANT");
     290                 if (fFiniteRiseTime) {
     291                      ScintillationRiseTime = aMaterialPropertiesTable->
     292                                 GetConstProperty("FASTSCINTILLATIONRISETIME");
     293                 }
    278294                 ScintillationIntegral =
    279295                  (G4PhysicsOrderedFreeVector*)((*theFastIntegralTable)(materialIndex));
     
    284300               ScintillationTime   =   aMaterialPropertiesTable->
    285301                                          GetConstProperty("SLOWTIMECONSTANT");
     302               if (fFiniteRiseTime) {
     303                    ScintillationRiseTime = aMaterialPropertiesTable->
     304                                 GetConstProperty("SLOWSCINTILLATIONRISETIME");
     305               }
    286306               ScintillationIntegral =
    287307                  (G4PhysicsOrderedFreeVector*)((*theSlowIntegralTable)(materialIndex));
     
    369389                         pPostStepPoint->GetVelocity())/2.);
    370390
    371                 deltaTime = deltaTime -
    372                             ScintillationTime * log( G4UniformRand() );
     391                // emission time distribution
     392                if (ScintillationRiseTime==0.0) {
     393                   deltaTime = deltaTime -
     394                          ScintillationTime * log( G4UniformRand() );
     395                } else {
     396                   deltaTime = deltaTime +
     397                          sample_time(ScintillationRiseTime, ScintillationTime);
     398                }
    373399
    374400                G4double aSecondaryTime = t0 + deltaTime;
     
    592618
    593619}
     620
     621G4double G4Scintillation::sample_time(G4double tau1, G4double tau2)
     622{
     623// tau1: rise time and tau2: decay time
     624
     625        while(1) {
     626          // two random numbers
     627          G4double ran1 = G4UniformRand();
     628          G4double ran2 = G4UniformRand();
     629          //
     630          // exponential distribution as envelope function: very efficient
     631          //
     632          G4double d = (tau1+tau2)/tau2;
     633          // make sure the envelope function is
     634          // always larger than the bi-exponential
     635          G4double t = -1.0*tau2*log(1-ran1);
     636          G4double g = d*single_exp(t,tau2);
     637          if (ran2 <= bi_exp(t,tau1,tau2)/g) return t;
     638        }
     639        return -1.0;
     640}
  • trunk/source/processes/electromagnetic/xrays/test/testG4ForwardXrayTR.cc

    r1199 r1315  
    2626//
    2727// $Id: testG4ForwardXrayTR.cc,v 1.7 2006/06/29 19:56:33 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03-cand-01 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030
Note: See TracChangeset for help on using the changeset viewer.