Ignore:
Timestamp:
Apr 6, 2009, 12:21:12 PM (17 years ago)
Author:
garnier
Message:

update processes

Location:
trunk/source/processes/electromagnetic/lowenergy
Files:
172 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/electromagnetic/lowenergy/GNUmakefile

    r819 r961  
    1 # $Id: GNUmakefile,v 1.5 2003/09/20 14:41:31 vnivanch Exp $
     1# $Id: GNUmakefile,v 1.7 2008/11/20 12:06:28 alechner Exp $
    22# --------------------------------------------------------------------
    33# GNUmakefile for electromagnetic sub-library.  John Allison, 25/6/98.
     
    1414CPPFLAGS += -I$(G4BASE)/global/management/include \
    1515            -I$(G4BASE)/global/HEPRandom/include \
     16            -I$(G4BASE)/global/HEPNumerics/include \
    1617            -I$(G4BASE)/global/HEPGeometry/include \
    1718            -I$(G4BASE)/geometry/management/include \
     
    2021            -I$(G4BASE)/processes/cuts/include \
    2122            -I$(G4BASE)/processes/electromagnetic/utils/include \
     23            -I$(G4BASE)/processes/electromagnetic/standard/include \
    2224            -I$(G4BASE)/particles/management/include \
    2325            -I$(G4BASE)/particles/bosons/include \
  • trunk/source/processes/electromagnetic/lowenergy/History

    r819 r961  
    1 $Id: History,v 1.284 2007/11/26 17:27:09 pia Exp $
     1$Id: History,v 1.346 2009/02/20 10:49:54 sincerti Exp $
    22-------------------------------------------------------------------
    33
     
    1717     * Reverse chronological order (last date on top), please *
    1818     ----------------------------------------------------------
     19
     2016.02.2009, S. Incerti, tag emlowen-V09-02-15
     21            - added protections against FPE in G4hLowEnergyLoss.cc (see EM forum
     22              item 893)
     23
     2416.02.2009, S. Incerti, tag emlowen-V09-02-14
     25            - removed compilation warning in G4DNAEmfietzoglouExcitationModel.cc
     26
     2716.02.2009, S. Incerti, tag emlowen-V09-02-13
     28            - improved energy limit display in Geant4-DNA model classes
     29            - commented InitialiseElementSelectors call.
     30
     3116.02.2009, S. Incerti, tag emlowen-V09-02-12
     32            Made compatible with tag emutils-V09-02-00 the following files
     33            - G4DNAElastic.cc
     34            - G4DNAExcitation.cc
     35            - G4DNAIonisation.cc
     36            - G4DNAChargeDecrease.cc
     37            - G4DNAChargeIncrease.cc
     38
     3914.02.2009, S. Incerti, tag emlowen-V09-02-11
     40            Added several corrections to migrated Geant4-DNA processes:
     41            - G4DNABornIonisationModel.cc
     42            - G4DNAEmfietzoglouExcitationModel.cc
     43            - G4DNARuddIonisationModel.cc
     44            - G4DNAIonisation.hh
     45
     4610.02.2009, L. Pandola, tag emlowen-V09-02-10
     47            - Added G4LivermoreIonisationModel, namely first implementation of
     48              LowEnergyIonisation in the new design
     49
     5029.01.2009, L. Pandola, tag emlowen-V09-02-09
     51            - Updated public interface of G4eIonisationCrossSectionHandler.cc in order to
     52              facilitate the migration from G4LowEnergyIonisation to G4LivermoreIonisationModel
     53
     5422.01.2009, S. Incerti, tag emlowen-V09-02-08
     55            - Fixed compilation error problem & code syntax in DNA model classes
     56
     5721.01.2009, S. Incerti, tag emlowen-V09-02-07
     58            - Updated Livermore photon processes classes for handling of compound materials
     59            - Added pointer removal protections
     60            - Involved classes are :
     61              G4LivermoreRayleighModel.cc
     62              G4LivermorePolarizedRayleighModel.cc
     63              G4LivermorePolarizedComptonModel.cc
     64              G4LivermorePhotoElectricModel.cc
     65              G4LivermoreGammaconversionModel.cc
     66              G4LivermoreComptonModel.cc
     67
     6820.01.2009, S. Incerti, tag emlowen-V09-02-06
     69            Added 'kill particle without total energy deposit' feature for DNA charge change processes
     70            Involved files are :
     71            - G4DNAProcess.icc,
     72            - G4FinalStateProduct.hh,.cc,
     73            - G4FinalStateChargeDecrease.cc
     74            - G4FinalStateChargeIncrease.cc
     75
     7620.01.2009, S. Incerti, tag emlowen-V09-02-05
     77            - Corrected energy limits in G4CrossSectionIonisationBornPartial.cc
     78            - Added proton case in G4CrossSectionExcitationMillerGreenPartial.cc
     79            - Added protection (waterExcitation.ExcitationEnergy) in G4CrossSectionExcitationMillerGreenPartial.cc
     80
     8119.01.2009, S. Incerti, tag emlowen-V09-02-04
     82            Added angle initialisation in G4DNAScreenedRutherfordElasticModel
     83
     8412.01.2009, S. Incerti, tag emlowen-V09-02-03
     85            Added preliminary migrated Geant4-DNA processes and models.
     86
     8708.01.2009  L. Pandola, tag emlowen-V09-02-02
     88            Edited G4PenelopePhotoElectric.cc and G4PenelopePhotoElectricModel.cc
     89            to suppress a warning message from G4AtomicTransitionManager appearing
     90            for some elements (Oxygen ,Fluorine). This is due to the fact that
     91            Penelope and G4AtomicTransitionManager databases may contain a different number
     92            of shells. Physics results are unchanged.
     93
     9419.12.2008  L. Pandola, tag emlowen-V09-02-01
     95            Added G4RayleighScattering process (G4VEmProcess) to
     96            describe Rayleigh scattering. This was not available within
     97            the Std package
     98
     9915.12.2008  L. Pandola, tag emlowen-V09-02-00
     100            Same as the previous one (emlowen-V09-01-46). I arrived too late.
     101
     10215.12.2008  L. Pandola, tag emlowen-V09-01-46
     103            Added G4PenelopeBremsstrahlungModel, namely bremsstrahlung according to Penelope
     104            model, migrated to the Std-design (inheriting from G4VEmModel). A few minor
     105            cleaning of G4PenelopeBremsstrahlungContinuous.cc and G4PenelopeIonisation.cc.
     106            From this tag, ALL Penelope processes have been migrated.
     107
     10812.12.2008   S. Incerti, tag emlowen-V09-01-45
     109             Upgrade to G4LogLogInterpolation_revision1c.cc
     110
     11109.12.2008  S. Incerti, tag emlowen-V09-01-44
     112            Added protection to G4FinalStateElasticChampion.cc for angular treatment of XS
     113            at 180*deg
     114
     11509.12.2008   S. Incerti, tag emlowen-V09-01-43
     116             Contains G4PenelopeBremsstrahlungContinuous.hh/.cc from Luciano
     117             Contains G4LogLogInterpolation_revision1b.cc
     118
     11909.12.2008   S. Incerti, tag emlowen-V09-01-42
     120             Upgrade to G4LogLogInterpolation_revision1b.cc
     121
     12209.12.2008   S. Incerti, tag emlowen-V09-01-41
     123             Return to original G4LogLogInterpolation.cc/.hh class
     124             from tag emlowen-V09-01-20
     125
     12608.12.2008   S. Incerti, tag emlowen-V09-01-40
     127             Added protection in G4LogLogInterpolation.cc class
     128             against null energy and cross section values
     129
     13006.12.2008   S. Incerti, tag emlowen-V09-01-39
     131             Added vector initialization and EOF protection in G4FinalStateElasticChampion.cc
     132             Added EOF protection in G4FinalStateIonisationBorn.cc
     133
     13406.12.2008   S. Incerti, tag emlowen-V09-01-38
     135             Updated G4LogLogInterpolation class (hh and cc) provided by
     136             Nicolas Karakatsanis (updated revision 1)
     137
     13805.12.2008   S. Incerti, tag emlowen-V09-01-37
     139             Updated G4LogLogInterpolation class (hh and cc) provided by
     140             Nicolas Karakatsanis (revision 1)
     141
     14205.12.2008   S. Incerti, tag emlowen-V09-01-36
     143             Updated low energy limits of Geant4-DNA e- models (Brenner-Zaider and Champion's
     144             elastic scattering and Emfietzoglou's excitation)
     145
     14605.12.2008   S. Incerti, tag emlowen-V09-01-35
     147             Added protection in G4FinalStateIonisationBorn.cc causing run-time error (valgrind with test20)
     148
     14904.12.2008   L. Pandola, tag emlowen-V09-01-34
     150             Correction for G4PenelopeComptonModel: now the cross section table
     151             calculated by the model corresponds to the original FORTRAN-Penelope.
     152             The difference was only for compounds materials and below 1 keV, so
     153             irrelevant for virtually all applications.
     154             First inclusion of G4PenelopeIonisationModel.
     155
     15624.11.2008   G. Cosmo, tag emlowen-V09-01-33
     157             Fixed compilation errors on gcc-4.3.2:
     158             o added required names for struct types (and using G4 prefix);
     159             o correctly initialise cached iterators (cannot be an integer!).
     160
     16121.11.2008   A. Lechner, tag emlowen-V09-01-32
     162             added and tagged new stopping power model for ions, which by default
     163             uses ICRU 73 data tables. Following files are concerned:
     164             G4IonParametrisedLossModel.hh
     165             G4IonParametrisedLossModel.icc
     166             G4IonParametrisedLossModel.cc
     167             G4IonParametrisedLossTable.hh
     168             G4IonParametrisedLossTable.icc
     169
     17006.11.2008   S. Incerti, tag emlowen-V09-01-31
     171             corrected bug in computation of diff cross section maximum in
     172             G4FinalStateElasticBrennerZaider.cc
     173
     17430.10.2008   S. Incerti, tag emlowen-V09-01-30
     175             added & tagged new photon models compatible with standard EM design :
     176             
     177             -- Penelope models are provided by L. Pandola :
     178             G4PenelopeComptonModel.hh and .cc
     179             G4PenelopeGammaConversionModel.hh and .cc
     180             G4PenelopePhotoElectricModel.hh and .cc
     181             G4PenelopeRayleighModel.hh and .cc
     182             
     183             -- Livermore models are provided by S. Incerti :
     184             G4LivermoreComptonModel.hh and .cc
     185             G4LivermoreGammaConversionModel.hh and .cc
     186             G4LivermorePhotoElectricModel.hh and .cc
     187             G4LivermorePolarizedComptonModel.hh and .cc
     188             G4LivermorePolarizedRayleighModel.hh and .cc
     189             G4LivermoreRayleighModel.hh and .cc
     190
     19129.10.2008   S. Incerti, tag emlowen-V09-01-29
     192             - improved generation of scattering angle in G4FinalStateElasticChampion.cc
     193
     19430.09.2008   S. Incerti, tag emlowen-V09-01-28
     195             - removed G4cout in G4LowEnergyCompton.cc (bug report #1026)
     196
     19720.08.2008   S. Incerti, tag emlowen-V09-01-27
     198             - added KillParticle in G4FinalStateElasticChampion.cc below low energy limit
     199             - modified condition on low energy limit in G4CrossSectionElasticChampion.cc and G4FinalStateElasticChampion.cc
     200 
     20120.08.2008   S. Incerti, tag emlowen-V09-01-26
     202             - removed AddEnergyDeposit below low energy limit in G4FinalStateElasticBrennerZaider.cc (bug, thanks to Marion Bug)
     203             - removed AddEnergyDeposit below low energy limit in G4FinalStateExcitationEmfietzoglou.cc (idem)
     204             - removed AddEnergyDeposit below low energy limit in G4FinalStateIonisationRudd.cc (idem)
     205             - decreased low energy limit for e- to 12.61 eV in G4CrossSectionIonisationBorn.cc (from sigma_ionisation_e_born.dat table in $G4LEDATA/dna) instead of 25 eV
     206             - decreased low energy limit for e- to 12.61 eV in G4FinalStateIonisationBorn.cc (from sigma_ionisation_e_born.dat table in $G4LEDATA/dna) instead of 25 eV
     207
     20816.07.2008   S. Incerti, tag emlowen-V09-01-25
     209             added preliminary process for positronium production
     210             from C. Champion's model
     211             G4CrossSectionPsCreationChampion.hh and .cc
     212             G4CrossSectionPsCreationChampionPartial.hh and .cc
     213             G4FinalStatePsCreationChampion.hh and .cc
     214             and updated G4DNAGenericIonsManager.cc
     215             *** Will work only from version 6.2 of G4EMLOW data
     216
     21715.07.2008   S. Incerti, tag emlowen-V09-01-24
     218             added new elastic scattering process for electrons
     219             (Geant4 DNA) from C. Champion's model
     220             G4CrossSectionElasticChampion.hh and .cc
     221             G4FinalStateElasticChampion.hh and .cc
     222             *** Will work only from version 6.2 of G4EMLOW data
     223
     22414.07.2008   S. Incerti, tag emlowen-V09-01-23
     225             cleaned and updated energy limits of the following
     226             25 files (Geant4 DNA)
     227
     228-G4CrossSectionChargeDecrease.hh and .cc
     229-G4CrossSectionChargeDecreasePartial.hh and .cc
     230-G4CrossSectionChargeIncrease.hh and .cc
     231-G4CrossSectionChargeIncreasePartial.hh and .cc
     232-G4CrossSectionElasticScreenedRutherfordHE.hh and .cc
     233-G4CrossSectionElasticScreenedRutherfordLE.hh and .cc
     234-G4CrossSectionExcitationBorn.hh and .cc
     235-G4CrossSectionExcitationBornPartial.hh and .cc
     236-G4CrossSectionExcitationEmfietzoglou.hh and .cc
     237-G4CrossSectionExcitationEmfietzoglouPartial.hh and .cc
     238-G4CrossSectionExcitationMillerGreen.hh and .cc
     239-G4CrossSectionExcitationMillerGreenPartial.hh and .cc
     240-G4CrossSectionIonisationBorn.hh and .cc
     241-G4CrossSectionIonisationBornPartial.hh and .cc
     242-G4CrossSectionIonisationRudd.hh and .cc
     243-G4CrossSectionIonisationRuddPartial.hh and .cc
     244-G4FinalStateChargeDecrease.hh and .cc
     245-G4FinalStateChargeIncrease.hh and .cc
     246-G4FinalStateElasticBrennerZaider.hh and .cc
     247-G4FinalStateElasticScreenedRutherford.hh and .cc
     248-G4FinalStateExcitationBorn.hh and .cc
     249-G4FinalStateExcitationEmfietzoglou.hh and .cc
     250-G4FinalStateExcitationMillerGreen.hh and .cc
     251-G4FinalStateIonisationBorn.hh and .cc
     252-G4FinalStateIonisationRudd.hh and .cc
     253
     25430.06.2008   S. Incerti, tag emlowen-V09-01-22
     255             corrected wrong upper energy limit for :
     256             - hydrogen in G4CrossSectionIonisationRudd
     257             - proton in G4ChargeDecrease
     258
     25927.06.2008   S. Incerti, tag emlowen-V09-01-21
     260             - added two new classes for electron elastic scattering
     261             G4CrossSectionElasticScreenedRutherfordLE.cc and .hh below 200 eV
     262             G4CrossSectionElasticScreenedRutherfordHE.cc and .hh above 200 eV
     263             that should replace the G4CrossSectionElasticScreenedRutherfordHE class
     264             - raised lower energy limit of G4CrossSectionExcitationEmfietzoglou.cc up to 10 eV
     265
     26627.06.2008   S. Incerti, tag emlowen-VO9-01-20
     267             - added protection against negative log argument in G4LogLogInterpolation.cc
     268             - added protection against energies above 200 eV in G4FinalStateElasticBrennerZaider.cc
     269             - removed verbose in G4CrossSectionChargeTransferExp.cc and in G4CrossSectionExcitationBorn.cc
     270
     27126.06.2208   S. Incerti, tag emlowen-V09-01-19
     272             Added protection against FPE in G4hShellCrossSectionDoubleExp.cc
     273
     27420.06.2008   S. Incerti, tag emlowen-V09-01-18
     275             Added 4 protections against FPE in G4hLowEnergyLoss.cc
     276
     27711.06.2008   S. Incerti, tag emlowen-V09-01-17
     278             - added missing & for cosTheta and phi variables in G4FinalStateIonisationRudd.hh and .cc
     279             which were causing wrong angular distributions (bug fix)
     280             - removed annoying PrintData in G4CrossSectionExcitationBornPartial.cc
     281
     28202.06.2008   S. Incerti, tag emlowen-V09-01-16
     283             Removed while(1) statement in G4FinalStateIonisationBorn.cc
     284             fixing compilation warning.
     285             Restored headers for G4PaulKCrossSection, G4OrlicLCrossSection
     286             and G4ecpssrCrossSection which were lost.
     287
     28801.06.2008   F.Lei, tag emlowen-V09-01-15
     289             Correction to the corrupted G4Augerdata.cc, and this tag is on top
     290             of emlowen-V09-01-12! as emlowen-V09-01-13 is internal and incomplete. 
     291 
     29222.05.2008   F.Lei, tag emlowen-V09-01-14
     293             Load the the complete Auger dataset on initialization     
     294
     29506.05.2008   H.Ben Abdelouahed, tag emlowen-V09-01-12, emlowen-V09-01-13
     296             Semi-Empirical model implementation for L-SubShells-Cross-Section
     297             with protons projectiles
     298
     29902.05.2008   MGP, tag emlowen-V09-01-11
     300             Added Doppler broadening in G4LowEnergyComptonPolarized
     301             (Francesco Longo), same model as in G4LowEnergyCompton
     302             Added PIXE cross section, L shells, for protons in
     303             G4OrlicLCrossSection (Haifa Ben Abdelwahed)
     304             Corrected compilation warnings as in message by
     305             G. Cosmo on 29/4/2008
     306
     30724.04.2008   MGP, tag emlowen-V09-01-10
     308             Fix in Doppler broadening of G4LowEnergyCompton
     309             Attempts to fix floating point exceptions in
     310             G4FinalStateElasticBrennerZaider and G4hLowEnergyLoss
     311
     31222.04.2008   H.Ben Abdelouahed, tag emlowen-V09-01-09
     313             ECPSSR model implementation for K-Shell-Cross-Section
     314             with protons and alpha projectiles
     315 
     31618.03.2008   G.Cosmo, tag emlowen-V09-01-08
     317             Fixed compilation error in G4CrossSectionChargeTransferExp.cc
     318             for missing inclusion of <sstream>, detected on SUN-CC.
     319
     32025.03.2008   MGP, tag emlowen-V09-01-07
     321             New charge transfer process by incident protons
     322             (two cross section and one final state policy classes)
     323
     32417.03.2008   MGP, tag emlowen-V09-01-06
     325             Doppler broadening added to G4LowEnergyCompton
     326             based on Y. Namito, S. Ban and H. Hirayama,
     327             NIM A 349, pp. 489-494, 1994
     328
     32910.03.2008   MGP, tag emlowen-V09-01-05
     330             Developments for Doppler broadening concerning data management
     331
     33210.03.2008   MGP, tag emlowen-V09-01-04
     333             Fixes to *DataSet files for better readability of the code
     334             Extensions to G4ShellData to deal with shell data relevant to
     335             Doppler broadening simulation
     336 
     33707.03.2008   MGP, tag emlowen-V09-01-03
     338             Reverted to G4hLowEnergyIonisation.cc and G4hLowEnergyLoss.cc
     339             as in emlowen-V09-01-01
     340
     34107.03.2008   MGP, tag emlowen-V09-01-02
     342             Operation for convenience of configuration management:
     343             updated G4hLowEnergyIonisation.cc and G4hLowEnergyLoss.cc
     344             to the head; the modifications to these two classes
     345             were an attempt to address a PRS report by A. Howard,
     346             but they proved ineffective and caused other problems;
     347             a tag including them is made to facilitate later retrieve
     348
     34906.03.2008   MGP, tag emlowen-V09-01-01
     350             Restored readability of *DataSet* classes regards the
     351             indentation of the code
     352
     35321.02.2008   MGP, tag emlowen-V09-01-00
     354             Bug fix in G4AtomicTransitionManager concerning
     355             total radiative and non radiative probabilities
     356             (fix provided by A. Mantero)
    19357
    2035826.11.2007   MGP, tag emlowen-V09-00-28
  • trunk/source/processes/electromagnetic/lowenergy/include/G4AtomicDeexcitation.hh

    r819 r961  
    2626//
    2727// $Id: G4AtomicTransitionManager.hh,v 1.2 ????
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Authors: Elena Guardincerri (Elena.Guardincerri@ge.infn.it)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4AtomicShell.hh

    r819 r961  
    2626//
    2727// $Id: G4AtomicShell.hh,v 1.2 ????
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Authors: Elena Guardincerri (Elena.Guardincerri@ge.infn.it)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4AtomicTransitionManager.hh

    r819 r961  
    2626//
    2727// $Id: G4AtomicTransitionManager.hh,v 1.2 ????
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Authors: Elena Guardincerri (Elena.Guardincerri@ge.infn.it)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4AugerData.hh

    r819 r961  
    2525//
    2626// $Id: G4AugerData.hh
    27 // GEANT4 tag $Name: $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// Author: Alfonso Mantero (Alfonso.Mantero@ge.infn.it)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4BremsstrahlungParameters.hh

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

    r819 r961  
    2525//
    2626//
    27 // $Id: G4CompositeEMDataSet.hh,v 1.8 2006/06/29 19:33:08 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     27// $Id: G4CompositeEMDataSet.hh,v 1.12 2008/03/17 13:45:25 pia Exp $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
     
    4444// -------------------------------------------------------------------
    4545
    46 #ifndef   G4COMPOSITEEMDATASET_HH
    47  #define G4COMPOSITEEMDATASET_HH 1
     46#ifndef G4COMPOSITEEMDATASET_HH
     47#define G4COMPOSITEEMDATASET_HH 1
    4848
    49  #include "globals.hh"
    50  #include "G4VEMDataSet.hh"
    51  #include <vector>
     49#include "globals.hh"
     50#include "G4VEMDataSet.hh"
     51#include <vector>
    5252
    53  class G4VDataSetAlgorithm;
     53class G4VDataSetAlgorithm;
    5454
    55  class G4CompositeEMDataSet : public G4VEMDataSet
    56  {
    57   public:
    58                                                 G4CompositeEMDataSet(G4VDataSetAlgorithm* argAlgorithm, G4double argUnitEnergies=MeV, G4double argUnitData=barn, G4int argMinZ=1, G4int argMaxZ=99);
    59    virtual                                     ~G4CompositeEMDataSet();
     55class G4CompositeEMDataSet : public G4VEMDataSet
     56{
     57public:
     58  G4CompositeEMDataSet(G4VDataSetAlgorithm* argAlgorithm,
     59                       G4double eUnit=MeV,
     60                       G4double dataUnit=barn,
     61                       G4int zMin=1,
     62                       G4int zMax=99);
     63
     64  virtual ~G4CompositeEMDataSet();
    6065 
    61    virtual G4double                             FindValue(G4double argEnergy, G4int argComponentId=0) const;
     66  virtual G4double FindValue(G4double x, G4int componentId=0) const;
    6267 
    63    virtual void                                PrintData(void) const;
     68  virtual void PrintData(void) const;
    6469
    65    virtual const G4VEMDataSet *                 GetComponent(G4int argComponentId) const { return components[argComponentId]; }
    66    virtual void                                 AddComponent(G4VEMDataSet * argDataSet) { components.push_back(argDataSet); }
    67    virtual size_t                               NumberOfComponents(void) const { return components.size(); }
     70  virtual const G4VEMDataSet* GetComponent(G4int componentId) const { return components[componentId]; }
     71  virtual void AddComponent(G4VEMDataSet* dataSet) { components.push_back(dataSet); }
     72  virtual size_t NumberOfComponents() const { return components.size(); }
    6873
    69    virtual const G4DataVector &                 GetEnergies(G4int argComponentId) const { return GetComponent(argComponentId)->GetEnergies(0); }
    70    virtual const G4DataVector &                 GetData(G4int argComponentId) const { return GetComponent(argComponentId)->GetData(0); }
    71    virtual void                                 SetEnergiesData(G4DataVector * argEnergies, G4DataVector * argData, G4int argComponentId);
     74  virtual const G4DataVector& GetEnergies(G4int componentId) const { return GetComponent(componentId)->GetEnergies(0); }
     75  virtual const G4DataVector& GetData(G4int componentId) const { return GetComponent(componentId)->GetData(0); }
     76  virtual void SetEnergiesData(G4DataVector* x, G4DataVector* data, G4int componentId);
    7277
    73    virtual G4bool                               LoadData(const G4String & argFileName);
    74    virtual G4bool                               SaveData(const G4String & argFileName) const;
     78  virtual G4bool LoadData(const G4String& fileName);
     79  virtual G4bool SaveData(const G4String& fileName) const;
     80
     81 virtual G4double RandomSelect(G4int componentId) const;
     82
    7583   
    76   private:
    77    void                                         CleanUpComponents(void);
     84private:
     85
     86  void CleanUpComponents(void);
    7887 
    79    // Hide copy constructor and assignment operator
    80                                                 G4CompositeEMDataSet();
    81                                                 G4CompositeEMDataSet(const G4CompositeEMDataSet & copy);
    82    G4CompositeEMDataSet &                       operator=(const G4CompositeEMDataSet & right);
     88  // Hide copy constructor and assignment operator
     89  G4CompositeEMDataSet();
     90  G4CompositeEMDataSet(const G4CompositeEMDataSet& copy);
     91  G4CompositeEMDataSet& operator=(const G4CompositeEMDataSet& right);
    8392
    84    std::vector<G4VEMDataSet *>                  components;          // Owned pointers
     93  std::vector<G4VEMDataSet*> components;    // Owned pointers
    8594
    86    G4VDataSetAlgorithm *                        algorithm;           // Owned pointer
     95  G4VDataSetAlgorithm* algorithm;           // Owned pointer
    8796 
    88    G4double                                    unitEnergies;
    89    G4double                                    unitData;
     97  G4double unitEnergies;
     98  G4double unitData;
    9099
    91    G4int                                        minZ;
    92    G4int                                        maxZ;
    93  };
     100  G4int minZ;
     101  G4int maxZ;
     102};
    94103#endif /* G4COMPOSITEEMDATASET_HH */
    95104
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionChargeDecrease.hh

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4CrossSectionChargeDecrease.hh,v 1.1 2007/11/08 18:24:04 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // History:
    33 // -----------
    34 // Date         Name              Modification
    35 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    36 //
    37 // -------------------------------------------------------------------
    38 
    39 // Class description:
    40 // Geant4-DNA Cross total cross section for electron elastic scattering in water
    41 // Reference: TNS Geant4-DNA paper
    42 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    43 // design foundation and implementation of the first set of models,
    44 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    45 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    46 // Further documentation available from http://www.ge.infn.it/geant4/dna
    47 
    48 // -------------------------------------------------------------------
    49 
     26// $Id: G4CrossSectionChargeDecrease.hh,v 1.2 2008/07/14 20:47:32 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5028
    5129#ifndef G4CROSSSECTIONCHARGEDECREASE_HH
    5230#define G4CROSSSECTIONCHARGEDECREASE_HH 1
    5331 
    54 #include "globals.hh"
    55 #include <map>
    5632#include "G4CrossSectionChargeDecreasePartial.hh"
     33#include "G4Track.hh"
     34#include "G4Proton.hh"
     35#include "G4DNAGenericIonsManager.hh"
    5736
    58 class G4Track;
    59  
    6037class G4CrossSectionChargeDecrease
    6138{
     
    6845  G4double CrossSection(const G4Track&);
    6946 
    70   // Copy constructor and assignment operator to be added here
    71    
    7247private:
    7348   
    74   G4String name; 
    7549  G4double lowEnergyLimitDefault;
    7650  G4double highEnergyLimitDefault;
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionChargeDecreasePartial.hh

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4CrossSectionChargeDecreasePartial.hh,v 1.1 2007/11/08 18:24:04 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // History:
    33 // -----------
    34 // Date         Name              Modification
    35 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    36 // 08 Nov 2007  MGP               Got code from S.I.; lowercase data member
    37 //
    38 // -------------------------------------------------------------------
    39 
    40 // Class description:
    41 // Geant4-DNA Cross total cross section for electron elastic scattering in water
    42 // Reference: TNS Geant4-DNA paper
    43 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    44 // design foundation and implementation of the first set of models,
    45 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    46 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    47 // Further documentation available from http://www.ge.infn.it/geant4/dna
    48 
    49 // -------------------------------------------------------------------
    50 
     26// $Id: G4CrossSectionChargeDecreasePartial.hh,v 1.2 2008/07/14 20:47:32 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5128
    5229#ifndef G4CROSSSECTIONCHARGEDECREASEPARTIAL_HH
    5330#define G4CROSSSECTIONCHARGEDECREASEPARTIAL_HH 1
    5431 
    55 #include "globals.hh"
     32#include "G4Proton.hh"
     33#include "G4DNAGenericIonsManager.hh"
     34#include "Randomize.hh"
    5635
    5736class G4ParticleDefinition;
     
    7150  G4int RandomSelect(G4double energy, const G4ParticleDefinition* particle);
    7251 
    73   // Copy constructor and assignment operator to be added here
    74    
    7552private:
    7653   
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionChargeIncrease.hh

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4CrossSectionChargeIncrease.hh,v 1.1 2007/11/08 18:24:04 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // History:
    33 // -----------
    34 // Date         Name              Modification
    35 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    36 //
    37 // -------------------------------------------------------------------
    38 
    39 // Class description:
    40 // Geant4-DNA Cross total cross section for electron elastic scattering in water
    41 // Reference: TNS Geant4-DNA paper
    42 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    43 // design foundation and implementation of the first set of models,
    44 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    45 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    46 // Further documentation available from http://www.ge.infn.it/geant4/dna
    47 
    48 // -------------------------------------------------------------------
    49 
     26// $Id: G4CrossSectionChargeIncrease.hh,v 1.2 2008/07/14 20:47:33 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5028
    5129#ifndef G4CROSSSECTIONCHARGEIncrease_HH
    5230#define G4CROSSSECTIONCHARGEIncrease_HH 1
    5331 
    54 #include "globals.hh"
    55 #include <map>
    5632#include "G4CrossSectionChargeIncreasePartial.hh"
     33#include "G4Track.hh"
     34#include "G4DNAGenericIonsManager.hh"
    5735
    58 class G4Track;
    59  
    6036class G4CrossSectionChargeIncrease
    6137{
     
    6844  G4double CrossSection(const G4Track&);
    6945 
    70   // Copy constructor and assignment operator to be added here
    71    
    7246private:
    7347   
    74   G4String name; 
    7548  G4double lowEnergyLimitDefault;
    7649  G4double highEnergyLimitDefault;
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionChargeIncreasePartial.hh

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4CrossSectionChargeIncreasePartial.hh,v 1.1 2007/11/08 18:24:04 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // History:
    33 // -----------
    34 // Date         Name              Modification
    35 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    36 //
    37 // -------------------------------------------------------------------
    38 
    39 // Class description:
    40 // Geant4-DNA Cross total cross section for electron elastic scattering in water
    41 // Reference: TNS Geant4-DNA paper
    42 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    43 // design foundation and implementation of the first set of models,
    44 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    45 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    46 // Further documentation available from http://www.ge.infn.it/geant4/dna
    47 
    48 // -------------------------------------------------------------------
    49 
     26// $Id: G4CrossSectionChargeIncreasePartial.hh,v 1.2 2008/07/14 20:47:33 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5028
    5129#ifndef G4CROSSSECTIONCHARGEIncreasePARTIAL_HH
    5230#define G4CROSSSECTIONCHARGEIncreasePARTIAL_HH 1
    5331 
    54 #include "globals.hh"
    55 
    56 class G4ParticleDefinition;
     32#include "G4DNAGenericIonsManager.hh"
     33#include "Randomize.hh"
    5734 
    5835class G4CrossSectionChargeIncreasePartial
     
    7047  G4int RandomSelect(G4double energy, const G4ParticleDefinition* particle);
    7148 
    72   // Copy constructor and assignment operator to be added here
    73    
    7449private:
    7550   
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionElasticScreenedRutherford.hh

    r819 r961  
    2626//
    2727// $Id: G4CrossSectionElasticScreenedRutherford.hh,v 1.1 2007/10/12 23:07:10 pia Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionExcitationBorn.hh

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4CrossSectionExcitationBorn.hh,v 1.1 2007/10/15 08:33:25 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // History:
    33 // -----------
    34 // Date         Name              Modification
    35 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    36 //
    37 // -------------------------------------------------------------------
    38 
    39 // Class description:
    40 // Geant4-DNA Cross total cross section for electron elastic scattering in water
    41 // Reference: TNS Geant4-DNA paper
    42 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    43 // design foundation and implementation of the first set of models,
    44 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    45 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    46 // Further documentation available from http://www.ge.infn.it/geant4/dna
    47 
    48 // -------------------------------------------------------------------
    49 
     26// $Id: G4CrossSectionExcitationBorn.hh,v 1.2 2008/07/14 20:47:34 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5028
    5129#ifndef G4CROSSSECTIONEXCITATIONBORN_HH
    5230#define G4CROSSSECTIONEXCITATIONBORN_HH 1
    5331 
    54 #include "globals.hh"
    55 #include <vector>
    56 #include "G4WaterExcitationStructure.hh"
    5732#include "G4DNACrossSectionDataSet.hh"
     33#include "G4Track.hh"
     34#include "G4LogLogInterpolation.hh"
    5835
    59 class G4Track;
    60  
    6136class G4CrossSectionExcitationBorn
    6237{
     
    6944  G4double CrossSection(const G4Track& track);
    7045 
    71   // Copy constructor and assignment operator to be added here
    72    
    7346private:
    7447   
    75   G4String name; 
    7648  G4double lowEnergyLimit;
    7749  G4double highEnergyLimit;
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionExcitationBornPartial.hh

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4CrossSectionExcitationBornPartial.hh,v 1.1 2007/10/15 08:34:12 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // History:
    33 // -----------
    34 // Date         Name              Modification
    35 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    36 //
    37 // -------------------------------------------------------------------
    38 
    39 // Class description:
    40 // Geant4-DNA Cross total cross section for electron elastic scattering in water
    41 // Reference: TNS Geant4-DNA paper
    42 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    43 // design foundation and implementation of the first set of models,
    44 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    45 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    46 // Further documentation available from http://www.ge.infn.it/geant4/dna
    47 
    48 // -------------------------------------------------------------------
    49 
     26// $Id: G4CrossSectionExcitationBornPartial.hh,v 1.2 2008/07/14 20:47:34 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5028
    5129#ifndef G4CROSSSECTIONEXCITATIONBORNPARTIAL_HH
    5230#define G4CROSSSECTIONEXCITATIONBORNPARTIAL_HH 1
    5331 
    54 #include "globals.hh"
    55 #include <vector>
    5632#include "G4DNACrossSectionDataSet.hh"
     33#include "G4LogLogInterpolation.hh"
     34#include "Randomize.hh"
     35#include <deque>
    5736 
    5837class G4CrossSectionExcitationBornPartial
     
    6443  virtual ~G4CrossSectionExcitationBornPartial();
    6544 
    66   // Select an excitation level according to the partial cross sections
    6745  G4int RandomSelect(G4double energy);
    6846 
    69   // Copy constructor and assignment operator to be added here
    70    
    7147private:
    7248   
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionExcitationEmfietzoglou.hh

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4CrossSectionExcitationEmfietzoglou.hh,v 1.2 2007/10/15 08:31:49 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // History:
    33 // -----------
    34 // Date         Name              Modification
    35 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    36 //
    37 // -------------------------------------------------------------------
    38 
    39 // Class description:
    40 // Geant4-DNA Cross total cross section for electron elastic scattering in water
    41 // Reference: TNS Geant4-DNA paper
    42 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    43 // design foundation and implementation of the first set of models,
    44 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    45 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    46 // Further documentation available from http://www.ge.infn.it/geant4/dna
    47 
    48 // -------------------------------------------------------------------
    49 
     26// $Id: G4CrossSectionExcitationEmfietzoglou.hh,v 1.3 2008/07/14 20:47:34 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5028
    5129#ifndef G4CROSSSECTIONEXCITATIONEMFIETZOGLOU_HH
    5230#define G4CROSSSECTIONEXCITATIONEMFIETZOGLOU_HH 1
    5331 
    54 #include "globals.hh"
    5532#include "G4CrossSectionExcitationEmfietzoglouPartial.hh"
     33#include "G4Track.hh"
    5634
    57 class G4Track;
    58  
    5935class G4CrossSectionExcitationEmfietzoglou
    6036{
     
    6743  G4double CrossSection(const G4Track&);
    6844 
    69   // Copy constructor and assignment operator to be added here
    70    
    7145private:
    7246   
    73   G4String name; 
    7447  G4double lowEnergyLimit;
    7548  G4double highEnergyLimit;
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionExcitationEmfietzoglouPartial.hh

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4CrossSectionExcitationEmfietzoglouPartial.hh,v 1.1 2007/10/15 08:33:25 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // History:
    33 // -----------
    34 // Date         Name              Modification
    35 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    36 //
    37 // -------------------------------------------------------------------
    38 
    39 // Class description:
    40 // Geant4-DNA Cross total cross section for electron elastic scattering in water
    41 // Reference: TNS Geant4-DNA paper
    42 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    43 // design foundation and implementation of the first set of models,
    44 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    45 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    46 // Further documentation available from http://www.ge.infn.it/geant4/dna
    47 
    48 // -------------------------------------------------------------------
    49 
     26// $Id: G4CrossSectionExcitationEmfietzoglouPartial.hh,v 1.2 2008/07/14 20:47:34 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5028
    5129#ifndef G4CROSSSECTIONEXCITATIONEMFIETZOGLOUPARTIAL_HH
    5230#define G4CROSSSECTIONEXCITATIONEMFIETZOGLOUPARTIAL_HH 1
    5331 
    54 #include "globals.hh"
    55 #include <vector>
    5632#include "G4WaterExcitationStructure.hh"
     33#include <deque>
     34#include "Randomize.hh"
    5735
    5836class G4Track;
     
    7250  G4int RandomSelect(G4double energy);
    7351 
    74   // Copy constructor and assignment operator to be added here
    75    
    7652private:
    7753   
    78  // Number of excitation levels of the water molecule
    7954  G4int nLevels;
    8055
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionExcitationMillerGreen.hh

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4CrossSectionExcitationMillerGreen.hh,v 1.2 2007/11/08 19:56:02 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // History:
    33 // -----------
    34 // Date         Name              Modification
    35 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    36 //
    37 // -------------------------------------------------------------------
    38 
    39 // Class description:
    40 // Geant4-DNA Cross total cross section for electron elastic scattering in water
    41 // Reference: TNS Geant4-DNA paper
    42 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    43 // design foundation and implementation of the first set of models,
    44 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    45 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    46 // Further documentation available from http://www.ge.infn.it/geant4/dna
    47 
    48 // -------------------------------------------------------------------
    49 
     26// $Id: G4CrossSectionExcitationMillerGreen.hh,v 1.3 2008/07/14 20:47:34 sincerti Exp $
    5027
    5128#ifndef G4CROSSSECTIONEXCITATIONMILLERGREEN_HH
    5229#define G4CROSSSECTIONEXCITATIONMILLERGREEN_HH 1
    5330 
    54 #include "globals.hh"
    55 #include <map>
    5631#include "G4CrossSectionExcitationMillerGreenPartial.hh"
    57 
    58 class G4Track;
     32#include "G4Track.hh"
     33#include "G4Proton.hh"
     34#include "G4CrossSectionExcitationEmfietzoglouPartial.hh"
     35#include "G4DNAGenericIonsManager.hh"
    5936 
    6037class G4CrossSectionExcitationMillerGreen
     
    6845  G4double CrossSection(const G4Track&);
    6946 
    70   // Copy constructor and assignment operator to be added here
    71    
    7247private:
    7348   
    74   G4String name; 
    7549  G4double lowEnergyLimitDefault;
    7650  G4double highEnergyLimitDefault;
     
    8054
    8155  G4CrossSectionExcitationMillerGreenPartial partialCrossSection;
    82 
    8356};
    8457
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionExcitationMillerGreenPartial.hh

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4CrossSectionExcitationMillerGreenPartial.hh,v 1.1 2007/11/08 19:56:02 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // History:
    33 // -----------
    34 // Date         Name              Modification
    35 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    36 //
    37 // -------------------------------------------------------------------
    38 
    39 // Class description:
    40 // Geant4-DNA Cross total cross section for electron elastic scattering in water
    41 // Reference: TNS Geant4-DNA paper
    42 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    43 // design foundation and implementation of the first set of models,
    44 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    45 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    46 // Further documentation available from http://www.ge.infn.it/geant4/dna
    47 
    48 // -------------------------------------------------------------------
    49 
     26// $Id: G4CrossSectionExcitationMillerGreenPartial.hh,v 1.2 2008/07/14 20:47:34 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5028
    5129#ifndef G4CROSSSECTIONEXCITATIONMILLERGREENPARTIAL_HH
    5230#define G4CROSSSECTIONEXCITATIONMILLERGREENPARTIAL_HH 1
    5331 
    54 #include "globals.hh"
    55 #include <vector>
    5632#include "G4WaterExcitationStructure.hh"
    57 #include "G4ParticleDefinition.hh"
     33#include "G4Track.hh"
     34#include "G4Proton.hh"
     35#include "G4DNAGenericIonsManager.hh"
     36#include "G4CrossSectionExcitationEmfietzoglouPartial.hh"
     37#include "Randomize.hh"
    5838
    59 class G4Track;
    60  
    6139class G4CrossSectionExcitationMillerGreenPartial
    6240{
     
    7351  G4int RandomSelect(G4double energy, const G4ParticleDefinition* particle);
    7452 
    75   // Copy constructor and assignment operator to be added here
    76    
    7753private:
    7854   
    79   // Number of excitation levels of the water molecule
    8055  G4int nLevels;
    8156
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionHandler.hh

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

    r819 r961  
    2525//
    2626//
    27 // $Id: G4CrossSectionIonisationBorn.hh,v 1.1 2007/10/22 09:12:58 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // History:
    33 // -----------
    34 // Date         Name              Modification
    35 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    36 //
    37 // -------------------------------------------------------------------
    38 
    39 // Class description:
    40 // Geant4-DNA Cross total cross section for ionisation cross section in water
    41 // Reference: TNS Geant4-DNA paper
    42 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    43 // design foundation and implementation of the first set of models,
    44 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    45 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    46 // Further documentation available from http://www.ge.infn.it/geant4/dna
    47 
    48 // -------------------------------------------------------------------
    49 
     27// $Id: G4CrossSectionIonisationBorn.hh,v 1.3 2008/12/18 13:01:22 gunter Exp $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5029
    5130#ifndef G4CROSSSECTIONIONISATIONBORN_HH
    5231#define G4CROSSSECTIONIONISATIONBORN_HH 1
    5332 
    54 #include "globals.hh"
    55 #include <map>
    5633#include "G4DNACrossSectionDataSet.hh"
     34#include "G4ParticleDefinition.hh"
     35#include "G4Electron.hh"
     36#include "G4Proton.hh"
     37#include "G4Track.hh"
     38#include "G4LogLogInterpolation.hh"
    5739 
    58 class G4Track;
    59 
    6040class G4CrossSectionIonisationBorn
    6141{
     
    6848  G4double CrossSection(const G4Track& track);
    6949                       
    70   // Copy constructor and assignment operator to be added here
    71    
    7250private:
    7351   
    74   G4String name; 
    7552  G4double lowEnergyLimitDefault;
    7653  G4double highEnergyLimitDefault;
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionIonisationBornElectron.hh

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

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4CrossSectionIonisationBornPartial.hh,v 1.1 2007/10/22 09:12:58 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // History:
    33 // -----------
    34 // Date         Name              Modification
    35 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    36 //
    37 // -------------------------------------------------------------------
    38 
    39 // Class description:
    40 // Geant4-DNA Cross total cross section for ionisation cross section in water
    41 // Reference: TNS Geant4-DNA paper
    42 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    43 // design foundation and implementation of the first set of models,
    44 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    45 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    46 // Further documentation available from http://www.ge.infn.it/geant4/dna
    47 
    48 // -------------------------------------------------------------------
    49 
     26// $Id: G4CrossSectionIonisationBornPartial.hh,v 1.2 2008/07/14 20:47:34 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5028
    5129#ifndef G4CROSSSECTIONIONISATIONBORNPARTIAL_HH
    5230#define G4CROSSSECTIONIONISATIONBORNPARTIAL_HH 1
    5331 
    54 #include "globals.hh"
    55 #include <map>
    56 #include <functional>
    5732#include "G4DNACrossSectionDataSet.hh"
     33#include "G4Electron.hh"
     34#include "G4Proton.hh"
     35#include "G4Track.hh"
     36#include "G4LogLogInterpolation.hh"
     37#include "Randomize.hh"
    5838 
    59 class G4Track;
    60 
    6139class G4CrossSectionIonisationBornPartial
    6240{
     
    6745  ~G4CrossSectionIonisationBornPartial();
    6846 
    69   // Partial cross section
    70   // G4double CrossSection(G4double energy, const G4String& particle);
    7147  G4double CrossSection(const G4Track& track);
    7248                       
    73   // Sum of partial cross sections at a given energy value for a particle type
    7449  G4double Sum(G4double energy, const G4String& particle);
    7550
    7651  G4int RandomSelect(G4double energy,const G4String& particle );
    7752 
    78   // Copy constructor and assignment operator to be added here
    79    
    8053private:
    8154   
    82   G4String name; 
    8355  G4double lowEnergyLimitDefault;
    8456  G4double highEnergyLimitDefault;
     
    9365  MapData tableData;
    9466
    95 
    96 
    97   // G4DNACrossSectionDataSet* table;
    98  
    9967};
    10068
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionIonisationBornPartialElectron.hh

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

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4CrossSectionIonisationRudd.hh,v 1.1 2007/11/08 21:35:31 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // History:
    33 // -----------
    34 // Date         Name              Modification
    35 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    36 //
    37 // -------------------------------------------------------------------
    38 
    39 // Class description:
    40 // Geant4-DNA Cross total cross section for ionisation cross section in water
    41 // Reference: TNS Geant4-DNA paper
    42 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    43 // design foundation and implementation of the first set of models,
    44 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    45 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    46 // Further documentation available from http://www.ge.infn.it/geant4/dna
    47 
    48 // -------------------------------------------------------------------
    49 
     26// $Id: G4CrossSectionIonisationRudd.hh,v 1.2 2008/07/14 20:47:34 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5028
    5129#ifndef G4CROSSSECTIONIONISATIONRUDD_HH
    5230#define G4CROSSSECTIONIONISATIONRUDD_HH 1
    5331 
    54 #include "globals.hh"
    55 #include <map>
    5632#include "G4DNACrossSectionDataSet.hh"
     33#include "G4Proton.hh"
     34#include "G4Track.hh"
     35#include "G4LogLogInterpolation.hh"
     36#include "G4DNAGenericIonsManager.hh"
    5737 
    58 class G4Track;
    59 
    6038class G4CrossSectionIonisationRudd
    6139{
     
    6846  G4double CrossSection(const G4Track& track);
    6947                       
    70   // Copy constructor and assignment operator to be added here
    71    
    7248private:
    7349   
    74   G4String name; 
    7550  G4double lowEnergyLimitDefault;
    7651  G4double highEnergyLimitDefault;
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionIonisationRuddPartial.hh

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4CrossSectionIonisationRuddPartial.hh,v 1.1 2007/11/08 21:35:31 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // History:
    33 // -----------
    34 // Date         Name              Modification
    35 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    36 //
    37 // -------------------------------------------------------------------
    38 
    39 // Class description:
    40 // Geant4-DNA Cross total cross section for ionisation cross section in water
    41 // Reference: TNS Geant4-DNA paper
    42 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    43 // design foundation and implementation of the first set of models,
    44 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    45 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    46 // Further documentation available from http://www.ge.infn.it/geant4/dna
    47 
    48 // -------------------------------------------------------------------
    49 
     26// $Id: G4CrossSectionIonisationRuddPartial.hh,v 1.2 2008/07/14 20:47:34 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5028
    5129#ifndef G4CROSSSECTIONIONISATIONRuddPARTIAL_HH
    5230#define G4CROSSSECTIONIONISATIONRuddPARTIAL_HH 1
    5331 
    54 #include "globals.hh"
    55 #include <map>
    56 #include <functional>
    5732#include "G4DNACrossSectionDataSet.hh"
    58  
    59 class G4Track;
     33#include "G4Proton.hh"
     34#include "G4Track.hh"
     35#include "G4LogLogInterpolation.hh"
     36#include "G4DNAGenericIonsManager.hh"
     37#include "Randomize.hh"
    6038
    6139class G4CrossSectionIonisationRuddPartial
     
    6745  ~G4CrossSectionIonisationRuddPartial();
    6846 
    69   // Partial cross section
    70   // G4double CrossSection(G4double energy, const G4String& particle);
    7147  G4double CrossSection(const G4Track& track);
    7248                       
    73   // Sum of partial cross sections at a given energy value for a particle type
    7449  G4double Sum(G4double energy, const G4String& particle);
    7550
    7651  G4int RandomSelect(G4double energy,const G4String& particle );
    7752 
    78   // Copy constructor and assignment operator to be added here
    79    
    8053private:
    8154   
    82   G4String name; 
    8355  G4double lowEnergyLimitDefault;
    8456  G4double highEnergyLimitDefault;
     
    9264  typedef std::map<G4String,G4DNACrossSectionDataSet*,std::less<G4String> > MapData;
    9365  MapData tableData;
    94 
    95 
    96 
    97   // G4DNACrossSectionDataSet* table;
    98  
    9966};
    10067
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionKill.hh

    r819 r961  
    2626//
    2727// $Id: G4CrossSectionKill.hh,v 1.1 2007/11/09 20:26:47 pia Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4DNACrossSectionDataSet.hh

    r819 r961  
    2525//
    2626//
    27 // $Id: G4DNACrossSectionDataSet.hh,v 1.4 2007/10/15 08:31:49 pia Exp $
    28 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     27// $Id: G4DNACrossSectionDataSet.hh,v 1.6 2008/03/17 13:45:25 pia Exp $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Author: Riccardo Capra <capra@ge.infn.it>
     
    4545// -------------------------------------------------------------------
    4646
    47 #ifndef   G4DNACROSSSECTIONDATASET_HH
    48  #define  G4DNACROSSSECTIONDATASET_HH 1
     47#ifndef  G4DNACROSSSECTIONDATASET_HH
     48#define  G4DNACROSSSECTIONDATASET_HH 1
    4949
    50  #include "G4ShellEMDataSet.hh"
     50#include "G4ShellEMDataSet.hh"
    5151
    52  class G4DNACrossSectionDataSet : public G4VEMDataSet
    53  {
    54   public:
    55    G4DNACrossSectionDataSet(G4VDataSetAlgorithm* argAlgorithm,
    56                             G4double argUnitEnergies=MeV,
    57                             G4double argUnitData=barn);
     52class G4DNACrossSectionDataSet : public G4VEMDataSet
     53{
    5854
    59    virtual ~G4DNACrossSectionDataSet();
     55public:
     56  G4DNACrossSectionDataSet(G4VDataSetAlgorithm* algo,
     57                           G4double xUnit=MeV,
     58                           G4double dataUnit=barn);
    6059
    61    virtual G4double FindValue(G4double argEnergy, G4int argComponentId=0) const;
     60  virtual ~G4DNACrossSectionDataSet();
     61
     62  virtual G4double FindValue(G4double e, G4int componentId=0) const;
    6263 
    63    virtual void PrintData(void) const;
     64  virtual void PrintData(void) const;
    6465
    65    virtual const G4VEMDataSet*  GetComponent(G4int argComponentId) const
    66    { return components[argComponentId]; }
     66  virtual const G4VEMDataSet*  GetComponent(G4int componentId) const
     67  { return components[componentId]; }
    6768
    68    virtual void AddComponent(G4VEMDataSet * argDataSet)
    69    { components.push_back(argDataSet); }
    70    virtual size_t NumberOfComponents(void) const
    71    { return components.size(); }
     69  virtual void AddComponent(G4VEMDataSet* dataSet)
     70  { components.push_back(dataSet); }
    7271
    73    virtual const G4DataVector& GetEnergies(G4int argComponentId) const
    74    { return GetComponent(argComponentId)->GetEnergies(0); }
     72  virtual size_t NumberOfComponents(void) const
     73  { return components.size(); }
    7574
    76    virtual const G4DataVector& GetData(G4int argComponentId) const
    77    { return GetComponent(argComponentId)->GetData(0); }
     75  virtual const G4DataVector& GetEnergies(G4int componentId) const
     76  { return GetComponent(componentId)->GetEnergies(0); }
    7877
    79    virtual void SetEnergiesData(G4DataVector* argEnergies, G4DataVector* argData, G4int argComponentId);
     78  virtual const G4DataVector& GetData(G4int componentId) const
     79  { return GetComponent(componentId)->GetData(0); }
    8080
    81    virtual G4bool LoadData(const G4String & argFileName);
    82    virtual G4bool SaveData(const G4String & argFileName) const;
     81  virtual void SetEnergiesData(G4DataVector* x, G4DataVector* values, G4int componentId);
    8382
    84    //   void CleanUpComponents();
     83  virtual G4bool LoadData(const G4String & argFileName);
     84  virtual G4bool SaveData(const G4String & argFileName) const;
     85 
     86  virtual G4double RandomSelect(G4int /*componentId */) const { return -1.; };
     87
     88
     89  //   void CleanUpComponents();
    8590   
    86   private:
     91private:
    8792
    88    G4String FullFileName(const G4String & argFileName) const;
     93  G4String FullFileName(const G4String & argFileName) const;
    8994
    90    // Hide copy constructor and assignment operator
    91    G4DNACrossSectionDataSet();
    92    G4DNACrossSectionDataSet(const G4DNACrossSectionDataSet & copy);
    93    G4DNACrossSectionDataSet& operator=(const G4DNACrossSectionDataSet & right);
     95  // Hide copy constructor and assignment operator
     96  G4DNACrossSectionDataSet();
     97  G4DNACrossSectionDataSet(const G4DNACrossSectionDataSet & copy);
     98  G4DNACrossSectionDataSet& operator=(const G4DNACrossSectionDataSet & right);
    9499
    95    std::vector<G4VEMDataSet*> components;          // Owned pointers
     100  std::vector<G4VEMDataSet*> components;          // Owned pointers
    96101
    97    G4int z;
     102  G4int z;
    98103
    99    G4VDataSetAlgorithm* algorithm;           // Owned pointer
     104  G4VDataSetAlgorithm* algorithm;           // Owned pointer
    100105 
    101    G4double unitEnergies;
    102    G4double unitData;
     106  G4double unitEnergies;
     107  G4double unitData;
    103108
    104    G4double GetUnitEnergies() const { return unitEnergies; }
    105    G4double GetUnitData() const { return unitData; }
    106    const G4VDataSetAlgorithm* GetAlgorithm() const { return algorithm; }
     109  G4double GetUnitEnergies() const { return unitEnergies; }
     110  G4double GetUnitData() const { return unitData; }
     111  const G4VDataSetAlgorithm* GetAlgorithm() const { return algorithm; }
    107112   
    108    void CleanUpComponents(void);
     113  void CleanUpComponents(void);
    109114
    110115
  • trunk/source/processes/electromagnetic/lowenergy/include/G4DNAGenericIonsManager.hh

    r819 r961  
    2626//
    2727// $Id: G4DNAGenericIonsManager.hh,v 1.3 2006/06/29 19:34:16 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929
    3030#ifndef   G4DNAGENERICIONSMANAGER_HH
  • trunk/source/processes/electromagnetic/lowenergy/include/G4DNAProcess.hh

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

    r819 r961  
    2525//
    2626//
    27 // $Id: G4DNAProcess.icc,v 1.11 2007/12/10 16:31:19 gunter Exp $
    28 // GEANT4 tag $Name: $
     27// $Id: G4DNAProcess.icc,v 1.12 2009/01/20 07:50:28 sincerti Exp $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
     
    111111      aParticleChange.ProposeEnergy(0.);
    112112      aParticleChange.ProposeMomentumDirection( 0., 0., 0. );
    113       aParticleChange.ProposeLocalEnergyDeposit(track.GetKineticEnergy() + deposit);
    114        
     113     
     114      if (product.PrimaryParticleIsKilledAndDoNotDepositEnergy())
     115      {
     116        aParticleChange.ProposeLocalEnergyDeposit(deposit);
     117      }
     118      else
     119      {
     120        aParticleChange.ProposeLocalEnergyDeposit(track.GetKineticEnergy() + deposit);
     121      }
     122     
    115123    }
    116124  else
  • trunk/source/processes/electromagnetic/lowenergy/include/G4DummyFinalState.hh

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

    r819 r961  
    2525//
    2626//
    27 // $Id: G4EMDataSet.hh,v 1.7 2006/06/29 19:35:31 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     27// $Id: G4EMDataSet.hh,v 1.12 2008/03/17 13:45:25 pia Exp $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
     
    4545
    4646#ifndef   G4EMDATASET_HH
    47  #define  G4EMDATASET_HH 1
     47#define  G4EMDATASET_HH 1
    4848
    49  #include "globals.hh"
    50  #include "G4VEMDataSet.hh"
     49#include "globals.hh"
     50#include "G4VEMDataSet.hh"
    5151
    52  class G4VDataSetAlgorithm;
     52class G4VDataSetAlgorithm;
    5353
    54  class G4EMDataSet : public G4VEMDataSet
    55  {
    56   public:
    57                                                 G4EMDataSet(G4int argZ, G4VDataSetAlgorithm * argAlgorithm, G4double argUnitEnergies=MeV, G4double argUnitData=barn);
    58                                                 G4EMDataSet(G4int argZ, G4DataVector * argEnergies, G4DataVector * argData, G4VDataSetAlgorithm * argAlgorithm, G4double argUnitEnergues=MeV, G4double argUnitData=barn);
    59    virtual                                     ~G4EMDataSet();
     54class G4EMDataSet : public G4VEMDataSet
     55{
     56public:
     57  G4EMDataSet(G4int argZ,
     58              G4VDataSetAlgorithm* algo,
     59              G4double xUnit=MeV,
     60              G4double yUnit=barn,
     61              G4bool random=false);
     62
     63  G4EMDataSet(G4int argZ,
     64              G4DataVector* xData,
     65              G4DataVector* data,
     66              G4VDataSetAlgorithm* algo,
     67              G4double xUnit=MeV,
     68              G4double yUnit=barn,
     69              G4bool random=false);
     70
     71  virtual ~G4EMDataSet();
    6072 
    61    virtual G4double                             FindValue(G4double argEnergy, G4int argComponentId=0) const;
     73  virtual G4double FindValue(G4double x, G4int componentId=0) const;
    6274 
    63    virtual void                                PrintData(void) const;
     75  virtual void PrintData(void) const;
    6476
    65    virtual const G4VEMDataSet *                 GetComponent(G4int /* argComponentId */) const { return 0; }
    66    virtual void                                 AddComponent(G4VEMDataSet * /* argDataSet */) {}
    67    virtual size_t                               NumberOfComponents(void) const { return 0; }
     77  virtual const G4VEMDataSet* GetComponent(G4int /* componentId */) const { return 0; }
    6878
    69    virtual const G4DataVector &                 GetEnergies(G4int /* argComponentId */) const { return *energies; }
    70    virtual const G4DataVector &                 GetData(G4int /* argComponentId */) const { return *data; }
    71    virtual void                                 SetEnergiesData(G4DataVector * argEnergies, G4DataVector * argData, G4int argComponentId);
     79  virtual void AddComponent(G4VEMDataSet* /* dataSet */) {}
    7280
    73    virtual G4bool                               LoadData(const G4String & argFileName);
    74    virtual G4bool                               SaveData(const G4String & argFileName) const;
    75    
    76   private:
    77    size_t                                       FindLowerBound(G4double argEnergy) const;
    78    
    79    G4String                                     FullFileName(const G4String & argFileName) const;
     81  virtual size_t NumberOfComponents(void) const { return 0; }
    8082
    81    // Hide copy constructor and assignment operator
    82                                                 G4EMDataSet();
    83                                                 G4EMDataSet(const G4EMDataSet & copy);
    84    G4EMDataSet &                                operator=(const G4EMDataSet & right);
     83  virtual const G4DataVector& GetEnergies(G4int /* componentId */) const { return *energies; }
     84  virtual const G4DataVector& GetData(G4int /* componentId */) const { return *data; }
     85  virtual void SetEnergiesData(G4DataVector* xData, G4DataVector* data, G4int componentId);
    8586
    86    G4int                                        z;
     87  virtual G4bool LoadData(const G4String& fileName);
     88  virtual G4bool SaveData(const G4String& fileName) const;
    8789
    88    G4DataVector *                               energies;            // Owned pointer
    89    G4DataVector *                               data;                // Owned pointer
     90  virtual G4double RandomSelect(G4int componentId = 0) const;
     91    
    9092
    91    G4VDataSetAlgorithm *                        algorithm;           // Owned pointer
     93private:
     94
     95  size_t FindLowerBound(G4double energy) const;
     96  size_t FindLowerBound(G4double x, G4DataVector* values) const;
     97
     98  G4double IntegrationFunction(G4double x);
     99
     100  virtual void BuildPdf();
    92101 
    93    G4double                                     unitEnergies;
    94    G4double                                     unitData;
    95  };
     102  G4String FullFileName(const G4String& fileName) const;
     103
     104  // Hide copy constructor and assignment operator
     105  G4EMDataSet();
     106  G4EMDataSet(const G4EMDataSet& copy);
     107  G4EMDataSet& operator=(const G4EMDataSet& right);
     108
     109  G4int z;
     110
     111  G4DataVector* energies;            // Owned pointer
     112  G4DataVector* data;                // Owned pointer
     113
     114  G4VDataSetAlgorithm* algorithm;    // Owned pointer
     115 
     116  G4double unitEnergies;
     117  G4double unitData;
     118
     119  G4DataVector* pdf;
     120  G4bool randomSet;
     121};
    96122#endif /* G4EMDATASET_HH */
  • trunk/source/processes/electromagnetic/lowenergy/include/G4FinalStateChargeDecrease.hh

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4FinalStateChargeDecrease.hh,v 1.1 2007/11/08 18:24:04 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // History:
    33 // -----------
    34 // Date         Name              Modification
    35 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    36 //
    37 // -------------------------------------------------------------------
    38 
    39 // Class description:
    40 // Geant4-DNA Cross total cross section for electron elastic scattering in water
    41 // Reference: TNS Geant4-DNA paper
    42 // Reference: TNS Geant4-DNA paper
    43 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    44 // design foundation and implementation of the first set of models,
    45 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    46 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    47 // Further documentation available from http://www.ge.infn.it/geant4/dna
    48 
    49 // -------------------------------------------------------------------
    50 
     26// $Id: G4FinalStateChargeDecrease.hh,v 1.2 2008/07/14 20:47:34 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5128
    5229#ifndef G4FINALSTATECHARGEDECREASE_HH
    5330#define G4FINALSTATECHARGEDECREASE_HH 1
    5431 
    55 #include "globals.hh"
    5632#include "G4FinalStateProduct.hh"
    57 //#include "G4WaterExcitationStructure.hh"
    5833#include "G4CrossSectionChargeDecreasePartial.hh"
    5934
    60 class G4Track;
    61 class G4Step;
    62 
    63  class G4FinalStateChargeDecrease
    64  {
     35class G4FinalStateChargeDecrease
     36{
    6537 public:
    6638   
     
    7345 private:
    7446   
    75    // Copy constructor and assignment operator to be added here
    76    
    77    G4String name; 
    7847   G4double lowEnergyLimit;
    7948   G4double highEnergyLimit;
     
    8958};
    9059
    91 
    9260#endif
  • trunk/source/processes/electromagnetic/lowenergy/include/G4FinalStateChargeIncrease.hh

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4FinalStateChargeIncrease.hh,v 1.1 2007/11/08 18:24:04 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // History:
    33 // -----------
    34 // Date         Name              Modification
    35 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    36 //
    37 // -------------------------------------------------------------------
    38 
    39 // Class description:
    40 // Geant4-DNA Cross total cross section for electron elastic scattering in water
    41 // Reference: TNS Geant4-DNA paper
    42 // Reference: TNS Geant4-DNA paper
    43 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    44 // design foundation and implementation of the first set of models,
    45 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    46 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    47 // Further documentation available from http://www.ge.infn.it/geant4/dna
    48 
    49 // -------------------------------------------------------------------
    50 
     26// $Id: G4FinalStateChargeIncrease.hh,v 1.2 2008/07/14 20:47:34 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5128
    5229#ifndef G4FINALSTATECHARGEIncrease_HH
    5330#define G4FINALSTATECHARGEIncrease_HH 1
    5431 
    55 #include "globals.hh"
    5632#include "G4FinalStateProduct.hh"
    5733#include "G4CrossSectionChargeIncreasePartial.hh"
     34#include "G4Electron.hh"
     35#include "G4Proton.hh"
    5836
    59 class G4Track;
    60 class G4Step;
    61 
    62  class G4FinalStateChargeIncrease
    63  {
     37class G4FinalStateChargeIncrease
     38{
    6439 public:
    6540   
     
    7247 private:
    7348   
    74    // Copy constructor and assignment operator to be added here
    75    
    76    G4String name; 
    7749   G4double lowEnergyLimit;
    7850   G4double highEnergyLimit;
     
    8961};
    9062
    91 
    9263#endif
  • trunk/source/processes/electromagnetic/lowenergy/include/G4FinalStateElasticBrennerZaider.hh

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4FinalStateElasticBrennerZaider.hh,v 1.1 2007/10/12 23:07:10 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // History:
    33 // -----------
    34 // Date         Name              Modification
    35 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    36 //
    37 // -------------------------------------------------------------------
    38 
    39 // Class description:
    40 // Geant4-DNA Cross total cross section for electron elastic scattering in water
    41 // Reference: TNS Geant4-DNA paper
    42 // Reference: TNS Geant4-DNA paper
    43 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    44 // design foundation and implementation of the first set of models,
    45 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    46 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    47 // Further documentation available from http://www.ge.infn.it/geant4/dna
    48 
    49 // -------------------------------------------------------------------
    50 
     26// $Id: G4FinalStateElasticBrennerZaider.hh,v 1.2 2008/07/14 20:47:34 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5128
    5229#ifndef G4FINALSTATEELASTICBRENNERZAIDER_HH
    5330#define G4FINALSTATEELASTICBRENNERZAIDER_HH 1
    5431 
    55 #include "globals.hh"
    5632#include "G4FinalStateProduct.hh"
     33#include "Randomize.hh"
    5734
    5835class G4Track;
     
    7148 private:
    7249   
    73    // Copy constructor and assignment operator to be added here
    74    
    75    G4String name; 
    7650   G4double lowEnergyLimit;
    7751   G4double highEnergyLimit;
     
    8963 };
    9064
    91 
    9265#endif
  • trunk/source/processes/electromagnetic/lowenergy/include/G4FinalStateElasticScreenedRutherford.hh

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4FinalStateElasticScreenedRutherford.hh,v 1.2 2007/10/12 23:02:55 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // History:
    33 // -----------
    34 // Date         Name              Modification
    35 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    36 //
    37 // -------------------------------------------------------------------
    38 
    39 // Class description:
    40 // Geant4-DNA Cross total cross section for electron elastic scattering in water
    41 // Reference: TNS Geant4-DNA paper
    42 // Reference: TNS Geant4-DNA paper
    43 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    44 // design foundation and implementation of the first set of models,
    45 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    46 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    47 // Further documentation available from http://www.ge.infn.it/geant4/dna
    48 
    49 // -------------------------------------------------------------------
    50 
     26// $Id: G4FinalStateElasticScreenedRutherford.hh,v 1.3 2008/07/14 20:47:34 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5128
    5229#ifndef G4FINALSTATEELASTICSCREENEDRUTHERFORD_HH
    5330#define G4FINALSTATEELASTICSCREENEDRUTHERFORD_HH 1
    5431 
    55 #include "globals.hh"
    5632#include "G4FinalStateProduct.hh"
     33#include "Randomize.hh"
    5734
    5835class G4Track;
     
    7148 private:
    7249   
    73    // Copy constructor and assignment operator to be added here
    74    
    75    G4String name; 
    7650   G4double lowEnergyLimit;
    7751   G4double highEnergyLimit;
     
    8357 };
    8458
    85 
    8659#endif
  • trunk/source/processes/electromagnetic/lowenergy/include/G4FinalStateExcitationBorn.hh

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4FinalStateExcitationBorn.hh,v 1.1 2007/10/15 08:33:25 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // History:
    33 // -----------
    34 // Date         Name              Modification
    35 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    36 //
    37 // -------------------------------------------------------------------
    38 
    39 // Class description:
    40 // Geant4-DNA Cross total cross section for electron elastic scattering in water
    41 // Reference: TNS Geant4-DNA paper
    42 // Reference: TNS Geant4-DNA paper
    43 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    44 // design foundation and implementation of the first set of models,
    45 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    46 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    47 // Further documentation available from http://www.ge.infn.it/geant4/dna
    48 
    49 // -------------------------------------------------------------------
    50 
     26// $Id: G4FinalStateExcitationBorn.hh,v 1.2 2008/07/14 20:47:34 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5128
    5229#ifndef G4FINALSTATEEXCITATIONBORN_HH
    5330#define G4FINALSTATEEXCITATIONBORN_HH 1
    5431 
    55 #include "globals.hh"
    5632#include "G4FinalStateProduct.hh"
    5733#include "G4WaterExcitationStructure.hh"
    5834#include "G4CrossSectionExcitationBornPartial.hh"
    5935
    60 class G4Track;
    61 class G4Step;
    62 
    63  class G4FinalStateExcitationBorn
    64  {
     36class G4FinalStateExcitationBorn
     37{
    6538 public:
    6639   
     
    7245   
    7346 private:
    74    
    75    // Copy constructor and assignment operator to be added here
    76    
    77    G4String name; 
     47
    7848   G4double lowEnergyLimit;
    7949   G4double highEnergyLimit;
     
    8555};
    8656
    87 
    8857#endif
  • trunk/source/processes/electromagnetic/lowenergy/include/G4FinalStateExcitationEmfietzoglou.hh

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4FinalStateExcitationEmfietzoglou.hh,v 1.1 2007/10/15 08:33:25 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // History:
    33 // -----------
    34 // Date         Name              Modification
    35 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    36 //
    37 // -------------------------------------------------------------------
    38 
    39 // Class description:
    40 // Geant4-DNA Cross total cross section for electron elastic scattering in water
    41 // Reference: TNS Geant4-DNA paper
    42 // Reference: TNS Geant4-DNA paper
    43 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    44 // design foundation and implementation of the first set of models,
    45 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    46 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    47 // Further documentation available from http://www.ge.infn.it/geant4/dna
    48 
    49 // -------------------------------------------------------------------
    50 
     26// $Id: G4FinalStateExcitationEmfietzoglou.hh,v 1.2 2008/07/14 20:47:34 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5128
    5229#ifndef G4FINALSTATEEXCITATIONEMFIETZOGLOU_HH
    5330#define G4FINALSTATEEXCITATIONEMFIETZOGLOU_HH 1
    5431 
    55 #include "globals.hh"
    5632#include "G4FinalStateProduct.hh"
    57 #include "G4WaterExcitationStructure.hh"
    5833#include "G4CrossSectionExcitationEmfietzoglouPartial.hh"
    5934
     
    7348 private:
    7449   
    75    // Copy constructor and assignment operator to be added here
    76    
    77    G4String name; 
    7850   G4double lowEnergyLimit;
    7951   G4double highEnergyLimit;
     
    8557};
    8658
    87 
    8859#endif
  • trunk/source/processes/electromagnetic/lowenergy/include/G4FinalStateExcitationMillerGreen.hh

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4FinalStateExcitationMillerGreen.hh,v 1.1 2007/11/08 19:56:02 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // History:
    33 // -----------
    34 // Date         Name              Modification
    35 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    36 //
    37 // -------------------------------------------------------------------
    38 
    39 // Class description:
    40 // Geant4-DNA Cross total cross section for electron elastic scattering in water
    41 // Reference: TNS Geant4-DNA paper
    42 // Reference: TNS Geant4-DNA paper
    43 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    44 // design foundation and implementation of the first set of models,
    45 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    46 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    47 // Further documentation available from http://www.ge.infn.it/geant4/dna
    48 
    49 // -------------------------------------------------------------------
    50 
     26// $Id: G4FinalStateExcitationMillerGreen.hh,v 1.2 2008/07/14 20:47:34 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5128
    5229#ifndef G4FINALSTATEEXCITATIONMILLERGREEN_HH
    5330#define G4FINALSTATEEXCITATIONMILLERGREEN_HH 1
    5431 
    55 #include "globals.hh"
    5632#include "G4FinalStateProduct.hh"
    57 #include "G4WaterExcitationStructure.hh"
    5833#include "G4CrossSectionExcitationMillerGreenPartial.hh"
    5934
    60 class G4Track;
    61 class G4Step;
    62 
    63  class G4FinalStateExcitationMillerGreen
    64  {
     35class G4FinalStateExcitationMillerGreen
     36{
    6537 public:
    6638   
     
    7345 private:
    7446   
    75    // Copy constructor and assignment operator to be added here
    76    
    77    G4String name; 
    7847   G4double lowEnergyLimit;
    7948   G4double highEnergyLimit;
     
    8554};
    8655
    87 
    8856#endif
  • trunk/source/processes/electromagnetic/lowenergy/include/G4FinalStateIonisationBorn.hh

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4FinalStateIonisationBorn.hh,v 1.3 2007/11/13 15:20:19 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // History:
    33 // -----------
    34 // Date         Name              Modification
    35 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    36 //
    37 // -------------------------------------------------------------------
    38 
    39 // Class description:
    40 // Geant4-DNA Cross total cross section for electron elastic scattering in water
    41 // Reference: TNS Geant4-DNA paper
    42 // Reference: TNS Geant4-DNA paper
    43 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    44 // design foundation and implementation of the first set of models,
    45 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    46 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    47 // Further documentation available from http://www.ge.infn.it/geant4/dna
    48 
    49 // -------------------------------------------------------------------
    50 
     26// $Id: G4FinalStateIonisationBorn.hh,v 1.4 2008/07/14 20:47:34 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5128
    5229#ifndef G4FINALSTATEIONISATIONBORN_HH
    5330#define G4FINALSTATEIONISATIONBORN_HH 1
    5431 
    55 #include "globals.hh"
    5632#include "G4FinalStateProduct.hh"
    5733#include "G4WaterIonisationStructure.hh"
     
    6137class G4Step;
    6238
    63  class G4FinalStateIonisationBorn
    64  {
     39class G4FinalStateIonisationBorn
     40{
    6541 public:
    6642   
     
    7147   const G4FinalStateProduct& GenerateFinalState(const G4Track& track, const G4Step& step);
    7248   
    73  private:
     49private:
    7450   
    75    // Copy constructor and assignment operator to be added here
    76    
    77    G4String name; 
    7851   G4double lowEnergyLimitDefault;
    7952   G4double highEnergyLimitDefault;
     
    11285   TriDimensionMap eDiffCrossSectionData[6];
    11386   TriDimensionMap pDiffCrossSectionData[6];
    114    // TriDimensionMap eDiffCrossSectionData;
    115    // TriDimensionMap pDiffCrossSectionData;
    11687   std::vector<double> eTdummyVec;
    11788   std::vector<double> pTdummyVec;
     
    12192   VecMap pVecm;
    12293 
    123    //   std::ifstream eDiffCrossSection;
    124    //   std::ifstream pDiffCrossSection;
    125    
    12694};
    12795
    128 
    12996#endif
  • trunk/source/processes/electromagnetic/lowenergy/include/G4FinalStateIonisationRudd.hh

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4FinalStateIonisationRudd.hh,v 1.2 2007/11/09 16:30:56 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // History:
    33 // -----------
    34 // Date         Name              Modification
    35 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    36 //
    37 // -------------------------------------------------------------------
    38 
    39 // Class description:
    40 // Geant4-DNA Cross total cross section for electron elastic scattering in water
    41 // Reference: TNS Geant4-DNA paper
    42 // Reference: TNS Geant4-DNA paper
    43 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    44 // design foundation and implementation of the first set of models,
    45 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    46 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    47 // Further documentation available from http://www.ge.infn.it/geant4/dna
    48 
    49 // -------------------------------------------------------------------
     26// $Id: G4FinalStateIonisationRudd.hh,v 1.4 2008/07/14 20:47:34 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5028
    5129
     
    5331#define G4FINALSTATEIONISATIONRUDD_HH 1
    5432 
    55 #include "globals.hh"
    5633#include "G4FinalStateProduct.hh"
    5734#include "G4WaterIonisationStructure.hh"
    5835#include "G4CrossSectionIonisationRuddPartial.hh"
    59 
    60 class G4Track;
    61 class G4Step;
    62 class G4ParticleDefinition;
     36#include "G4Electron.hh"
     37#include "G4Proton.hh"
    6338
    6439class G4FinalStateIonisationRudd
     
    7449private:
    7550   
    76   // Copy constructor and assignment operator to be added here
    77    
    78   G4String name; 
    7951  G4double lowEnergyLimitDefault;
    8052  G4double highEnergyLimitDefault;
     
    9567                                         G4double incomingParticleEnergy,
    9668                                         G4double outgoingParticleEnergy,
    97                                          G4double cosTheta,
    98                                          G4double phi);
     69                                         G4double & cosTheta,
     70                                         G4double & phi);
    9971   
    10072  G4double  DifferentialCrossSection(G4ParticleDefinition* particleDefinition,
     
    130102};
    131103
    132 
    133104#endif
  • trunk/source/processes/electromagnetic/lowenergy/include/G4FinalStateKill.hh

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

    r819 r961  
    2525//
    2626//
    27 // $Id: G4FinalStateProduct.hh,v 1.4 2007/10/15 08:31:49 pia Exp $
    28 // GEANT4 tag $Name: $
     27// $Id: G4FinalStateProduct.hh,v 1.5 2009/01/20 07:50:28 sincerti Exp $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
     
    7272  void ModifyPrimaryParticle(const G4ThreeVector& direction, G4double energy);
    7373 
     74  void DoNotDepositEnergy();
    7475  void KillPrimaryParticle();
    75  
     76
    7677  G4bool PrimaryParticleIsKilled() const { return killStatus; }
     78 
     79  G4bool PrimaryParticleIsKilledAndDoNotDepositEnergy() const { return doNotDepositStatus; }
    7780 
    7881  G4bool PrimaryParticleIsModified() const { return isModified; }
     
    9699 
    97100  G4bool killStatus;
     101  G4bool doNotDepositStatus;
    98102  G4bool isModified;
    99103  G4double localEnergyDeposit;
  • trunk/source/processes/electromagnetic/lowenergy/include/G4FluoTransition.hh

    r819 r961  
    2626//
    2727// $Id: G4FluoTransition.hh,v 1.2 ????
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Author: Elena Guardincerri (Elena.Guardincerri@ge.infn.it)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4LinInterpolation.hh

    r819 r961  
    2626//
    2727// $Id: G4LinInterpolation.hh,v 1.3 2006/06/29 19:35:45 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4LogLogInterpolation.hh

    r819 r961  
    2525//
    2626//
    27 // $Id: G4LogLogInterpolation.hh,v 1.4 2006/06/29 19:35:51 gunter Exp $
    28 // GEANT4 tag $Name: $
     27// $Id: G4LogLogInterpolation.hh,v 1.6 2008/12/09 13:28:02 sincerti Exp $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4LowEnergyBremsstrahlung.hh

    r819 r961  
    2727// -------------------------------------------------------------------
    2828// $Id: G4LowEnergyBremsstrahlung.hh,v 1.37 2006/06/29 19:35:55 gunter Exp $
    29 // GEANT4 tag $Name: $
     29// GEANT4 tag $Name: geant4-09-02-ref-02 $
    3030//
    3131// Author: A. Forti
  • trunk/source/processes/electromagnetic/lowenergy/include/G4LowEnergyCompton.hh

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4LowEnergyCompton.hh,v 1.21 2006/06/29 19:35:57 gunter Exp $
    27 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     26// $Id: G4LowEnergyCompton.hh,v 1.24 2008/11/04 10:14:00 pandola Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// Author: A. Forti
     
    4848#include "globals.hh"
    4949#include "G4VDiscreteProcess.hh"
     50#include "G4ShellData.hh"
     51#include "G4DopplerProfile.hh"
    5052
    5153class G4Track;
     
    6769  G4bool IsApplicable(const G4ParticleDefinition& definition);
    6870 
    69   void BuildPhysicsTable(const G4ParticleDefinition& photon);
     71  void BuildPhysicsTable(const G4ParticleDefinition& definition);
    7072 
    71   G4VParticleChange* PostStepDoIt(const G4Track& aTrack, const G4Step& aStep);
     73  G4VParticleChange* PostStepDoIt(const G4Track& track, const G4Step& step);
    7274 
    7375  // For testing purpose only
    74   G4double DumpMeanFreePath(const G4Track& aTrack,
     76  G4double DumpMeanFreePath(const G4Track& track,
    7577                            G4double previousStepSize,
    7678                            G4ForceCondition* condition)
    77   { return GetMeanFreePath(aTrack, previousStepSize, condition); }
     79  { return GetMeanFreePath(track, previousStepSize, condition); }
    7880
    7981protected:
    8082
    81   G4double GetMeanFreePath(const G4Track& aTrack,
     83  G4double GetMeanFreePath(const G4Track& track,
    8284                           G4double previousStepSize,
    8385                           G4ForceCondition* condition);
     
    102104  const G4double intrinsicHighEnergyLimit;
    103105
     106  G4ShellData shellData;
     107  G4DopplerProfile profileData;
    104108};
    105109
  • trunk/source/processes/electromagnetic/lowenergy/include/G4LowEnergyGammaConversion.hh

    r819 r961  
    2626//
    2727// $Id: G4LowEnergyGammaConversion.hh,v 1.15 2006/06/29 19:35:59 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Author: A. Forti
  • trunk/source/processes/electromagnetic/lowenergy/include/G4LowEnergyIonisation.hh

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

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

    r819 r961  
    2525//
    2626//
    27 // $Id: G4LowEnergyPolarizedCompton.hh,v 1.9 2006/06/29 19:36:05 gunter Exp $
    28 // GEANT4 tag $Name: $
     27// $Id: G4LowEnergyPolarizedCompton.hh,v 1.10 2008/05/02 13:04:41 flongo Exp $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// ------------------------------------------------------------
     
    5757#include "globals.hh"
    5858#include "G4VDiscreteProcess.hh"
     59
     60// Doppler Broadening
     61
     62#include "G4ShellData.hh"
     63#include "G4DopplerProfile.hh"
     64
    5965
    6066class G4Track;
     
    125131                         G4ThreeVector& polarization0, G4ThreeVector& polarization1);
    126132 
     133  // Doppler Broadening
     134 
     135  G4ShellData shellData;
     136  G4DopplerProfile profileData;
     137
     138
    127139};
    128140
  • trunk/source/processes/electromagnetic/lowenergy/include/G4LowEnergyPolarizedRayleigh.hh

    r819 r961  
    2525//
    2626// $Id: G4LowEnergyPolarizedRayleigh.hh,v 1.5 2006/06/29 19:36:07 gunter Exp $
    27 // GEANT4 tag $Name: $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// --------------------------------------------------------------
  • trunk/source/processes/electromagnetic/lowenergy/include/G4LowEnergyRayleigh.hh

    r819 r961  
    2626//
    2727// $Id: G4LowEnergyRayleigh.hh,v 1.16 2006/06/29 19:36:09 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030//
  • trunk/source/processes/electromagnetic/lowenergy/include/G4PenelopeBremsstrahlung.hh

    r819 r961  
    2727// -------------------------------------------------------------------
    2828// $Id: G4PenelopeBremsstrahlung.hh,v 1.8 2006/06/29 19:36:15 gunter Exp $
    29 // GEANT4 tag $Name: $
     29// GEANT4 tag $Name: geant4-09-02-ref-02 $
    3030//
    3131// Author: L.Pandola
  • trunk/source/processes/electromagnetic/lowenergy/include/G4PenelopeBremsstrahlungAngular.hh

    r819 r961  
    2727// -------------------------------------------------------------------
    2828// $Id: G4PenelopeBremsstrahlungAngular.hh,v 1.3 2006/06/29 19:36:17 gunter Exp $
    29 // GEANT4 tag $Name: $
     29// GEANT4 tag $Name: geant4-09-02-ref-02 $
    3030//
    3131// Author: L.Pandola
  • trunk/source/processes/electromagnetic/lowenergy/include/G4PenelopeBremsstrahlungContinuous.hh

    r819 r961  
    2626//
    2727// -------------------------------------------------------------------
    28 // $Id: G4PenelopeBremsstrahlungContinuous.hh,v 1.3 2006/06/29 19:36:19 gunter Exp $
    29 // GEANT4 tag $Name: $
     28// $Id: G4PenelopeBremsstrahlungContinuous.hh,v 1.4 2008/12/09 15:04:05 pandola Exp $
     29// GEANT4 tag $Name: geant4-09-02-ref-02 $
    3030//
    3131// Author: L.Pandola
     
    3535// 20 Feb 2003  L. Pandola       1st implementation
    3636// 17 Mar 2003  L. Pandola       Added the correction for positrons
     37// 09 Dec 2008  L. Pandola       Cosmetics: say what variables are
     38//
    3739// Class description:
    3840// Calculation of continuous energy loss for Penelope Bremsstrahlung
     
    5456public:
    5557 
    56   G4PenelopeBremsstrahlungContinuous(G4int Zmat,G4double tCut, G4double emin, G4double emax,
    57                                      const G4String partName);
     58  G4PenelopeBremsstrahlungContinuous(G4int Z,G4double energyCut, G4double energyMin,
     59                                     G4double energyMax,
     60                                     const G4String particleName);
    5861  ~G4PenelopeBremsstrahlungContinuous();
    59   G4double CalculateStopping(G4double PrimaryEnergy);
     62  G4double CalculateStopping(G4double energy);
    6063 
    6164private:
    62 
    6365  void PrepareInterpolationTable();
    6466  void LoadFromFile();
     
    7577  G4double ExtendedLogEnergy[NumberofExtendedEGrid];
    7678  G4double p0[NumberofExtendedEGrid][NumberofKPoints];
    77   //G4double Pbcut[NumberofExtendedEGrid]; //serve?
     79  //G4double Pbcut[NumberofExtendedEGrid]; //useful?
    7880};
    7981
  • trunk/source/processes/electromagnetic/lowenergy/include/G4PenelopeCompton.hh

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PenelopeCompton.hh,v 1.10 2006/06/29 19:36:21 gunter Exp $
    27 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     26// $Id: G4PenelopeCompton.hh,v 1.11 2008/03/26 15:30:19 pandola Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// Author: Luciano Pandola
     
    3636// 26 Mar 2003   L.Pandola    Added fluorescence
    3737// 18 Mar 2004   L.Pandola    Use of std::map (code review)
     38// 26 Mar 2008   L.Pandola    Add boolean flag to control atomic de-excitation
    3839//
    3940// -------------------------------------------------------------------
     
    7879  { return GetMeanFreePath(aTrack, previousStepSize, condition); }
    7980
     81  void SetUseAtomicDeexcitation(G4bool value){fUseAtomicDeexcitation = value;};
     82
     83  G4bool GetUseAtomicDeexcitation(){return fUseAtomicDeexcitation;};
     84
    8085protected:
    8186
     
    118123
    119124  std::vector<G4VEMDataSet*> *matCrossSections; //for random choice of atom
     125
    120126  G4double cutForLowEnergySecondaryPhotons;
     127  G4bool fUseAtomicDeexcitation;
    121128};
    122129
  • trunk/source/processes/electromagnetic/lowenergy/include/G4PenelopeGammaConversion.hh

    r819 r961  
    2626//
    2727// $Id: G4PenelopeGammaConversion.hh,v 1.2 2006/06/29 19:36:25 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Author: L. Pandola
  • trunk/source/processes/electromagnetic/lowenergy/include/G4PenelopeIonisation.hh

    r819 r961  
    2626// -------------------------------------------------------------------
    2727// $Id: G4PenelopeIonisation.hh,v 1.5 2006/06/29 19:36:33 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Author: L. Pandola
  • trunk/source/processes/electromagnetic/lowenergy/include/G4PenelopePhotoElectric.hh

    r819 r961  
    2626//
    2727// $Id: G4PenelopePhotoElectric.hh,v 1.4 2006/06/29 19:36:35 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Author: L.Pandola
  • trunk/source/processes/electromagnetic/lowenergy/include/G4PenelopeRayleigh.hh

    r819 r961  
    2626//
    2727// $Id: G4PenelopeRayleigh.hh,v 1.5 2006/06/29 19:36:37 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Author: Luciano Pandola
  • trunk/source/processes/electromagnetic/lowenergy/include/G4RangeNoTest.hh

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

    r819 r961  
    2626//
    2727// $Id: G4RangeTest.hh,v 1.4 2006/06/29 19:36:49 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4SemiLogInterpolation.hh

    r819 r961  
    2626//
    2727// $Id: G4SemiLogInterpolation.hh,v 1.4 2006/06/29 19:36:51 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4ShellData.hh

    r819 r961  
    2525//
    2626//
    27 // $Id: G4ShellData.hh,v 1.5 2007/02/20 16:53:16 mantero Exp $
    28 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     27// $Id: G4ShellData.hh,v 1.7 2008/03/17 13:45:25 pia Exp $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
     
    5555public:
    5656
    57   G4ShellData(G4int minZ = 1, G4int maxZ = 100);
     57  G4ShellData(G4int minZ = 1, G4int maxZ = 100, G4bool isOccupancy = false);
    5858
    5959  ~G4ShellData();
     
    6363  G4int ShellId(G4int Z, G4int shellIndex) const;
    6464
    65   const G4DataVector& ShellIdVector(G4int Z) const;
     65  G4double ShellOccupancyProbability(G4int Z, G4int shellIndex) const;
     66
     67  const std::vector<G4double>& ShellIdVector(G4int Z) const;
    6668
    6769  G4double BindingEnergy(G4int Z, G4int shellIndex) const;
     70
     71  void SetOccupancyData() { occupancyData = true; }
    6872
    6973  void LoadData(const G4String& fileName);
    7074
    7175  void PrintData() const;
     76
     77  // Randomly select a shell based on shell occupancy
     78  G4int SelectRandomShell(G4int Z) const;
    7279
    7380private:
     
    7784  G4ShellData(const G4ShellData&);
    7885
    79    G4int zMin;
     86  const std::vector<G4double>& ShellVector(G4int Z) const;
     87
     88  G4int zMin;
    8089  G4int zMax;
    8190
    82   std::map<G4int,G4DataVector*,std::less<G4int> > idMap;
     91  G4bool occupancyData;
     92
     93  std::map<G4int,std::vector<G4double>*,std::less<G4int> > idMap;
    8394  std::map<G4int,G4DataVector*,std::less<G4int> > bindingMap;
    8495  std::vector<G4int> nShells;
     96  std::map<G4int,std::vector<G4double>*,std::less<G4int> > occupancyPdfMap;
    8597
    8698};
  • trunk/source/processes/electromagnetic/lowenergy/include/G4ShellEMDataSet.hh

    r819 r961  
    2525//
    2626//
    27 // $Id: G4ShellEMDataSet.hh,v 1.9 2007/10/15 08:31:49 pia Exp $
    28 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     27// $Id: G4ShellEMDataSet.hh,v 1.12 2008/03/17 13:45:25 pia Exp $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
     
    3333// -----------
    3434// 31 Jul 2001   MGP        Created
     35//  9 Mar 2008   MGP        Cleaned up unreadable code modified by former developer
     36//                          (Further clean-up needed)
    3537//
    3638// -------------------------------------------------------------------
     
    4446// -------------------------------------------------------------------
    4547
    46 #ifndef   G4SHELLEMDATASET_HH
    47  #define  G4SHELLEMDATASET_HH 1
     48#ifndef  G4SHELLEMDATASET_HH
     49#define  G4SHELLEMDATASET_HH 1
    4850
    49  #include "globals.hh"
    50  #include "G4VEMDataSet.hh"
    51  #include <vector>
     51#include "globals.hh"
     52#include "G4VEMDataSet.hh"
     53#include <vector>
    5254
    53  class G4VDataSetAlgorithm;
     55class G4VDataSetAlgorithm;
    5456
    55  class G4ShellEMDataSet : public G4VEMDataSet
    56  {
    57   public:
    58    G4ShellEMDataSet(G4int argZ, G4VDataSetAlgorithm* argAlgorithm, G4double argUnitEnergies=MeV, G4double argUnitData=barn);
    59    virtual ~G4ShellEMDataSet();
     57class G4ShellEMDataSet : public G4VEMDataSet
     58{
     59public:
     60  G4ShellEMDataSet(G4int Z,
     61                   G4VDataSetAlgorithm* algo,
     62                   G4double eUnit=MeV,
     63                   G4double dataUnit=barn);
     64
     65  virtual ~G4ShellEMDataSet();
    6066 
    61    virtual G4double FindValue(G4double argEnergy, G4int argComponentId=0) const;
     67  virtual G4double FindValue(G4double energy, G4int componentId=0) const;
    6268 
    63    virtual void PrintData(void) const;
     69  virtual void PrintData(void) const;
    6470
    65    virtual const G4VEMDataSet*  GetComponent(G4int argComponentId) const { return components[argComponentId]; }
    66    virtual void AddComponent(G4VEMDataSet * argDataSet) { components.push_back(argDataSet); }
    67    virtual size_t NumberOfComponents(void) const { return components.size(); }
     71  virtual const G4VEMDataSet*  GetComponent(G4int componentId) const { return components[componentId]; }
     72  virtual void AddComponent(G4VEMDataSet* dataSet) { components.push_back(dataSet); }
     73  virtual size_t NumberOfComponents(void) const { return components.size(); }
    6874
    69    virtual const G4DataVector& GetEnergies(G4int argComponentId) const { return GetComponent(argComponentId)->GetEnergies(0); }
    70    virtual const G4DataVector& GetData(G4int argComponentId) const { return GetComponent(argComponentId)->GetData(0); }
    71    virtual void SetEnergiesData(G4DataVector * argEnergies, G4DataVector * argData, G4int argComponentId);
     75  virtual const G4DataVector& GetEnergies(G4int componentId) const { return GetComponent(componentId)->GetEnergies(0); }
     76  virtual const G4DataVector& GetData(G4int componentId) const { return GetComponent(componentId)->GetData(0); }
     77  virtual void SetEnergiesData(G4DataVector* energies, G4DataVector* data, G4int componentId);
    7278
    73    virtual G4bool LoadData(const G4String & argFileName);
    74    virtual G4bool SaveData(const G4String & argFileName) const;
     79  virtual G4bool LoadData(const G4String& fileName);
     80  virtual G4bool SaveData(const G4String& fileName) const;
     81
     82  virtual G4double RandomSelect(G4int /*componentId = 0*/) const { return -1.; };
    7583   
    76  protected:
    77    G4double GetUnitEnergies() const { return unitEnergies; }
    78    G4double GetUnitData() const { return unitData; }
    79    const G4VDataSetAlgorithm* GetAlgorithm() const { return algorithm; }
     84protected:
     85
     86  G4double GetUnitEnergies() const { return unitEnergies; }
     87  G4double GetUnitData() const { return unitData; }
     88  const G4VDataSetAlgorithm* GetAlgorithm() const { return algorithm; }
    8089   
    81    void CleanUpComponents(void);
     90  void CleanUpComponents(void);
    8291
    83  private:
    84    G4String FullFileName(const G4String & argFileName) const;
     92private:
     93
     94  G4String FullFileName(const G4String& fileName) const;
    8595 
    86    // Hide copy constructor and assignment operator
    87    G4ShellEMDataSet();
    88    G4ShellEMDataSet(const G4ShellEMDataSet & copy);
    89    G4ShellEMDataSet& operator=(const G4ShellEMDataSet & right);
     96  // Hide copy constructor and assignment operator
     97  G4ShellEMDataSet();
     98  G4ShellEMDataSet(const G4ShellEMDataSet& copy);
     99  G4ShellEMDataSet& operator=(const G4ShellEMDataSet& right);
    90100
    91    std::vector<G4VEMDataSet*> components;          // Owned pointers
     101  std::vector<G4VEMDataSet*> components;          // Owned pointers
    92102
    93    G4int z;
     103  G4int z;
    94104
    95    G4VDataSetAlgorithm* algorithm;           // Owned pointer
     105  G4VDataSetAlgorithm* algorithm;           // Owned pointer
    96106 
    97    G4double unitEnergies;
    98    G4double unitData;
    99  };
     107  G4double unitEnergies;
     108  G4double unitData;
     109};
    100110#endif /* G4SHELLEMDATASET_HH */
  • trunk/source/processes/electromagnetic/lowenergy/include/G4VCrossSectionHandler.hh

    r819 r961  
    2626//
    2727// $Id: G4VCrossSectionHandler.hh,v 1.14 2006/06/29 19:37:01 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4VDataSetAlgorithm.hh

    r819 r961  
    2626//
    2727// $Id: G4VDataSetAlgorithm.hh,v 1.7 2006/06/29 19:37:07 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4VEMDataSet.hh

    r819 r961  
    2525//
    2626//
    27 // $Id: G4VEMDataSet.hh,v 1.9 2007/10/15 08:31:49 pia Exp $
    28 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     27// $Id: G4VEMDataSet.hh,v 1.12 2008/03/17 13:45:25 pia Exp $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
     
    4444// -------------------------------------------------------------------
    4545
    46 #ifndef   G4VEMDATASET_HH
    47  #define  G4VEMDATASET_HH 1
     46#ifndef  G4VEMDATASET_HH
     47#define  G4VEMDATASET_HH 1
    4848
    49  #include "globals.hh"
    50  #include "G4DataVector.hh"
     49#include "globals.hh"
     50#include "G4DataVector.hh"
    5151
    52  class G4VEMDataSet
    53  {
    54   public:
    55                                                 G4VEMDataSet() { }
    56    virtual                                    ~G4VEMDataSet() { }
     52class G4VEMDataSet
     53{
     54public:
     55  G4VEMDataSet() { }
     56  virtual ~G4VEMDataSet() { }
    5757 
    58    virtual G4double                             FindValue(G4double argEnergy, G4int argComponentId=0) const = 0;
     58  virtual G4double FindValue(G4double x, G4int componentId = 0) const = 0;
    5959 
    60    virtual void                                PrintData(void) const = 0;
     60  virtual void PrintData(void) const = 0;
    6161 
    62    virtual const G4VEMDataSet *                 GetComponent(G4int argComponentId) const = 0;
    63    virtual void                                 AddComponent(G4VEMDataSet * argDataSet) = 0;
    64    virtual size_t                              NumberOfComponents(void) const = 0;
     62  virtual const G4VEMDataSet* GetComponent(G4int componentId) const = 0;
     63  virtual void AddComponent(G4VEMDataSet* dataSet) = 0;
     64  virtual size_t NumberOfComponents(void) const = 0;
    6565 
    66    virtual const G4DataVector &                 GetEnergies(G4int argComponentId) const = 0;
    67    virtual const G4DataVector &                 GetData(G4int argComponentId) const = 0;
    68    virtual void                                 SetEnergiesData(G4DataVector * argEnergies, G4DataVector * argData, G4int argComponent=0) = 0;
     66  virtual const G4DataVector& GetEnergies(G4int componentId) const = 0;
     67  virtual const G4DataVector& GetData(G4int componentId) const = 0;
     68  virtual void SetEnergiesData(G4DataVector* x, G4DataVector* data, G4int component=0) = 0;
    6969 
    70    virtual G4bool                               LoadData(const G4String & argFileName) = 0;
    71    virtual G4bool                               SaveData(const G4String & argFileName) const = 0;
     70  virtual G4bool LoadData(const G4String& fileName) = 0;
     71  virtual G4bool SaveData(const G4String& fileName) const = 0;
     72
     73  virtual G4double RandomSelect(G4int componentId = 0) const = 0;
    7274   
    73   private:
    74    // Hide copy constructor and assignment operator
    75                                                 G4VEMDataSet(const G4VEMDataSet & copy);
    76    G4VEMDataSet &                               operator=(const G4VEMDataSet & right);
    77  };
     75private:
     76  // Hide copy constructor and assignment operator
     77  G4VEMDataSet(const G4VEMDataSet& copy);
     78  G4VEMDataSet& operator=(const G4VEMDataSet& right);
     79};
    7880#endif /* G4VEMDATASET_HH */
  • trunk/source/processes/electromagnetic/lowenergy/include/G4VLowEnergyDiscretePhotonProcess.hh

    r819 r961  
    2525//
    2626// $Id: G4VLowEnergyDiscretePhotonProcess.hh,v 1.4 2006/06/29 19:37:13 gunter Exp $
    27 // GEANT4 tag $Name: $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// --------------------------------------------------------------
  • trunk/source/processes/electromagnetic/lowenergy/include/G4VLowEnergyTestableDiscreteProcess.hh

    r819 r961  
    2626//
    2727// $Id: G4VLowEnergyTestableDiscreteProcess.hh,v 1.3 2006/06/29 19:37:17 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030
  • trunk/source/processes/electromagnetic/lowenergy/include/G4VRangeTest.hh

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

    r819 r961  
    2626//
    2727// $Id: G4VeLowEnergyLoss.hh,v 1.9 2006/06/29 19:37:23 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// 3.4.2000 Veronique Lefebure:
  • trunk/source/processes/electromagnetic/lowenergy/include/G4WaterExcitationStructure.hh

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

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

    r819 r961  
    2525//
    2626// $Id: G4eBremsstrahlungSpectrum.hh,v 1.8 2006/06/29 19:37:33 gunter Exp $
    27 // GEANT4 tag $Name: $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// -------------------------------------------------------------------
  • trunk/source/processes/electromagnetic/lowenergy/include/G4eCrossSectionExcitationEmfietzoglou.hh

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

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

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eIonisationCrossSectionHandler.hh,v 1.6 2006/06/29 19:37:36 gunter Exp $
    27 // GEANT4 tag $Name: $
     26// $Id: G4eIonisationCrossSectionHandler.hh,v 1.7 2009/01/29 08:13:27 pandola Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// -------------------------------------------------------------------
     
    4040// Modified:
    4141// 10 Oct 2001  M.G. Pia        Revision to improve code quality and consistency with design
    42 //
     42// 28 Jan 2009  L.Pandola    Added public method to make a easier migration of
     43//                           G4LowEnergyIonisation to G4LivermoreIonisationModel
    4344// -------------------------------------------------------------------
    4445
     
    7273
    7374  ~G4eIonisationCrossSectionHandler();
     75
     76  G4double GetCrossSectionAboveThresholdForElement(G4double energy,
     77                                                   G4double cutEnergy,
     78                                                   G4int Z);
    7479 
    7580protected:
  • trunk/source/processes/electromagnetic/lowenergy/include/G4eIonisationParameters.hh

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

    r819 r961  
    2525//
    2626// $Id: G4eIonisationSpectrum.hh,v 1.7 2006/06/29 19:37:40 gunter Exp $
    27 // GEANT4 tag $Name: $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// -------------------------------------------------------------------
  • trunk/source/processes/electromagnetic/lowenergy/include/G4eLowEnergyLoss.hh

    r819 r961  
    2626//
    2727// $Id: G4eLowEnergyLoss.hh,v 1.14 2006/06/29 19:37:42 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// -------------------------------------------------------------------
  • trunk/source/processes/electromagnetic/lowenergy/include/G4eLowEnergyLoss.icc

    r819 r961  
    2626//
    2727// $Id: G4eLowEnergyLoss.icc,v 1.8 2006/06/29 19:37:44 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// ---------------------------------------------------------------
  • trunk/source/processes/electromagnetic/lowenergy/include/G4hLowEnergyLoss.hh

    r819 r961  
    2626//
    2727// $Id: G4hLowEnergyLoss.hh,v 1.17 2006/06/29 19:37:58 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// $Id:
  • trunk/source/processes/electromagnetic/lowenergy/include/G4hLowEnergyLoss.icc

    r819 r961  
    2626//
    2727// $Id: G4hLowEnergyLoss.icc,v 1.3 2006/06/29 19:38:00 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// $Id:
  • trunk/source/processes/electromagnetic/lowenergy/include/G4hShellCrossSectionDoubleExp.hh

    r819 r961  
    4545// -------------------------------------------------------------------
    4646// $Id: G4hShellCrossSectionDoubleExp.hh,v 1.3 2006/06/29 19:38:12 gunter Exp $
    47 // GEANT4 tag $Name: $
     47// GEANT4 tag $Name: geant4-09-02-ref-02 $
    4848
    4949#ifndef G4HSHELLCROSSSECTIONDOUBLEEXP_HH
  • trunk/source/processes/electromagnetic/lowenergy/include/G4hShellCrossSectionDoubleExpData.hh

    r819 r961  
    4040// -------------------------------------------------------------------
    4141// $Id: G4hShellCrossSectionDoubleExpData.hh,v 1.3 2006/06/29 19:38:14 gunter Exp $
    42 // GEANT4 tag $Name: $
     42// GEANT4 tag $Name: geant4-09-02-ref-02 $
    4343
    4444#ifndef G4hShellCrossSectionDoubleExpData_HH
  • trunk/source/processes/electromagnetic/lowenergy/include/G4hShellCrossSectionExp.hh

    r819 r961  
    4545// -------------------------------------------------------------------
    4646// $Id: G4hShellCrossSectionExp.hh,v 1.3 2006/06/29 19:38:16 gunter Exp $
    47 // GEANT4 tag $Name: $
     47// GEANT4 tag $Name: geant4-09-02-ref-02 $
    4848
    4949#ifndef G4HSHELLCROSSSECTIONEXP_HH
  • trunk/source/processes/electromagnetic/lowenergy/include/G4hShellCrossSectionExpData.hh

    r819 r961  
    3838// -------------------------------------------------------------------
    3939// $Id: G4hShellCrossSectionExpData.hh,v 1.3 2006/06/29 19:38:18 gunter Exp $
    40 // GEANT4 tag $Name: $
     40// GEANT4 tag $Name: geant4-09-02-ref-02 $
    4141
    4242#ifndef G4hShellCrossSectionExpData_HH
  • trunk/source/processes/electromagnetic/lowenergy/src/G4AtomicDeexcitation.cc

    r819 r961  
    2626//
    2727// $Id: G4AtomicDeexcitation.cc,v 1.11
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Authors: Elena Guardincerri (Elena.Guardincerri@ge.infn.it)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4AtomicShell.cc

    r819 r961  
    2626//
    2727// $Id: G4AtomicShell.cc,v 1.2 ????
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Authors: Elena Guardincerri (Elena.Guardincerri@ge.infn.it)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4AtomicTransitionManager.cc

    r819 r961  
    2626//
    2727// $Id: G4AtomicTransitionManager.cc,v 1.2 ????
    28 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Authors: Elena Guardincerri (Elena.Guardincerri@ge.infn.it)
     
    319319        G4double totalRadTransProb = 0;
    320320       
    321       for (size_t j = 1; j<transProb.size(); j++)
     321        for (size_t j = 0; j<transProb.size(); j++) // AM -- corrected, it was 1
    322322        {
    323323          totalRadTransProb = totalRadTransProb + transProb[j];
     
    361361      G4double totalRadTransProb = 0;
    362362     
    363       for(size_t j = 1; j<transProb.size(); j++)
     363      for(size_t j = 0; j<transProb.size(); j++) // AM -- Corrected, was 1
    364364        {
    365365          totalRadTransProb = totalRadTransProb + transProb[j];
  • trunk/source/processes/electromagnetic/lowenergy/src/G4AugerData.cc

    r819 r961  
    480480
    481481
    482   for (G4int element = 6; element < 101; element++)
     482  for (G4int element = 6; element < 100; element++)
    483483    {
    484       if(nMaterials == 0 || activeZ.contains(element)) {
    485         augerTransitionTable.insert(trans_Table::value_type(element,LoadData(element)));
    486      
    487         G4cout << "G4AugerData for Element no. " << element << " are loaded" << G4endl;
    488       //      PrintData(element);
    489       }   
    490     }
    491  
    492   G4cout << "AugerTransitionTable complete"<< G4endl;
     484      //      if(nMaterials == 0 || activeZ.contains(element)) {
     485      augerTransitionTable.insert(trans_Table::value_type(element,LoadData(element)));
     486      //        G4cout << "G4AugerData for Element no. " << element << " are loaded" << G4endl;
     487      // G4cout << "G4AugerData for Element no. " << element << " are loaded" << G4endl;
     488      G4cout << "AugerTransitionTable complete"<< G4endl;
     489    }
    493490}
    494491
  • trunk/source/processes/electromagnetic/lowenergy/src/G4BremsstrahlungCrossSectionHandler.cc

    r819 r961  
    2525//
    2626// $Id: G4BremsstrahlungCrossSectionHandler.cc,v 1.9 2006/06/29 19:38:42 gunter Exp $
    27 // GEANT4 tag $Name: $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// -------------------------------------------------------------------
  • trunk/source/processes/electromagnetic/lowenergy/src/G4BremsstrahlungParameters.cc

    r819 r961  
    2626//
    2727// $Id: G4BremsstrahlungParameters.cc,v 1.19 2006/06/29 19:38:44 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CompositeEMDataSet.cc

    r819 r961  
    2525//
    2626//
    27 // $Id: G4CompositeEMDataSet.cc,v 1.9 2006/06/29 19:38:46 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     27// $Id: G4CompositeEMDataSet.cc,v 1.13 2008/03/17 13:40:53 pia Exp $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
     
    4242#include <sstream>
    4343
    44                                                 G4CompositeEMDataSet :: G4CompositeEMDataSet(G4VDataSetAlgorithm* argAlgorithm, G4double argUnitEnergies, G4double argUnitData, G4int argMinZ, G4int argMaxZ)
    45 :
    46  algorithm(argAlgorithm),
    47  unitEnergies(argUnitEnergies),
    48  unitData(argUnitData),
    49  minZ(argMinZ),
    50  maxZ(argMaxZ)
     44G4CompositeEMDataSet::G4CompositeEMDataSet(G4VDataSetAlgorithm* argAlgorithm,
     45                                           G4double argUnitEnergies,
     46                                           G4double argUnitData,
     47                                           G4int argMinZ,
     48                                           G4int argMaxZ)
     49  :
     50  algorithm(argAlgorithm),
     51  unitEnergies(argUnitEnergies),
     52  unitData(argUnitData),
     53  minZ(argMinZ),
     54  maxZ(argMaxZ)
    5155{
    52  if (algorithm == 0)
    53   G4Exception("G4CompositeEMDataSet::G4CompositeEMDataSet - interpolation == 0");
     56  if (algorithm == 0)
     57    G4Exception("G4CompositeEMDataSet::G4CompositeEMDataSet - interpolation == 0");
    5458}
    5559
    5660
    5761
    58                                                 G4CompositeEMDataSet :: ~G4CompositeEMDataSet()
     62G4CompositeEMDataSet::~G4CompositeEMDataSet()
    5963{
    60  CleanUpComponents();
     64  CleanUpComponents();
     65  if (algorithm) delete algorithm;
     66}
    6167
    62  if (algorithm)
    63   delete algorithm;
     68
     69G4double G4CompositeEMDataSet::FindValue(G4double argEnergy, G4int argComponentId) const
     70{
     71  const G4VEMDataSet* component(GetComponent(argComponentId));
     72 
     73  if (component) return component->FindValue(argEnergy);
     74
     75  std::ostringstream message;
     76  message << "G4CompositeEMDataSet::FindValue - component " << argComponentId << " not found";
     77 
     78  G4Exception(message.str().c_str());
     79 
     80  return 0.;
     81}
     82
     83void G4CompositeEMDataSet::PrintData(void) const
     84{
     85  const size_t n(NumberOfComponents());
     86
     87  G4cout << "The data set has " << n << " components" << G4endl;
     88  G4cout << G4endl;
     89 
     90  size_t i(0);
     91 
     92  while (i<n)
     93    {
     94      G4cout << "--- Component " << i << " ---" << G4endl;
     95      GetComponent(i)->PrintData();
     96      i++;
     97    }
     98}
     99
     100void G4CompositeEMDataSet::SetEnergiesData(G4DataVector* argEnergies, G4DataVector* argData, G4int argComponentId)
     101{
     102  G4VEMDataSet * component(components[argComponentId]);
     103 
     104  if (component)
     105    {
     106      component->SetEnergiesData(argEnergies, argData, 0);
     107      return;
     108    }
     109
     110  std::ostringstream message;
     111  message << "G4CompositeEMDataSet::SetEnergiesData - component " << argComponentId << " not found";
     112 
     113  G4Exception(message.str().c_str());
     114}
     115
     116G4bool G4CompositeEMDataSet::LoadData(const G4String& argFileName)
     117{
     118  CleanUpComponents();
     119
     120  for (G4int z(minZ); z<maxZ; z++)
     121    {
     122      G4VEMDataSet* component = new G4EMDataSet(z, algorithm->Clone(), unitEnergies, unitData);
     123      if (!component->LoadData(argFileName))
     124        {
     125          delete component;
     126          return false;
     127        }
     128      AddComponent(component);
     129    }
     130  return true;
    64131}
    65132
    66133
    67134
     135G4bool G4CompositeEMDataSet::SaveData(const G4String& argFileName) const
     136{
     137  for (G4int z=minZ; z<maxZ; z++)
     138    {
     139      const G4VEMDataSet* component(GetComponent(z-minZ));
     140 
     141      if (!component)
     142        {
     143          std::ostringstream message;
     144          message << "G4CompositeEMDataSet::SaveData - component " << (z-minZ) << " not found";
     145          G4Exception(message.str().c_str());
     146        }
    68147
     148      if (!component->SaveData(argFileName))
     149        return false;
     150    }
     151 
     152  return true;
     153}
    69154
    70 
    71 G4double                                        G4CompositeEMDataSet :: FindValue(G4double argEnergy, G4int argComponentId) const
     155void G4CompositeEMDataSet::CleanUpComponents(void)
    72156{
    73  const G4VEMDataSet * component(GetComponent(argComponentId));
    74  
    75  if (component)
    76   return component->FindValue(argEnergy);
    77 
    78  std::ostringstream message;
    79  message << "G4CompositeEMDataSet::FindValue - component " << argComponentId << " not found";
    80  
    81  G4Exception(message.str().c_str());
    82  
    83  return 0.;
     157  while (!components.empty())
     158    {
     159      if (components.back())
     160        delete components.back();
     161      components.pop_back();
     162    }
    84163}
    85164
    86165
    87 
    88 
    89 
    90 void                                            G4CompositeEMDataSet :: PrintData(void) const
     166G4double G4CompositeEMDataSet::RandomSelect(G4int componentId) const
    91167{
    92  const size_t n(NumberOfComponents());
    93 
    94  G4cout << "The data set has " << n << " components" << G4endl;
    95  G4cout << G4endl;
    96  
    97  size_t i(0);
    98  
    99  while (i<n)
    100  {
    101   G4cout << "--- Component " << i << " ---" << G4endl;
    102   GetComponent(i)->PrintData();
    103   i++;
    104  }
     168  G4double value = 0.;
     169  if (componentId >= 0 && componentId < (G4int)components.size())
     170    {
     171      const G4VEMDataSet* dataSet = GetComponent(componentId);
     172      value = dataSet->RandomSelect();
     173    }
     174  return value;
    105175}
    106 
    107 
    108 
    109 
    110 
    111 void                                            G4CompositeEMDataSet :: SetEnergiesData(G4DataVector * argEnergies, G4DataVector * argData, G4int argComponentId)
    112 {
    113  G4VEMDataSet * component(components[argComponentId]);
    114  
    115  if (component)
    116  {
    117   component->SetEnergiesData(argEnergies, argData, 0);
    118   return;
    119  }
    120 
    121  std::ostringstream message;
    122  message << "G4CompositeEMDataSet::SetEnergiesData - component " << argComponentId << " not found";
    123  
    124  G4Exception(message.str().c_str());
    125 }
    126 
    127 
    128 
    129 
    130 
    131 G4bool                                          G4CompositeEMDataSet :: LoadData(const G4String & argFileName)
    132 {
    133  CleanUpComponents();
    134 
    135  for (G4int z(minZ); z<maxZ; z++)
    136  {
    137   G4VEMDataSet * component=new G4EMDataSet(z, algorithm->Clone(), unitEnergies, unitData);
    138   if (!component->LoadData(argFileName))
    139   {
    140    delete component;
    141    return false;
    142   }
    143  
    144   AddComponent(component);
    145  }
    146  
    147  return true;
    148 }
    149 
    150 
    151 
    152 G4bool                                          G4CompositeEMDataSet :: SaveData(const G4String & argFileName) const
    153 {
    154  for (G4int z(minZ); z<maxZ; z++)
    155  {
    156   const G4VEMDataSet * component(GetComponent(z-minZ));
    157  
    158   if (!component)
    159   {
    160    std::ostringstream message;
    161    message << "G4CompositeEMDataSet::SaveData - component " << (z-minZ) << " not found";
    162  
    163    G4Exception(message.str().c_str());
    164   }
    165 
    166   if (!component->SaveData(argFileName))
    167    return false;
    168  }
    169  
    170  return true;
    171 }
    172 
    173 
    174 
    175 
    176 
    177 void                                            G4CompositeEMDataSet :: CleanUpComponents(void)
    178 {
    179  while (!components.empty())
    180  {
    181   if (components.back())
    182    delete components.back();
    183 
    184   components.pop_back();
    185  }
    186 }
    187 
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionChargeDecrease.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4CrossSectionChargeDecrease.cc,v 1.2 2007/11/09 20:11:04 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // Reference: TNS Geant4-DNA paper
    33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    34 
    35 // History:
    36 // -----------
    37 // Date         Name              Modification
    38 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    39 //
    40 // -------------------------------------------------------------------
    41 
    42 // Class description:
    43 // Geant4-DNA Cross total cross section for electron elastic scattering in water
    44 // Reference: TNS Geant4-DNA paper
    45 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    46 // design foundation and implementation of the first set of models,
    47 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    48 // Further documentation available from http://www.ge.infn.it/geant4/dna
    49 
    50 // -------------------------------------------------------------------
    51 
     26// $Id: G4CrossSectionChargeDecrease.cc,v 1.4 2008/07/14 20:47:34 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5228
    5329#include "G4CrossSectionChargeDecrease.hh"
    54 #include "G4Track.hh"
    55 #include "G4DynamicParticle.hh"
    56 #include "G4Proton.hh"
    57 #include "G4CrossSectionExcitationEmfietzoglouPartial.hh"
    58 #include "G4DNAGenericIonsManager.hh"
     30
     31//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    5932
    6033G4CrossSectionChargeDecrease::G4CrossSectionChargeDecrease()
    6134{
    62   // Default energy limits (defined for protection against anomalous behaviour only)
    63   name = "ChargeDecrease";
    6435  lowEnergyLimitDefault = 1 * keV;
    6536  highEnergyLimitDefault = 10 * MeV;
     
    7647
    7748  if (protonDef != 0)
    78     {
    79       proton = protonDef->GetParticleName();
    80       lowEnergyLimit[proton] = 1. * keV;
    81       highEnergyLimit[proton] = 10. * keV;
    82     }
     49  {
     50    proton = protonDef->GetParticleName();
     51    lowEnergyLimit[proton] = 1. * keV;
     52    highEnergyLimit[proton] = 10. * MeV;
     53  }
    8354  else
    84     {
    85       G4Exception("G4CrossSectionChargeDecrease Constructor: proton is not defined");
    86     }
     55  {
     56    G4Exception("G4CrossSectionChargeDecrease Constructor: proton is not defined");
     57  }
    8758
    8859  if (alphaPlusPlusDef != 0)
    89     {
    90       alphaPlusPlus = alphaPlusPlusDef->GetParticleName();
    91       lowEnergyLimit[alphaPlusPlus] = 1. * keV;
    92       highEnergyLimit[alphaPlusPlus] = 10. * MeV;
    93     }
     60  {
     61    alphaPlusPlus = alphaPlusPlusDef->GetParticleName();
     62    lowEnergyLimit[alphaPlusPlus] = 1. * keV;
     63    highEnergyLimit[alphaPlusPlus] = 10. * MeV;
     64  }
    9465  else
    95     {
    96       G4Exception("G4CrossSectionChargeDecrease Constructor: alphaPlusPlus is not defined");
    97     }
     66  {
     67    G4Exception("G4CrossSectionChargeDecrease Constructor: alphaPlusPlus is not defined");
     68  }
    9869
    9970  if (alphaPlusDef != 0)
    100     {
    101       alphaPlus = alphaPlusDef->GetParticleName();
    102       lowEnergyLimit[alphaPlus] = 1. * keV;
    103       highEnergyLimit[alphaPlus] = 10. * MeV;
    104     }
     71  {
     72    alphaPlus = alphaPlusDef->GetParticleName();
     73    lowEnergyLimit[alphaPlus] = 1. * keV;
     74    highEnergyLimit[alphaPlus] = 10. * MeV;
     75  }
    10576  else
    106     {
    107       G4Exception("G4CrossSectionChargeDecrease Constructor: alphaPlus is not defined");
    108     }
     77  {
     78    G4Exception("G4CrossSectionChargeDecrease Constructor: alphaPlus is not defined");
     79  }
    10980
    11081}
    11182
     83//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    11284
    11385G4CrossSectionChargeDecrease::~G4CrossSectionChargeDecrease()
    11486{}
    11587 
     88//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    11689
    11790G4double G4CrossSectionChargeDecrease::CrossSection(const G4Track& track)
     
    140113    G4Exception("G4CrossSectionChargeDecrease: attempting to calculate cross section for wrong particle");
    141114
    142   // Retrieve energy limits for the current particle type
    143 
    144115  std::map< G4String,G4double,std::less<G4String> >::iterator pos1;
    145116  pos1 = lowEnergyLimit.find(particleName);
    146117
    147   // Lower limit
    148118  if (pos1 != lowEnergyLimit.end())
    149     {
    150       lowLim = pos1->second;
    151     }
     119  {
     120    lowLim = pos1->second;
     121  }
    152122
    153   // Upper limit
    154123  std::map< G4String,G4double,std::less<G4String> >::iterator pos2;
    155124  pos2 = highEnergyLimit.find(particleName);
    156125
    157126  if (pos2 != highEnergyLimit.end())
    158     {
    159       highLim = pos2->second;
    160     }
    161 
    162   //
     127  {
     128    highLim = pos2->second;
     129  }
    163130
    164131  G4double crossSection(0.);
    165132  if (k >= lowLim && k <= highLim)
    166     {
     133  {
    167134      crossSection = partialCrossSection.Sum(k,particleDefinition);
    168     }
     135  }
    169136 
    170137  return crossSection;
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionChargeDecreasePartial.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4CrossSectionChargeDecreasePartial.cc,v 1.1 2007/11/08 18:25:25 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // Reference: TNS Geant4-DNA paper
    33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    34 
    35 // History:
    36 // -----------
    37 // Date         Name              Modification
    38 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    39 // 08 Nov 2007  MGP               Got code from S.I.; added variable initialisation to avoid compilation warnings
    40 //
    41 // -------------------------------------------------------------------
    42 
    43 // Class description:
    44 // Geant4-DNA Cross total cross section for electron elastic scattering in water
    45 // Reference: TNS Geant4-DNA paper
    46 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    47 // design foundation and implementation of the first set of models,
    48 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    49 // Further documentation available from http://www.ge.infn.it/geant4/dna
    50 
    51 // -------------------------------------------------------------------
    52 
     26// $Id: G4CrossSectionChargeDecreasePartial.cc,v 1.2 2008/07/14 20:47:34 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5328
    5429#include "G4CrossSectionChargeDecreasePartial.hh"
    55 #include "G4ParticleDefinition.hh"
    56 #include "G4Proton.hh"
    57 #include "G4DNAGenericIonsManager.hh"
    58 
    59 #include "Randomize.hh"
    60 
     30
     31//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    6132
    6233G4CrossSectionChargeDecreasePartial::G4CrossSectionChargeDecreasePartial()
     
    11687}
    11788
     89//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     90
    11891G4CrossSectionChargeDecreasePartial::~G4CrossSectionChargeDecreasePartial()
    119 { }
    120  
     92{}
     93 
     94//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     95
    12196G4double G4CrossSectionChargeDecreasePartial::CrossSection(G4double k, G4int index,
    12297                                                           const G4ParticleDefinition* particleDefinition)
     
    149124 
    150125  if (x1[index][particleTypeIndex]<x0[index][particleTypeIndex])
    151     {
     126  {
    152127      //
    153128      // if x1 < x0 means that x1 and b1 will be calculated with the following formula (this piece of code is run on all alphas and not on protons)
     
    163138        + b0[index][particleTypeIndex] - c0[index][particleTypeIndex] * std::pow(x1[index][particleTypeIndex]
    164139                                                                                 - x0[index][particleTypeIndex], d0[index][particleTypeIndex]);
    165     }
     140  }
    166141
    167142  G4double x(std::log10(k/eV));
     
    197172 
    198173  while (i>0)
    199     {
     174  {
    200175      i--;
    201176      values[i]=CrossSection(k, i, particleDefinition);
    202177      value+=values[i];
    203     }
     178  }
    204179 
    205180  value*=G4UniformRand();
     
    207182  i=n;
    208183  while (i>0)
    209     {
     184  {
    210185      i--;
    211186   
     
    214189 
    215190      value-=values[i];
    216     }
     191  }
    217192 
    218193  delete[] values;
     
    220195  return i;
    221196}
     197
     198//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    222199
    223200G4double G4CrossSectionChargeDecreasePartial::Sum(G4double k, const G4ParticleDefinition* particleDefinition)
     
    234211
    235212  for (G4int i=0; i<numberOfPartialCrossSections[particleTypeIndex]; i++)
    236     {
    237       totalCrossSection += CrossSection(k,i,particleDefinition);
    238     }
     213  {
     214    totalCrossSection += CrossSection(k,i,particleDefinition);
     215  }
    239216  return totalCrossSection;
    240217}
    241 
    242 
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionChargeIncrease.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4CrossSectionChargeIncrease.cc,v 1.3 2007/12/10 16:31:21 gunter Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // Reference: TNS Geant4-DNA paper
    33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    34 
    35 // History:
    36 // -----------
    37 // Date         Name              Modification
    38 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    39 //
    40 // -------------------------------------------------------------------
    41 
    42 // Class description:
    43 // Geant4-DNA Cross total cross section for electron elastic scattering in water
    44 // Reference: TNS Geant4-DNA paper
    45 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    46 // design foundation and implementation of the first set of models,
    47 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    48 // Further documentation available from http://www.ge.infn.it/geant4/dna
    49 
    50 // -------------------------------------------------------------------
    51 
     26// $Id: G4CrossSectionChargeIncrease.cc,v 1.4 2008/07/14 20:47:34 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5228
    5329#include "G4CrossSectionChargeIncrease.hh"
    54 #include "G4Track.hh"
    55 #include "G4DynamicParticle.hh"
    56 #include "G4ParticleDefinition.hh"
    57 #include "G4DNAGenericIonsManager.hh"
     30
     31//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    5832
    5933G4CrossSectionChargeIncrease::G4CrossSectionChargeIncrease()
    6034{
    61   // Default energy limits (defined for protection against anomalous behaviour only)
    62   name = "ChargeIncrease";
    6335  lowEnergyLimitDefault = 1 * keV;
    6436  highEnergyLimitDefault = 10 * MeV;
     
    7547
    7648  if (hydrogenDef != 0)
    77     {
    78       hydrogen = hydrogenDef->GetParticleName();
    79       lowEnergyLimit[hydrogen] = 1. * keV;
    80       highEnergyLimit[hydrogen] = 10. * MeV;
    81     }
     49  {
     50    hydrogen = hydrogenDef->GetParticleName();
     51    lowEnergyLimit[hydrogen] = 1. * keV;
     52    highEnergyLimit[hydrogen] = 10. * MeV;
     53  }
    8254  else
    83     {
    84       G4Exception("G4CrossSectionChargeIncrease Constructor: hydrogen is not defined");
    85     }
     55  {
     56    G4Exception("G4CrossSectionChargeIncrease Constructor: hydrogen is not defined");
     57  }
    8658
    8759  if (alphaPlusDef != 0)
    88     {
    89       alphaPlus = alphaPlusDef->GetParticleName();
    90       lowEnergyLimit[alphaPlus] = 1. * keV;
    91       highEnergyLimit[alphaPlus] = 10. * MeV;
    92     }
     60  {
     61    alphaPlus = alphaPlusDef->GetParticleName();
     62    lowEnergyLimit[alphaPlus] = 1. * keV;
     63    highEnergyLimit[alphaPlus] = 10. * MeV;
     64  }
    9365  else
    94     {
    95       G4Exception("G4CrossSectionChargeIncrease Constructor: alphaPlus is not defined");
    96     }
     66  {
     67    G4Exception("G4CrossSectionChargeIncrease Constructor: alphaPlus is not defined");
     68  }
    9769
    9870  if (heliumDef != 0)
    99     {
    100       helium = heliumDef->GetParticleName();
    101       lowEnergyLimit[helium] = 1. * keV;
    102       highEnergyLimit[helium] = 10. * MeV;
    103     }
     71  {
     72    helium = heliumDef->GetParticleName();
     73    lowEnergyLimit[helium] = 1. * keV;
     74    highEnergyLimit[helium] = 10. * MeV;
     75  }
    10476  else
    105     {
    106       G4Exception("G4CrossSectionChargeIncrease Constructor: helium is not defined");
    107     }
     77  {
     78    G4Exception("G4CrossSectionChargeIncrease Constructor: helium is not defined");
     79  }
    10880
    10981}
    11082
     83//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    11184
    11285G4CrossSectionChargeIncrease::~G4CrossSectionChargeIncrease()
    11386{}
    11487 
     88//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    11589
    11690G4double G4CrossSectionChargeIncrease::CrossSection(const G4Track& track)
     
    139113    G4Exception("G4CrossSectionChargeIncrease: attempting to calculate cross section for wrong particle");
    140114
    141 
    142   // Retrieve energy limits for the current particle type
    143 
    144115  std::map< G4String,G4double,std::less<G4String> >::iterator pos1;
    145116  pos1 = lowEnergyLimit.find(particleName);
    146117
    147   // Lower limit
    148118  if (pos1 != lowEnergyLimit.end())
    149     {
    150       lowLim = pos1->second;
    151     }
     119  {
     120    lowLim = pos1->second;
     121  }
    152122
    153   // Upper limit
    154123  std::map< G4String,G4double,std::less<G4String> >::iterator pos2;
    155124  pos2 = highEnergyLimit.find(particleName);
    156125
    157126  if (pos2 != highEnergyLimit.end())
    158     {
    159       highLim = pos2->second;
    160     }
     127  {
     128    highLim = pos2->second;
     129  }
    161130
    162131  G4double totalCrossSection = 0.;
    163132
    164133  if (k >= lowLim && k <= highLim)
    165     {
     134  {
    166135      //HYDROGEN
    167136      if (particleDefinition == instance->GetIon("hydrogen"))
    168         {
     137      {
    169138          const  G4double aa = 2.835;
    170139          const  G4double bb = 0.310;
     
    180149          G4double sigmah = temp * (aa * std::log(1.0 + x) + bb) / x;
    181150          totalCrossSection = 1.0/(1.0/sigmal + 1.0/sigmah) *m*m;
    182         }
     151      }
    183152      else
    184         {
     153      {
    185154          totalCrossSection = partialCrossSection.Sum(k,particleDefinition);
    186         }
    187     }
     155      }
     156  }
    188157 
    189158  return totalCrossSection;
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionChargeIncreasePartial.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4CrossSectionChargeIncreasePartial.cc,v 1.1 2007/11/08 18:25:25 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // Reference: TNS Geant4-DNA paper
    33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    34 
    35 // History:
    36 // -----------
    37 // Date         Name              Modification
    38 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    39 //
    40 // -------------------------------------------------------------------
    41 
    42 // Class description:
    43 // Geant4-DNA Cross total cross section for electron elastic scattering in water
    44 // Reference: TNS Geant4-DNA paper
    45 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    46 // design foundation and implementation of the first set of models,
    47 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    48 // Further documentation available from http://www.ge.infn.it/geant4/dna
    49 
    50 // -------------------------------------------------------------------
    51 
     26// $Id: G4CrossSectionChargeIncreasePartial.cc,v 1.2 2008/07/14 20:47:34 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5228
    5329#include "G4CrossSectionChargeIncreasePartial.hh"
    54 #include "G4DynamicParticle.hh"
    55 #include "G4ParticleDefinition.hh"
    56 #include "G4Proton.hh"
    57 #include "G4DNAGenericIonsManager.hh"
    58 
    59 #include "Randomize.hh"
     30
     31//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    6032
    6133G4CrossSectionChargeIncreasePartial::G4CrossSectionChargeIncreasePartial()
    6234{
    63 
    6435  //ALPHA+
     36
    6537  f0[0][0]=1.;
    6638  a0[0][0]=2.25;
     
    10173
    10274  numberOfPartialCrossSections[1]=2;
    103 
    104 }
     75}
     76
     77//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    10578
    10679G4CrossSectionChargeIncreasePartial::~G4CrossSectionChargeIncreasePartial()
    107 { }
     80{}
    10881 
     82//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     83
    10984G4double G4CrossSectionChargeIncreasePartial::CrossSection(G4double k, G4int index,
    11085                                                           const G4ParticleDefinition* particleDefinition)
     
    137112 
    138113  if (x1[index][particleTypeIndex]<x0[index][particleTypeIndex])
    139     {
     114  {
    140115      //
    141116      // if x1 < x0 means that x1 and b1 will be calculated with the following formula (this piece of code is run on all alphas and not on protons)
     
    148123      x1[index][particleTypeIndex]=x0[index][particleTypeIndex] + std::pow((a0[index][particleTypeIndex] - a1[index][particleTypeIndex]) / (c0[index][particleTypeIndex] * d0[index][particleTypeIndex]), 1. / (d0[index][particleTypeIndex] - 1.));
    149124      b1[index][particleTypeIndex]=(a0[index][particleTypeIndex] - a1[index][particleTypeIndex]) * x1[index][particleTypeIndex] + b0[index][particleTypeIndex] - c0[index][particleTypeIndex] * std::pow(x1[index][particleTypeIndex] - x0[index][particleTypeIndex], d0[index][particleTypeIndex]);
    150     }
     125  }
    151126
    152127  G4double x(std::log10(k/eV));
     
    161136
    162137  return f0[index][particleTypeIndex] * std::pow(10., y)*m*m;
    163 
    164  
    165 }
     138 
     139}
     140
     141//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    166142
    167143G4int G4CrossSectionChargeIncreasePartial::RandomSelect(G4double k,
     
    183159 
    184160  while (i>0)
    185     {
     161  {
    186162      i--;
    187163      values[i]=CrossSection(k, i, particleDefinition);
    188164      value+=values[i];
    189     }
     165  }
    190166 
    191167  value*=G4UniformRand();
     
    193169  i=n;
    194170  while (i>0)
    195     {
     171  {
    196172      i--;
    197173   
     
    200176 
    201177      value-=values[i];
    202     }
     178  }
    203179 
    204180  delete[] values;
     
    206182  return i;
    207183}
     184
     185//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    208186
    209187G4double G4CrossSectionChargeIncreasePartial::Sum(G4double k, const G4ParticleDefinition* particleDefinition)
     
    219197
    220198  for (G4int i=0; i<numberOfPartialCrossSections[particleTypeIndex]; i++)
    221     {
    222       totalCrossSection += CrossSection(k,i,particleDefinition);
    223     }
     199  {
     200    totalCrossSection += CrossSection(k,i,particleDefinition);
     201  }
    224202  return totalCrossSection;
    225203}
    226204
    227 
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionElasticScreenedRutherford.cc

    r819 r961  
    2626//
    2727// $Id: G4CrossSectionElasticScreenedRutherford.cc,v 1.1 2007/10/12 23:11:41 pia Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionExcitationBorn.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4CrossSectionExcitationBorn.cc,v 1.2 2007/11/09 20:11:04 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // Reference: TNS Geant4-DNA paper
    33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    34 
    35 // History:
    36 // -----------
    37 // Date         Name              Modification
    38 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    39 //
    40 // -------------------------------------------------------------------
    41 
    42 // Class description:
    43 // Geant4-DNA Cross total cross section for electron elastic scattering in water
    44 // Reference: TNS Geant4-DNA paper
    45 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    46 // design foundation and implementation of the first set of models,
    47 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    48 // Further documentation available from http://www.ge.infn.it/geant4/dna
    49 
    50 // -------------------------------------------------------------------
    51 
     26// $Id: G4CrossSectionExcitationBorn.cc,v 1.4 2008/07/14 20:47:34 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5228
    5329#include "G4CrossSectionExcitationBorn.hh"
    54 #include "G4Track.hh"
    55 #include "G4DynamicParticle.hh"
    56 #include "G4ParticleDefinition.hh"
    57 #include "G4Electron.hh"
    58 #include "G4LogLogInterpolation.hh"
    5930
    60 #include "Randomize.hh"
     31//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    6132
    6233G4CrossSectionExcitationBorn::G4CrossSectionExcitationBorn()
    6334{
    64 
    65   // ---- MGP ---- Limits to be checked: current values are just temporary for testing purpose
    66   name = "ExcitationBorn";
    67   lowEnergyLimit = 1. * keV;
     35  lowEnergyLimit = 500. * keV;
    6836  highEnergyLimit = 10 * MeV;
    69 
    7037  table = 0;
    7138}
    7239
     40//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    7341
    7442G4CrossSectionExcitationBorn::~G4CrossSectionExcitationBorn()
     
    7745}
    7846 
     47//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     48
    7949G4double G4CrossSectionExcitationBorn::CrossSection(const G4Track& track)
    8050{
    81   // Lazy initialisation: load cross section tables in memory the first time access to them is required
    82  
     51
    8352  G4double sigma = 0.;
    8453
    8554  if (table == 0)
    86     {
    87       // Load tables
    88       // ---- MGP ----
    89       table = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,(1e-22/3.343)*m*m );
    90       table->LoadData("dna/sigma_excitation_p_born");
    91      
    92       // ---- MGP ---- Temporary
    93       table->PrintData();
    94     }
     55  {
     56    table = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,(1e-22/3.343)*m*m );
     57    table->LoadData("dna/sigma_excitation_p_born");
     58  }
    9559
    9660  const G4DynamicParticle* particle = track.GetDynamicParticle();
    9761  G4double k = particle->GetKineticEnergy();
    9862
    99   if (k > lowEnergyLimit && k < highEnergyLimit)
    100     {
    101       sigma = table->FindValue(k); // no electron interaction ---- MGP ---- What does this mean?
    102     }
     63  if (k >= lowEnergyLimit && k <= highEnergyLimit)
     64  {
     65    sigma = table->FindValue(k);
     66  }
    10367  return sigma;
    10468}
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionExcitationBornPartial.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4CrossSectionExcitationBornPartial.cc,v 1.1 2007/10/15 08:57:54 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // Reference: TNS Geant4-DNA paper
    33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    34 
    35 // History:
    36 // -----------
    37 // Date         Name              Modification
    38 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    39 //
    40 // -------------------------------------------------------------------
    41 
    42 // Class description:
    43 // Geant4-DNA Cross total cross section for electron elastic scattering in water
    44 // Reference: TNS Geant4-DNA paper
    45 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    46 // design foundation and implementation of the first set of models,
    47 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    48 // Further documentation available from http://www.ge.infn.it/geant4/dna
    49 
    50 // -------------------------------------------------------------------
    51 
     26// $Id: G4CrossSectionExcitationBornPartial.cc,v 1.3 2008/07/14 20:47:34 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5228
    5329#include "G4CrossSectionExcitationBornPartial.hh"
    54 #include "G4Track.hh"
    55 #include "G4DynamicParticle.hh"
    56 #include "G4ParticleDefinition.hh"
    57 #include "G4Electron.hh"
    58 #include "G4LogLogInterpolation.hh"
    5930
    60 #include "Randomize.hh"
    61 
    62 #include <deque>
     31//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    6332
    6433G4CrossSectionExcitationBornPartial::G4CrossSectionExcitationBornPartial()
    6534{
    6635  table = 0;
    67   // nLevels = waterExcitation.NumberOfLevels();
    6836}
    6937
     38//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    7039
    7140G4CrossSectionExcitationBornPartial::~G4CrossSectionExcitationBornPartial()
     
    7443}
    7544
     45//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    7646
    7747G4int G4CrossSectionExcitationBornPartial::RandomSelect(G4double k)
    7848{   
    79   // Lazy initialisation: load cross section tables in memory the first time access to them is required
    80  
    8149  G4int level = 0;
    8250
    8351  if (table == 0)
    84     {
    85       // Load tables
    86       // ---- MGP ----
    87       table = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,(1e-22/3.343)*m*m );
    88       table->LoadData("dna/sigma_excitation_p_born");
    89      
    90       // ---- MGP ---- Temporary
    91       table->PrintData();
    92     }
     52  {
     53    table = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,(1e-22/3.343)*m*m );
     54    table->LoadData("dna/sigma_excitation_p_born");
     55  }
    9356
    9457  G4double* valuesBuffer = new G4double[table->NumberOfComponents()];
     
    9962 
    10063  while (i>0)
    101     {
    102       i--;
    103       valuesBuffer[i] = table->GetComponent(i)->FindValue(k);
    104       value += valuesBuffer[i];
    105     }
     64  {
     65    i--;
     66    valuesBuffer[i] = table->GetComponent(i)->FindValue(k);
     67    value += valuesBuffer[i];
     68  }
    10669 
    10770  value *= G4UniformRand();
     
    11073 
    11174  while (i > 0)
     75  {
     76    i--;
     77     
     78    if (valuesBuffer[i] > value)
    11279    {
    113       i--;
    114      
    115       if (valuesBuffer[i] > value)
    116         {
    117           delete[] valuesBuffer;
    118           return i;
    119         }
     80      delete[] valuesBuffer;
     81      return i;
     82    }
    12083      value -= valuesBuffer[i];
    121     }
     84  }
    12285
    123   // It should never end up here
    124 
    125   // ---- MGP ---- Is the following line really necessary? 
    12686  if (valuesBuffer) delete[] valuesBuffer;
    12787
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionExcitationEmfietzoglou.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4CrossSectionExcitationEmfietzoglou.cc,v 1.2 2007/10/15 08:36:35 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // Reference: TNS Geant4-DNA paper
    33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    34 
    35 // History:
    36 // -----------
    37 // Date         Name              Modification
    38 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    39 //
    40 // -------------------------------------------------------------------
    41 
    42 // Class description:
    43 // Geant4-DNA Cross total cross section for electron elastic scattering in water
    44 // Reference: TNS Geant4-DNA paper
    45 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    46 // design foundation and implementation of the first set of models,
    47 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    48 // Further documentation available from http://www.ge.infn.it/geant4/dna
    49 
    50 // -------------------------------------------------------------------
    51 
     26// $Id: G4CrossSectionExcitationEmfietzoglou.cc,v 1.5 2008/12/05 11:58:16 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5228
    5329#include "G4CrossSectionExcitationEmfietzoglou.hh"
    54 #include "G4Track.hh"
    55 #include "G4DynamicParticle.hh"
     30
     31//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    5632
    5733G4CrossSectionExcitationEmfietzoglou::G4CrossSectionExcitationEmfietzoglou()
    5834{
    59 
    60   name = "CrossSectionExcitationEmfietzoglou";
    61   lowEnergyLimit = 7.4 * eV;
     35  lowEnergyLimit = 8.23 * eV;
    6236  highEnergyLimit = 10. * MeV;
    6337}
    6438
     39//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    6540
    6641G4CrossSectionExcitationEmfietzoglou::~G4CrossSectionExcitationEmfietzoglou()
    67 { }
     42{}
    6843 
     44//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    6945
    7046G4double G4CrossSectionExcitationEmfietzoglou::CrossSection(const G4Track& track)
     
    7349  G4double k = particle->GetKineticEnergy();
    7450
    75   // Cross section = 0 outside the energy validity limits set in the constructor
    76   // ---- MGP ---- Better handling of these limits to be set in a following design iteration
    77 
    7851  G4double sigma = 0.;
    7952
    80   if (k > lowEnergyLimit && k < highEnergyLimit) sigma = partialCrossSection.Sum(k);
     53  if (k >= lowEnergyLimit && k <= highEnergyLimit) sigma = partialCrossSection.Sum(k);
    8154
    8255  return sigma;
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionExcitationEmfietzoglouPartial.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4CrossSectionExcitationEmfietzoglouPartial.cc,v 1.2 2007/12/10 16:31:26 gunter Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // Reference: TNS Geant4-DNA paper
    33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    34 
    35 // History:
    36 // -----------
    37 // Date         Name              Modification
    38 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    39 //
    40 // -------------------------------------------------------------------
    41 
    42 // Class description:
    43 // Geant4-DNA Cross total cross section for electron elastic scattering in water
    44 // Reference: TNS Geant4-DNA paper
    45 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    46 // design foundation and implementation of the first set of models,
    47 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    48 // Further documentation available from http://www.ge.infn.it/geant4/dna
    49 
    50 // -------------------------------------------------------------------
    51 
     26// $Id: G4CrossSectionExcitationEmfietzoglouPartial.cc,v 1.3 2008/07/14 20:47:34 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5228
    5329#include "G4CrossSectionExcitationEmfietzoglouPartial.hh"
    54 #include "G4Track.hh"
    55 #include "G4DynamicParticle.hh"
    56 #include "G4ParticleDefinition.hh"
    57 #include "G4Electron.hh"
    5830
    59 #include "Randomize.hh"
    60 
    61 #include <deque>
     31//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    6232
    6333G4CrossSectionExcitationEmfietzoglouPartial::G4CrossSectionExcitationEmfietzoglouPartial()
    6434{
    65 
    6635  nLevels = waterExcitation.NumberOfLevels();
    67   //G4cout << "Water excitation energy: number of levels = " << nLevels << G4endl;
    6836}
    6937
     38//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    7039
    7140G4CrossSectionExcitationEmfietzoglouPartial::~G4CrossSectionExcitationEmfietzoglouPartial()
    72 { }
     41{}
    7342 
     43//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     44
    7445G4double G4CrossSectionExcitationEmfietzoglouPartial::CrossSection(G4double t, G4int level)
    7546{
     
    8455  // Aj, Bj, Cj & Pj are parameters that can be found in Emfietzoglou's papers
    8556  //
    86   //
    8757  // From Phys. Med. Biol. 48 (2003) 2355-2371, D.Emfietzoglou,
    8858  // Monte Carlo Simulation of the energy loss of low energy electrons in liquid Water
    89  
     59  //
    9060  // Scaling for macroscopic cross section: number of water moleculs per unit volume
    91   // (capra) const G4double sigma0 = (10. / 3.343e22) * cm2;
     61  // const G4double sigma0 = (10. / 3.343e22) * cm2;
     62
    9263  const G4double density = 3.34192e+19 * mm3;
    9364
     
    10071 
    10172  G4double exc = waterExcitation.ExcitationEnergy(level);
    102   // G4cout << "Water excitation energy " << exc/keV << " level = " << level << G4endl;
    103 
     73 
    10474  if (t >= exc)
    10575    {
     
    11383}
    11484
     85//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     86
    11587G4int G4CrossSectionExcitationEmfietzoglouPartial::RandomSelect(G4double k)
    11688{
     
    11991  std::deque<double> values;
    12092 
    121   // ---- MGP ---- The following algorithm is wrong: it works is the cross section
     93  // ---- MGP ---- The following algorithm is wrong: it works if the cross section
    12294  // is a monotone increasing function.
    12395  // The algorithm should be corrected by building the cumulative function
     
    12698
    12799  while (i > 0)
    128     {
    129       i--;
    130       G4double partial = CrossSection(k,i);
    131       values.push_front(partial);
    132       value += partial;
    133     }
     100  {
     101    i--;
     102    G4double partial = CrossSection(k,i);
     103    values.push_front(partial);
     104    value += partial;
     105  }
    134106
    135     value *= G4UniformRand();
     107  value *= G4UniformRand();
    136108   
    137     i = nLevels;
     109  i = nLevels;
    138110
    139     while (i > 0)
    140       {
    141         i--;
    142         if (values[i] > value) return i;
    143         value -= values[i];
    144       }
     111  while (i > 0)
     112  {
     113    i--;
     114    if (values[i] > value) return i;
     115    value -= values[i];
     116  }
    145117   
    146     return 0;
     118  return 0;
    147119}
     120
     121//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    148122
    149123G4double G4CrossSectionExcitationEmfietzoglouPartial::Sum(G4double k)
     
    152126
    153127  for (G4int i=0; i<nLevels; i++)
    154     {
    155       totalCrossSection += CrossSection(k,i);
    156     }
     128  {
     129    totalCrossSection += CrossSection(k,i);
     130  }
    157131  return totalCrossSection;
    158132}
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionExcitationMillerGreen.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4CrossSectionExcitationMillerGreen.cc,v 1.3 2007/11/09 20:11:04 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // Reference: TNS Geant4-DNA paper
    33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    34 
    35 // History:
    36 // -----------
    37 // Date         Name              Modification
    38 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    39 //
    40 // -------------------------------------------------------------------
    41 
    42 // Class description:
    43 // Geant4-DNA Cross total cross section for electron elastic scattering in water
    44 // Reference: TNS Geant4-DNA paper
    45 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    46 // design foundation and implementation of the first set of models,
    47 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    48 // Further documentation available from http://www.ge.infn.it/geant4/dna
    49 
    50 // -------------------------------------------------------------------
    51 
     26// $Id: G4CrossSectionExcitationMillerGreen.cc,v 1.4 2008/07/14 20:47:34 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5228
    5329#include "G4CrossSectionExcitationMillerGreen.hh"
    54 #include "G4Track.hh"
    55 #include "G4DynamicParticle.hh"
    56 #include "G4Proton.hh"
    57 #include "G4CrossSectionExcitationEmfietzoglouPartial.hh"
    58 #include "G4DNAGenericIonsManager.hh"
     30
     31//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    5932
    6033G4CrossSectionExcitationMillerGreen::G4CrossSectionExcitationMillerGreen()
    6134{
    62   // Default energy limits (defined for protection against anomalous behaviour only)
    63   name = "ExcitationMillerGreen";
    6435  lowEnergyLimitDefault = 10 * eV;
    6536  highEnergyLimitDefault = 10 * MeV;
     
    7849
    7950  if (protonDef != 0)
    80     {
    81       proton = protonDef->GetParticleName();
    82       lowEnergyLimit[proton] = 10. * eV;
    83       highEnergyLimit[proton] = 500. * keV;
    84     }
     51  {
     52    proton = protonDef->GetParticleName();
     53    lowEnergyLimit[proton] = 10. * eV;
     54    highEnergyLimit[proton] = 500. * keV;
     55  }
    8556  else
    86     {
    87       G4Exception("G4CrossSectionExcitationMillerGreen Constructor: proton is not defined");
    88     }
     57  {
     58    G4Exception("G4CrossSectionExcitationMillerGreen Constructor: proton is not defined");
     59  }
    8960
    9061  if (alphaPlusPlusDef != 0)
    91     {
    92       alphaPlusPlus = alphaPlusPlusDef->GetParticleName();
    93       lowEnergyLimit[alphaPlusPlus] = 1. * keV;
    94       highEnergyLimit[alphaPlusPlus] = 10. * MeV;
    95     }
     62  {
     63    alphaPlusPlus = alphaPlusPlusDef->GetParticleName();
     64    lowEnergyLimit[alphaPlusPlus] = 1. * keV;
     65    highEnergyLimit[alphaPlusPlus] = 10. * MeV;
     66  }
    9667  else
    97     {
     68  {
    9869      G4Exception("G4CrossSectionExcitationMillerGreen Constructor: alphaPlusPlus is not defined");
    99     }
     70  }
    10071
    10172  if (alphaPlusDef != 0)
    102     {
    103       alphaPlus = alphaPlusDef->GetParticleName();
    104       lowEnergyLimit[alphaPlus] = 1. * keV;
    105       highEnergyLimit[alphaPlus] = 10. * MeV;
    106     }
     73  {
     74    alphaPlus = alphaPlusDef->GetParticleName();
     75    lowEnergyLimit[alphaPlus] = 1. * keV;
     76    highEnergyLimit[alphaPlus] = 10. * MeV;
     77  }
    10778  else
    108     {
    109       G4Exception("G4CrossSectionExcitationMillerGreen Constructor: alphaPlus is not defined");
    110     }
     79  {
     80    G4Exception("G4CrossSectionExcitationMillerGreen Constructor: alphaPlus is not defined");
     81  }
    11182
    11283  if (heliumDef != 0)
    113     {
    114       helium = heliumDef->GetParticleName();
    115       lowEnergyLimit[helium] = 1. * keV;
    116       highEnergyLimit[helium] = 10. * MeV;
    117     }
     84  {
     85    helium = heliumDef->GetParticleName();
     86    lowEnergyLimit[helium] = 1. * keV;
     87    highEnergyLimit[helium] = 10. * MeV;
     88  }
    11889  else
    119     {
    120       G4Exception("G4CrossSectionExcitationMillerGreen Constructor: helium is not defined");
    121     }
    122  
    123  
     90  {
     91    G4Exception("G4CrossSectionExcitationMillerGreen Constructor: helium is not defined");
     92  }
     93   
    12494}
    12595
     96//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    12697
    12798G4CrossSectionExcitationMillerGreen::~G4CrossSectionExcitationMillerGreen()
    12899{}
    129100 
     101//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    130102
    131103G4double G4CrossSectionExcitationMillerGreen::CrossSection(const G4Track& track)
     
    154126  const G4String& particleName = particle->GetDefinition()->GetParticleName();
    155127
    156   // Retrieve energy limits for the current particle type
    157 
    158128  std::map< G4String,G4double,std::less<G4String> >::iterator pos1;
    159129  pos1 = lowEnergyLimit.find(particleName);
    160130
    161   // Lower limit
    162131  if (pos1 != lowEnergyLimit.end())
    163     {
    164       lowLim = pos1->second;
    165     }
     132  {
     133    lowLim = pos1->second;
     134  }
    166135
    167   // Upper limit
    168136  std::map< G4String,G4double,std::less<G4String> >::iterator pos2;
    169137  pos2 = highEnergyLimit.find(particleName);
    170138
    171139  if (pos2 != highEnergyLimit.end())
    172     {
    173       highLim = pos2->second;
    174     }
     140  {
     141    highLim = pos2->second;
     142  }
    175143
    176   //
    177144  const G4ParticleDefinition* particleDefinition = track.GetDefinition();
    178145
     
    180147 
    181148  if (k >= lowLim && k <= highLim)
     149  {
     150    crossSection = partialCrossSection.Sum(k,particleDefinition);
     151    G4DNAGenericIonsManager *instance;
     152    instance = G4DNAGenericIonsManager::Instance();
     153
     154    // add ONE or TWO electron-water excitation for alpha+ and helium
     155 
     156    if ( particleDefinition == instance->GetIon("alpha+")
     157         ||
     158         particleDefinition == instance->GetIon("helium")
     159       )
    182160    {
    183  
    184       crossSection = partialCrossSection.Sum(k,particleDefinition);
    185       G4DNAGenericIonsManager *instance;
    186       instance = G4DNAGenericIonsManager::Instance();
    187 
    188       // add ONE or TWO electron-water excitation for alpha+ and helium
    189  
    190       if ( particleDefinition == instance->GetIon("alpha+")
    191            ||
    192            particleDefinition == instance->GetIon("helium")
    193            )
    194         {
    195161          G4CrossSectionExcitationEmfietzoglouPartial * excitationXS =
    196162            new G4CrossSectionExcitationEmfietzoglouPartial();
     163
    197164          G4double sigmaExcitation=0;
    198165          if (k*0.511/3728 > 7.4*eV && k*0.511/3728 < 10*keV) sigmaExcitation = excitationXS->Sum(k*0.511/3728);
     
    200167          if ( particleDefinition == instance->GetIon("alpha+") )
    201168            crossSection = crossSection +  sigmaExcitation ;
     169         
    202170          if ( particleDefinition == instance->GetIon("helium") )
    203171            crossSection = crossSection + 2*sigmaExcitation ;
     172         
    204173          delete excitationXS;
    205         }     
    206     }
     174    }     
     175  }
    207176     
    208177  return crossSection;
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionExcitationMillerGreenPartial.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4CrossSectionExcitationMillerGreenPartial.cc,v 1.1 2007/11/08 19:57:23 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // Reference: TNS Geant4-DNA paper
    33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    34 
    35 // History:
    36 // -----------
    37 // Date         Name              Modification
    38 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    39 //
    40 // -------------------------------------------------------------------
    41 
    42 // Class description:
    43 // Geant4-DNA Cross total cross section for electron elastic scattering in water
    44 // Reference: TNS Geant4-DNA paper
    45 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    46 // design foundation and implementation of the first set of models,
    47 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    48 // Further documentation available from http://www.ge.infn.it/geant4/dna
    49 
    50 // -------------------------------------------------------------------
    51 
     26// $Id: G4CrossSectionExcitationMillerGreenPartial.cc,v 1.3 2009/01/20 07:40:53 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5228
    5329#include "G4CrossSectionExcitationMillerGreenPartial.hh"
    54 #include "G4Track.hh"
    55 #include "G4DynamicParticle.hh"
    56 #include "G4ParticleDefinition.hh"
    57 #include "G4Proton.hh"
    58 #include "G4DNAGenericIonsManager.hh"
    59 #include "G4CrossSectionExcitationEmfietzoglouPartial.hh"
    60 #include "Randomize.hh"
    61 #include <deque>
    62 
     30
     31//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    6332
    6433G4CrossSectionExcitationMillerGreenPartial::G4CrossSectionExcitationMillerGreenPartial()
    6534{
    66 
    6735  nLevels = waterExcitation.NumberOfLevels();
    68   //G4cout << "Water excitation energy: number of levels = " << nLevels << G4endl;
    6936 
    7037  //PROTON
     
    10673}
    10774
     75//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     76
    10877G4CrossSectionExcitationMillerGreenPartial::~G4CrossSectionExcitationMillerGreenPartial()
    109 { }
    110  
     78{}
     79 
     80//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     81
    11182G4double G4CrossSectionExcitationMillerGreenPartial::CrossSection(G4double k, G4int excitationLevel,
    11283                                                                  const G4ParticleDefinition* particleDefinition)
     
    144115  tCorrected = k * kineticEnergyCorrection[particleTypeIndex];
    145116
    146   // Assume that the material is water; proper algorithm to calculate correctly for any material to be inserted here
     117  // SI - added protection
     118  if (tCorrected < waterExcitation.ExcitationEnergy(excitationLevel)) return 0;
     119  //
     120 
    147121  G4int z = 10;
    148122
     
    168142}
    169143
     144//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     145
    170146G4int G4CrossSectionExcitationMillerGreenPartial::RandomSelect(G4double k,
    171147                                                               const G4ParticleDefinition* particle)
     
    175151  std::deque<double> values;
    176152 
    177   // ---- MGP ---- The following algorithm is wrong: it works is the cross section
     153  // ---- MGP ---- The following algorithm is wrong: it works if the cross section
    178154  // is a monotone increasing function.
    179155  // The algorithm should be corrected by building the cumulative function
     
    186162  // ELECTRON CORRECTION
    187163 
    188   if ( particle == instance->GetIon("alpha++"))
    189     {  while (i > 0)
    190       {
     164  if ( particle == instance->GetIon("alpha++")||
     165       particle == G4Proton::ProtonDefinition())
     166       
     167  {  while (i > 0)
     168     {
    191169        i--;
    192170        G4double partial = CrossSection(k,i,particle);
    193171        values.push_front(partial);
    194172        value += partial;
    195       }
    196 
    197     value *= G4UniformRand();
     173     }
     174
     175     value *= G4UniformRand();
    198176   
    199     i = nLevels;
    200 
    201     while (i > 0)
    202       {
     177     i = nLevels;
     178
     179     while (i > 0)
     180     {
    203181        i--;
    204182        if (values[i] > value) return i;
    205183        value -= values[i];
    206       }
    207     }
    208 
    209   //
     184     }
     185  }
     186
    210187  // add ONE or TWO electron-water excitation for alpha+ and helium
    211188   
     
    213190       ||
    214191       particle == instance->GetIon("helium")
    215        )
     192     )
     193  {
     194    while (i>0)
    216195    {
    217 
    218       while (i>0)
    219         {
    220196          i--;
    221197         
     
    232208          value += partial;
    233209          delete excitationXS;
    234         }
    235  
    236       value*=G4UniformRand();
    237  
    238       i=5;
    239       while (i>0)
    240         {
     210    }
     211 
     212    value*=G4UniformRand();
     213 
     214    i=5;
     215    while (i>0)
     216    {
    241217          i--;
    242218   
     
    244220 
    245221          value-=values[i];
    246         }
    247     }   
     222    }
     223  }   
    248224  //   
     225
    249226  return 0;
    250227}
    251228
     229//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     230
    252231G4double G4CrossSectionExcitationMillerGreenPartial::Sum(G4double k, const G4ParticleDefinition* particle)
    253232{
     
    255234
    256235  for (G4int i=0; i<nLevels; i++)
    257     {
    258       totalCrossSection += CrossSection(k,i,particle);
    259     }
     236  {
     237    totalCrossSection += CrossSection(k,i,particle);
     238  }
    260239  return totalCrossSection;
    261240}
    262241
     242//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    263243
    264244G4double G4CrossSectionExcitationMillerGreenPartial::S_1s(G4double t,
     
    277257
    278258
     259//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     260
    279261G4double G4CrossSectionExcitationMillerGreenPartial::S_2s(G4double t,
    280262                                                          G4double energyTransferred,
     
    292274}
    293275
     276//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    294277
    295278G4double G4CrossSectionExcitationMillerGreenPartial::S_2p(G4double t,
     
    307290}
    308291
     292//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    309293
    310294G4double G4CrossSectionExcitationMillerGreenPartial::R(G4double t,
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionHandler.cc

    r819 r961  
    2626//
    2727// $Id: G4CrossSectionHandler.cc,v 1.18 2006/06/29 19:38:48 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionIonisationBorn.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4CrossSectionIonisationBorn.cc,v 1.2 2007/11/08 18:51:34 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // Reference: TNS Geant4-DNA paper
    33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    34 
    35 // History:
    36 // -----------
    37 // Date         Name              Modification
    38 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    39 //
    40 // -------------------------------------------------------------------
    41 
    42 // Class description:
    43 // Geant4-DNA Cross total cross section for electron elastic scattering in water
    44 // Reference: TNS Geant4-DNA paper
    45 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    46 // design foundation and implementation of the first set of models,
    47 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    48 // Further documentation available from http://www.ge.infn.it/geant4/dna
    49 
    50 // -------------------------------------------------------------------
    51 
     26// $Id: G4CrossSectionIonisationBorn.cc,v 1.4 2008/08/20 14:51:48 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5228
    5329#include "G4CrossSectionIonisationBorn.hh"
    54 #include "G4ParticleDefinition.hh"
    55 #include "G4Electron.hh"
    56 #include "G4Proton.hh"
    57 #include "G4Track.hh"
    58 #include "G4LogLogInterpolation.hh"
    59 #include "G4SystemOfUnits.hh"
    6030
     31//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    6132
    6233G4CrossSectionIonisationBorn::G4CrossSectionIonisationBorn()
    6334{
    64 
    65   name = "IonisationBorn";
    66  
    67   // Default energy limits (defined for protection against anomalous behaviour only)
    68   lowEnergyLimitDefault = 25 * eV;
     35  lowEnergyLimitDefault = 12.61 * eV; // SI: i/o 25 eV
    6936  highEnergyLimitDefault = 30 * keV;
    7037
     
    7845  G4String proton;
    7946 
    80   // Factor to scale microscopic/macroscopic cross section data in water
    81   // ---- MGP ---- Hardcoded (taken from prototype code); to be replaced with proper calculation
    8247  G4double scaleFactor = (1.e-22 / 3.343) * m*m;
    8348
     49  if (electronDef != 0)
     50  {
     51    electron = electronDef->GetParticleName();
     52    tableFile[electron] = fileElectron;
    8453
    85   // Data members for electrons
     54    lowEnergyLimit[electron] = 12.61 * eV; // SI: i/o 25 eV
     55    highEnergyLimit[electron] = 30. * keV;
    8656
    87   if (electronDef != 0)
    88     {
    89       electron = electronDef->GetParticleName();
    90       tableFile[electron] = fileElectron;
    91 
    92       // Energy limits
    93       lowEnergyLimit[electron] = 25. * eV;
    94       highEnergyLimit[electron] = 30. * keV;
    95 
    96       // Create data set with electron cross section data and load values stored in file
    97       G4DNACrossSectionDataSet* tableE = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor );
    98       tableE->LoadData(fileElectron);
     57    G4DNACrossSectionDataSet* tableE = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor );
     58    tableE->LoadData(fileElectron);
    9959     
    100       // Insert key-table pair in map
    101       tableData[electron] = tableE;
    102     }
     60    tableData[electron] = tableE;
     61  }
    10362  else
    104     {
    105       G4Exception("G4CrossSectionIonisationBorn Constructor: electron is not defined");
    106     }
    107 
    108   // Data members for protons
     63  {
     64    G4Exception("G4CrossSectionIonisationBorn Constructor: electron is not defined");
     65  }
    10966
    11067  if (protonDef != 0)
    111     {
    112       proton = protonDef->GetParticleName();
    113       tableFile[proton] = fileProton;
     68  {
     69    proton = protonDef->GetParticleName();
     70    tableFile[proton] = fileProton;
    11471
    115       // Energy limits
    116       lowEnergyLimit[proton] = 500. * keV;
    117       highEnergyLimit[proton] = 10. * MeV;
     72    lowEnergyLimit[proton] = 500. * keV;
     73    highEnergyLimit[proton] = 10. * MeV;
    11874
    119       // Create data set with proton cross section data and load values stored in file
    120       G4DNACrossSectionDataSet* tableP = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor );
    121       tableP->LoadData(fileProton);
     75    G4DNACrossSectionDataSet* tableP = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor );
     76    tableP->LoadData(fileProton);
    12277     
    123       // Insert key-table pair in map
    124       tableData[proton] = tableP;
    125     }
     78    tableData[proton] = tableP;
     79  }
    12680  else
    127     {
    128       G4Exception("G4CrossSectionIonisationBorn Constructor: proton is not defined");
    129     }
     81  {
     82    G4Exception("G4CrossSectionIonisationBorn Constructor: proton is not defined");
     83  }
    13084}
    13185
     86//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    13287
    13388G4CrossSectionIonisationBorn::~G4CrossSectionIonisationBorn()
    13489{
    135    // Destroy the content of the map
    13690  std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos;
    13791  for (pos = tableData.begin(); pos != tableData.end(); ++pos)
    138     {
    139       G4DNACrossSectionDataSet* table = pos->second;
    140       delete table;
    141     }
     92  {
     93    G4DNACrossSectionDataSet* table = pos->second;
     94    delete table;
     95  }
    14296}
    14397
    144 
     98//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    14599
    146100G4double G4CrossSectionIonisationBorn::CrossSection(const G4Track& track )
     
    149103  G4double k = particle->GetKineticEnergy();
    150104 
    151   // Cross section = 0 outside the energy validity limits set in the constructor
    152105  G4double sigma = 0.;
    153106
    154   // ---- MGP ---- Better handling of these limits to be set in a following design iteration
    155107  G4double lowLim = lowEnergyLimitDefault;
    156108  G4double highLim = highEnergyLimitDefault;
     
    158110  const G4String& particleName = particle->GetDefinition()->GetParticleName();
    159111
    160   // Retrieve energy limits for the current particle type
     112  std::map< G4String,G4double,std::less<G4String> >::iterator pos1;
     113  pos1 = lowEnergyLimit.find(particleName);
    161114
    162     std::map< G4String,G4double,std::less<G4String> >::iterator pos1;
    163     pos1 = lowEnergyLimit.find(particleName);
     115  if (pos1 != lowEnergyLimit.end())
     116  {
     117    lowLim = pos1->second;
     118  }
    164119
    165     // Lower limit
    166     if (pos1 != lowEnergyLimit.end())
     120  std::map< G4String,G4double,std::less<G4String> >::iterator pos2;
     121  pos2 = highEnergyLimit.find(particleName);
     122
     123  if (pos2 != highEnergyLimit.end())
     124  {
     125    highLim = pos2->second;
     126  }
     127
     128  if (k > lowLim && k < highLim)
     129  {
     130    std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos;
     131    pos = tableData.find(particleName);
     132       
     133    if (pos != tableData.end())
     134    {
     135      G4DNACrossSectionDataSet* table = pos->second;
     136      if (table != 0)
    167137      {
    168         lowLim = pos1->second;
     138        sigma = table->FindValue(k);
    169139      }
     140    }
     141    else
     142    {
     143      G4Exception("G4CrossSectionIonisationBorn: attempting to calculate cross section for wrong particle");
     144    }
     145  }
    170146
    171     // Upper limit
    172     std::map< G4String,G4double,std::less<G4String> >::iterator pos2;
    173     pos2 = highEnergyLimit.find(particleName);
    174 
    175     if (pos2 != highEnergyLimit.end())
    176       {
    177         highLim = pos2->second;
    178       }
    179 
    180     // Verify that the current track is within the energy limits of validity of the cross section model
    181     if (k > lowLim && k < highLim)
    182       {
    183         std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos;
    184         pos = tableData.find(particleName);
    185        
    186         if (pos != tableData.end())
    187           {
    188             G4DNACrossSectionDataSet* table = pos->second;
    189             if (table != 0)
    190               {
    191                 // Cross section
    192                 sigma = table->FindValue(k);
    193               }
    194           }
    195         else
    196           {
    197             // The track does not corresponds to a particle pertinent to this model
    198             G4Exception("G4CrossSectionIonisationBorn: attempting to calculate cross section for wrong particle");
    199           }
    200       }
    201 
    202     return sigma;
     147  return sigma;
    203148}
    204149
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionIonisationBornElectron.cc

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

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4CrossSectionIonisationBornPartial.cc,v 1.3 2007/11/09 20:11:04 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // Reference: TNS Geant4-DNA paper
    33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    34 
    35 // History:
    36 // -----------
    37 // Date         Name              Modification
    38 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    39 //
    40 // -------------------------------------------------------------------
    41 
    42 // Class description:
    43 // Geant4-DNA Cross total cross section for electron elastic scattering in water
    44 // Reference: TNS Geant4-DNA paper
    45 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    46 // design foundation and implementation of the first set of models,
    47 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    48 // Further documentation available from http://www.ge.infn.it/geant4/dna
    49 
    50 // -------------------------------------------------------------------
    51 
     26// $Id: G4CrossSectionIonisationBornPartial.cc,v 1.5 2009/01/20 07:40:53 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5228
    5329#include "G4CrossSectionIonisationBornPartial.hh"
    54 #include "G4ParticleDefinition.hh"
    55 #include "G4Electron.hh"
    56 #include "G4Proton.hh"
    57 #include "G4Track.hh"
    58 #include "G4LogLogInterpolation.hh"
    59 #include "G4SystemOfUnits.hh"
    60 
    61 #include "Randomize.hh"
    62 
    63 #include <utility>
     30
     31//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    6432
    6533G4CrossSectionIonisationBornPartial::G4CrossSectionIonisationBornPartial()
    6634{
    67 
    68   name = "IonisationBorn";
    69  
    70   // Default energy limits (defined for protection against anomalous behaviour only)
    71   name = "IonisationBornPartial";
    72   lowEnergyLimitDefault = 25 * eV;
     35  lowEnergyLimitDefault = 12.61 * eV;
    7336  highEnergyLimitDefault = 30 * keV;
    7437
     
    8245  G4String proton;
    8346 
    84   // Factor to scale microscopic/macroscopic cross section data in water
    85   // ---- MGP ---- Hardcoded (taken from prototype code); to be replaced with proper calculation
    8647  G4double scaleFactor = (1.e-22 / 3.343) * m*m;
    8748
    88 
    89   // Data members for electrons
    90 
    9149  if (electronDef != 0)
    92     {
    93       electron = electronDef->GetParticleName();
    94       tableFile[electron] = fileElectron;
    95 
    96       // Energy limits
    97       lowEnergyLimit[electron] = 25. * eV;
    98       highEnergyLimit[electron] = 30. * keV;
    99 
    100       // Create data set with electron cross section data and load values stored in file
    101       G4DNACrossSectionDataSet* tableE = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor );
    102       tableE->LoadData(fileElectron);
     50  {
     51    electron = electronDef->GetParticleName();
     52    tableFile[electron] = fileElectron;
     53
     54    lowEnergyLimit[electron] = 12.61 * eV;
     55    highEnergyLimit[electron] = 30. * keV;
     56
     57    G4DNACrossSectionDataSet* tableE = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor );
     58    tableE->LoadData(fileElectron);
    10359     
    104       // Insert key-table pair in map
    105       tableData[electron] = tableE;
    106     }
     60    tableData[electron] = tableE;
     61  }
    10762  else
    108     {
    109       G4Exception("G4CrossSectionIonisationBornPartial Constructor: electron is not defined");
    110     }
    111 
    112   // Data members for protons
     63  {
     64    G4Exception("G4CrossSectionIonisationBornPartial Constructor: electron is not defined");
     65  }
    11366
    11467  if (protonDef != 0)
    115     {
    116       proton = protonDef->GetParticleName();
    117       tableFile[proton] = fileProton;
    118 
    119       // Energy limits
    120       lowEnergyLimit[proton] = 500. * keV;
    121       highEnergyLimit[proton] = 10. * MeV;
    122 
    123       // Create data set with proton cross section data and load values stored in file
    124       G4DNACrossSectionDataSet* tableP = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor );
    125       tableP->LoadData(fileProton);
     68  {
     69    proton = protonDef->GetParticleName();
     70    tableFile[proton] = fileProton;
     71
     72    lowEnergyLimit[proton] = 500. * keV;
     73    highEnergyLimit[proton] = 10. * MeV;
     74
     75    G4DNACrossSectionDataSet* tableP = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor );
     76    tableP->LoadData(fileProton);
    12677     
    127       // Insert key-table pair in map
    128       tableData[proton] = tableP;
    129     }
     78    tableData[proton] = tableP;
     79  }
    13080  else
    131     {
    132       G4Exception("G4CrossSectionIonisationBornPartial Constructor: proton is not defined");
    133     }
    134 }
    135 
     81  {
     82    G4Exception("G4CrossSectionIonisationBornPartial Constructor: proton is not defined");
     83  }
     84}
     85
     86//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    13687
    13788G4CrossSectionIonisationBornPartial::~G4CrossSectionIonisationBornPartial()
    13889{
    139    // Destroy the content of the map
    14090  std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos;
    14191  for (pos = tableData.begin(); pos != tableData.end(); ++pos)
    142     {
    143       G4DNACrossSectionDataSet* table = pos->second;
    144       delete table;
    145     }
    146 }
    147 
     92  {
     93    G4DNACrossSectionDataSet* table = pos->second;
     94    delete table;
     95  }
     96}
     97
     98//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    14899
    149100G4int G4CrossSectionIonisationBornPartial::RandomSelect(G4double k, const G4String& particle )
    150101{   
    151  
    152102  G4int level = 0;
    153103
    154   // Retrieve data table corresponding to the current particle type 
    155 
    156     std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos;
    157     pos = tableData.find(particle);
    158 
    159     if (pos != tableData.end())
     104  std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos;
     105  pos = tableData.find(particle);
     106
     107  if (pos != tableData.end())
     108  {
     109    G4DNACrossSectionDataSet* table = pos->second;
     110
     111    if (table != 0)
     112    {
     113      G4double* valuesBuffer = new G4double[table->NumberOfComponents()];
     114      const size_t n(table->NumberOfComponents());
     115      size_t i(n);
     116      G4double value = 0.;
     117           
     118      while (i>0)
     119      {
     120        i--;
     121        valuesBuffer[i] = table->GetComponent(i)->FindValue(k);
     122        value += valuesBuffer[i];
     123      }
     124           
     125      value *= G4UniformRand();
     126   
     127      i = n;
     128           
     129      while (i > 0)
    160130      {
    161         G4DNACrossSectionDataSet* table = pos->second;
    162 
    163         if (table != 0)
    164           {
    165             // C-style arrays are used in G4DNACrossSectionDataSet: this design feature was
    166             // introduced without authorization and should be replaced by the use of STL containers
    167            
    168             G4double* valuesBuffer = new G4double[table->NumberOfComponents()];
    169            
    170             const size_t n(table->NumberOfComponents());
    171             size_t i(n);
    172             G4double value = 0.;
    173            
    174             while (i>0)
    175               {
    176                 i--;
    177                 valuesBuffer[i] = table->GetComponent(i)->FindValue(k);
    178                 value += valuesBuffer[i];
    179               }
    180            
    181             value *= G4UniformRand();
    182            
    183             i = n;
    184            
    185             while (i > 0)
    186               {
    187                 i--;
    188                
    189                 if (valuesBuffer[i] > value)
    190                   {
    191                     delete[] valuesBuffer;
    192                     return i;
    193                   }
    194                 value -= valuesBuffer[i];
    195               }
    196            
    197             // It should never end up here
    198 
    199             // ---- MGP ---- Is the following line really necessary? 
    200             if (valuesBuffer) delete[] valuesBuffer;
    201            
    202           }
     131        i--;
     132
     133        if (valuesBuffer[i] > value)
     134        {
     135          delete[] valuesBuffer;
     136          return i;
     137        }
     138        value -= valuesBuffer[i];
    203139      }
    204     else
    205       {
    206         G4Exception("G4CrossSectionIonisationBornPartial: attempting to calculate cross section for wrong particle");
    207       }
     140           
     141      if (valuesBuffer) delete[] valuesBuffer;
     142   
     143    }
     144  }
     145  else
     146  {
     147    G4Exception("G4CrossSectionIonisationBornPartial: attempting to calculate cross section for wrong particle");
     148  }
    208149     
    209150  return level;
    210151}
    211152
     153//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    212154
    213155G4double G4CrossSectionIonisationBornPartial::CrossSection(const G4Track& track )
     
    218160  G4double k = particle->GetKineticEnergy();
    219161 
    220   // Cross section = 0 outside the energy validity limits set in the constructor
    221   // ---- MGP ---- Better handling of these limits to be set in a following design iteration
    222 
    223162  G4double lowLim = lowEnergyLimitDefault;
    224163  G4double highLim = highEnergyLimitDefault;
     
    226165  const G4String& particleName = particle->GetDefinition()->GetParticleName();
    227166
    228   // Retrieve energy limits for the current particle type
    229 
    230     std::map< G4String,G4double,std::less<G4String> >::iterator pos1;
    231     pos1 = lowEnergyLimit.find(particleName);
    232 
    233     // Lower limit
    234     if (pos1 != lowEnergyLimit.end())
    235       {
    236         lowLim = pos1->second;
    237       }
    238 
    239     // Upper limit
    240     std::map< G4String,G4double,std::less<G4String> >::iterator pos2;
    241     pos2 = highEnergyLimit.find(particleName);
    242 
    243     if (pos2 != highEnergyLimit.end())
    244       {
    245         highLim = pos2->second;
    246       }
    247 
    248     // Verify that the current track is within the energy limits of validity of the cross section model
    249     if (k > lowLim && k < highLim)
    250       {
    251         std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos;
    252         pos = tableData.find(particleName);
     167  std::map< G4String,G4double,std::less<G4String> >::iterator pos1;
     168  pos1 = lowEnergyLimit.find(particleName);
     169
     170  if (pos1 != lowEnergyLimit.end())
     171  {
     172    lowLim = pos1->second;
     173  }
     174
     175  std::map< G4String,G4double,std::less<G4String> >::iterator pos2;
     176  pos2 = highEnergyLimit.find(particleName);
     177
     178  if (pos2 != highEnergyLimit.end())
     179  {
     180     highLim = pos2->second;
     181  }
     182
     183  if (k > lowLim && k < highLim)
     184  {
     185     std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos;
     186     pos = tableData.find(particleName);
    253187       
    254         if (pos != tableData.end())
    255           {
    256             G4DNACrossSectionDataSet* table = pos->second;
    257             if (table != 0)
    258               {
    259                 // ---- MGP ---- Temporary
    260                 // table->PrintData();
    261 
    262                 // Cross section
    263                 sigma = table->FindValue(k);
    264               }
    265           }
    266         else
    267           {
    268             // The track corresponds to a not pertinent particle
    269             G4Exception("G4CrossSectionIonisationBornPartial: attempting to calculate cross section for wrong particle");
    270           }
    271       }
    272 
    273     return sigma;
    274 }
    275 
     188     if (pos != tableData.end())
     189     {
     190       G4DNACrossSectionDataSet* table = pos->second;
     191       if (table != 0)
     192       {
     193         sigma = table->FindValue(k);
     194       }
     195     }
     196     else
     197     {
     198       G4Exception("G4CrossSectionIonisationBornPartial: attempting to calculate cross section for wrong particle");
     199     }
     200  }
     201
     202  return sigma;
     203}
     204
     205//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    276206
    277207G4double G4CrossSectionIonisationBornPartial::Sum(G4double /* energy */, const G4String& /* particle */)
    278208{
    279 
    280209  return 0;
    281210}
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionIonisationBornPartialElectron.cc

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

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4CrossSectionIonisationRudd.cc,v 1.2 2007/11/09 16:20:16 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // Reference: TNS Geant4-DNA paper
    33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    34 
    35 // History:
    36 // -----------
    37 // Date         Name              Modification
    38 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    39 //
    40 // -------------------------------------------------------------------
    41 
    42 // Class description:
    43 // Geant4-DNA Cross total cross section for electron elastic scattering in water
    44 // Reference: TNS Geant4-DNA paper
    45 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    46 // design foundation and implementation of the first set of models,
    47 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    48 // Further documentation available from http://www.ge.infn.it/geant4/dna
    49 
    50 // -------------------------------------------------------------------
    51 
     26// $Id: G4CrossSectionIonisationRudd.cc,v 1.4 2008/07/14 20:47:34 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5228
    5329#include "G4CrossSectionIonisationRudd.hh"
    54 #include "G4ParticleDefinition.hh"
    55 #include "G4Electron.hh"
    56 #include "G4Proton.hh"
    57 #include "G4Track.hh"
    58 #include "G4LogLogInterpolation.hh"
    59 #include "G4SystemOfUnits.hh"
    60 #include "G4DNAGenericIonsManager.hh"
     30
     31//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    6132
    6233G4CrossSectionIonisationRudd::G4CrossSectionIonisationRudd()
    6334{
    64 
    65   name = "IonisationRudd";
    66  
    67   // Default energy limits (defined for protection against anomalous behaviour only)
    68   // ZERO LOW ENERGY LIMIT FOR ALLOWED KILLING
    6935  lowEnergyLimitDefault = 0 * eV;
    7036  highEnergyLimitDefault = 100 * MeV;
     
    9056  G4String helium;
    9157
    92   // Factor to scale microscopic/macroscopic cross section data in water
    93   // ---- MGP ---- Hardcoded (taken from prototype code); to be replaced with proper calculation
    9458  G4double scaleFactor = 1 * m*m;
    9559
    96   // Data members for protons
    97 
    9860  if (protonDef != 0)
    99     {
    100       proton = protonDef->GetParticleName();
    101       tableFile[proton] = fileProton;
    102 
    103       // Energy limits
    104       lowEnergyLimit[proton] = 0. * eV;
    105       highEnergyLimit[proton] = 500. * keV;
    106 
    107       // Create data set with proton cross section data and load values stored in file
    108       G4DNACrossSectionDataSet* tableProton = new G4DNACrossSectionDataSet(new G4LogLogInterpolation,
     61  {
     62    proton = protonDef->GetParticleName();
     63    tableFile[proton] = fileProton;
     64
     65    lowEnergyLimit[proton] = 0. * eV;
     66    highEnergyLimit[proton] = 500. * keV;
     67
     68    G4DNACrossSectionDataSet* tableProton = new G4DNACrossSectionDataSet(new G4LogLogInterpolation,
    10969                                                                           eV,
    11070                                                                           scaleFactor );
    111       tableProton->LoadData(fileProton);
    112      
    113       // Insert key-table pair in map
    114       tableData[proton] = tableProton;
    115     }
    116   else
    117     {
    118       G4Exception("G4CrossSectionIonisationRudd Constructor: proton is not defined");
    119     }
    120 
    121   // Data members for hydrogen
     71    tableProton->LoadData(fileProton);
     72    tableData[proton] = tableProton;
     73  }
     74  else
     75  {
     76    G4Exception("G4CrossSectionIonisationRudd Constructor: proton is not defined");
     77  }
    12278
    12379  if (hydrogenDef != 0)
    124     {
    125       hydrogen = hydrogenDef->GetParticleName();
    126       tableFile[hydrogen] = fileHydrogen;
    127 
    128       // Energy limits
    129       lowEnergyLimit[hydrogen] = 0. * eV;
    130       highEnergyLimit[hydrogen] = 100. * MeV;
    131 
    132       // Create data set with hydrogen cross section data and load values stored in file
    133       G4DNACrossSectionDataSet* tableHydrogen = new G4DNACrossSectionDataSet(new G4LogLogInterpolation,
     80  {
     81    hydrogen = hydrogenDef->GetParticleName();
     82    tableFile[hydrogen] = fileHydrogen;
     83
     84    lowEnergyLimit[hydrogen] = 0. * eV;
     85    highEnergyLimit[hydrogen] = 100. * MeV;
     86
     87    G4DNACrossSectionDataSet* tableHydrogen = new G4DNACrossSectionDataSet(new G4LogLogInterpolation,
    13488                                                                             eV,
    13589                                                                             scaleFactor );
    136       tableHydrogen->LoadData(fileHydrogen);
     90    tableHydrogen->LoadData(fileHydrogen);
    13791     
    138       // Insert key-table pair in map
    139       tableData[hydrogen] = tableHydrogen;
    140     }
    141   else
    142     {
    143       G4Exception("G4CrossSectionIonisationRudd Constructor: hydrogen is not defined");
    144     }
    145 
    146   // Data members for alphaPlusPlus
     92    tableData[hydrogen] = tableHydrogen;
     93  }
     94  else
     95  {
     96    G4Exception("G4CrossSectionIonisationRudd Constructor: hydrogen is not defined");
     97  }
    14798
    14899  if (alphaPlusPlusDef != 0)
    149     {
    150       alphaPlusPlus = alphaPlusPlusDef->GetParticleName();
    151       tableFile[alphaPlusPlus] = fileAlphaPlusPlus;
    152 
    153       // Energy limits
    154       lowEnergyLimit[alphaPlusPlus] = 0. * keV;
    155       highEnergyLimit[alphaPlusPlus] = 10. * MeV;
    156 
    157       // Create data set with hydrogen cross section data and load values stored in file
    158       G4DNACrossSectionDataSet* tableAlphaPlusPlus = new G4DNACrossSectionDataSet(new G4LogLogInterpolation,
     100  {
     101    alphaPlusPlus = alphaPlusPlusDef->GetParticleName();
     102    tableFile[alphaPlusPlus] = fileAlphaPlusPlus;
     103
     104    lowEnergyLimit[alphaPlusPlus] = 0. * eV;
     105    highEnergyLimit[alphaPlusPlus] = 10. * MeV;
     106
     107    G4DNACrossSectionDataSet* tableAlphaPlusPlus = new G4DNACrossSectionDataSet(new G4LogLogInterpolation,
    159108                                                                                  eV,
    160109                                                                                  scaleFactor );
    161       tableAlphaPlusPlus->LoadData(fileAlphaPlusPlus);
     110    tableAlphaPlusPlus->LoadData(fileAlphaPlusPlus);
    162111     
    163       // Insert key-table pair in map
    164       tableData[alphaPlusPlus] = tableAlphaPlusPlus;
    165     }
    166   else
    167     {
    168       G4Exception("G4CrossSectionIonisationRudd Constructor: alphaPlusPlus is not defined");
    169     }
    170 
    171   // Data members for alphaPlus
     112    tableData[alphaPlusPlus] = tableAlphaPlusPlus;
     113  }
     114  else
     115  {
     116    G4Exception("G4CrossSectionIonisationRudd Constructor: alphaPlusPlus is not defined");
     117  }
    172118
    173119  if (alphaPlusDef != 0)
    174     {
    175       alphaPlus = alphaPlusDef->GetParticleName();
    176       tableFile[alphaPlus] = fileAlphaPlus;
    177 
    178       // Energy limits
    179       lowEnergyLimit[alphaPlus] = 0. * keV;
    180       highEnergyLimit[alphaPlus] = 10. * MeV;
    181 
    182       // Create data set with hydrogen cross section data and load values stored in file
    183       G4DNACrossSectionDataSet* tableAlphaPlus = new G4DNACrossSectionDataSet(new G4LogLogInterpolation,
     120  {
     121    alphaPlus = alphaPlusDef->GetParticleName();
     122    tableFile[alphaPlus] = fileAlphaPlus;
     123
     124    lowEnergyLimit[alphaPlus] = 0. * eV;
     125    highEnergyLimit[alphaPlus] = 10. * MeV;
     126
     127    G4DNACrossSectionDataSet* tableAlphaPlus = new G4DNACrossSectionDataSet(new G4LogLogInterpolation,
    184128                                                                              eV,
    185129                                                                              scaleFactor );
    186       tableAlphaPlus->LoadData(fileAlphaPlus);
    187      
    188       // Insert key-table pair in map
    189       tableData[alphaPlus] = tableAlphaPlus;
    190     }
    191   else
    192     {
    193       G4Exception("G4CrossSectionIonisationRudd Constructor: alphaPlus is not defined");
    194     }
    195 
    196   // Data members for helium
     130    tableAlphaPlus->LoadData(fileAlphaPlus);
     131    tableData[alphaPlus] = tableAlphaPlus;
     132  }
     133  else
     134  {
     135    G4Exception("G4CrossSectionIonisationRudd Constructor: alphaPlus is not defined");
     136  }
    197137
    198138  if (heliumDef != 0)
    199     {
    200       helium = heliumDef->GetParticleName();
    201       tableFile[helium] = fileHelium;
    202 
    203       // Energy limits
    204       lowEnergyLimit[helium] = 0. * keV;
    205       highEnergyLimit[helium] = 10. * MeV;
    206 
    207       // Create data set with hydrogen cross section data and load values stored in file
    208       G4DNACrossSectionDataSet* tableHelium = new G4DNACrossSectionDataSet(new G4LogLogInterpolation,
     139  {
     140    helium = heliumDef->GetParticleName();
     141    tableFile[helium] = fileHelium;
     142
     143    lowEnergyLimit[helium] = 0. * eV;
     144    highEnergyLimit[helium] = 10. * MeV;
     145
     146    G4DNACrossSectionDataSet* tableHelium = new G4DNACrossSectionDataSet(new G4LogLogInterpolation,
    209147                                                                           eV,
    210148                                                                           scaleFactor );
    211       tableHelium->LoadData(fileHelium);
    212      
    213       // Insert key-table pair in map
    214       tableData[helium] = tableHelium;
     149    tableHelium->LoadData(fileHelium);
     150    tableData[helium] = tableHelium;
    215151    }
    216152  else
    217     {
    218       G4Exception("G4CrossSectionIonisationRudd Constructor: helium is not defined");
    219     }
     153  {
     154    G4Exception("G4CrossSectionIonisationRudd Constructor: helium is not defined");
     155  }
    220156}
    221157
     158//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    222159
    223160G4CrossSectionIonisationRudd::~G4CrossSectionIonisationRudd()
    224161{
    225   // Destroy the content of the map
    226162  std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos;
    227163  for (pos = tableData.begin(); pos != tableData.end(); ++pos)
    228     {
    229       G4DNACrossSectionDataSet* table = pos->second;
    230       delete table;
    231     }
     164  {
     165    G4DNACrossSectionDataSet* table = pos->second;
     166    delete table;
     167  }
    232168}
    233169
    234 
     170//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    235171
    236172G4double G4CrossSectionIonisationRudd::CrossSection(const G4Track& track )
     
    252188      &&
    253189      track.GetDefinition() != instance->GetIon("helium")
    254       )
     190     )
    255191           
    256192    G4Exception("G4CrossSectionIonisationRudd: attempting to calculate cross section for wrong particle");
    257193
    258   // Cross section = 0 outside the energy validity limits set in the constructor
    259194  G4double sigma = 0.;
    260195
    261   // ---- MGP ---- Better handling of these limits to be set in a following design iteration
    262196  G4double lowLim = lowEnergyLimitDefault;
    263197  G4double highLim = highEnergyLimitDefault;
     
    265199  const G4String& particleName = particle->GetDefinition()->GetParticleName();
    266200
    267   // Retrieve energy limits for the current particle type
    268 
    269201  std::map< G4String,G4double,std::less<G4String> >::iterator pos1;
    270202  pos1 = lowEnergyLimit.find(particleName);
    271203
    272   // Lower limit
    273204  if (pos1 != lowEnergyLimit.end())
    274     {
    275       lowLim = pos1->second;
    276     }
    277 
    278   // Upper limit
     205  {
     206    lowLim = pos1->second;
     207  }
     208
    279209  std::map< G4String,G4double,std::less<G4String> >::iterator pos2;
    280210  pos2 = highEnergyLimit.find(particleName);
    281211
    282212  if (pos2 != highEnergyLimit.end())
     213  {
     214    highLim = pos2->second;
     215  }
     216
     217  if (k >= lowLim && k <= highLim)
     218  {
     219    std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos;
     220    pos = tableData.find(particleName);
     221       
     222    if (pos != tableData.end())
    283223    {
    284       highLim = pos2->second;
    285     }
    286 
    287   // Verify that the current track is within the energy limits of validity of the cross section model
    288   if (k >= lowLim && k <= highLim)
    289     {
    290       std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos;
    291       pos = tableData.find(particleName);
    292        
    293       if (pos != tableData.end())
    294         {
    295           G4DNACrossSectionDataSet* table = pos->second;
    296           if (table != 0)
    297             {
    298               // Cross section
     224       G4DNACrossSectionDataSet* table = pos->second;
     225       if (table != 0)
     226       {
    299227              sigma = table->FindValue(k);
    300 
    301228
    302229              // BEGIN ELECTRON CORRECTION
     
    307234                   particle->GetDefinition() == instance->GetIon("helium")
    308235                   )
    309                 {
     236              {
    310237     
    311238                  G4DNACrossSectionDataSet* electronDataset = new G4DNACrossSectionDataSet
     
    317244
    318245                  if ( particle->GetDefinition() == instance->GetIon("alpha+") )
    319                     {
     246                  {
    320247                      G4double tmp1 = table->FindValue(k) + electronDataset->FindValue(kElectron);
    321248                      delete electronDataset;
    322249                      return tmp1;
    323                     }
     250                  }
    324251
    325252                  if ( particle->GetDefinition() == instance->GetIon("helium") )
    326                     {
     253                  {
    327254                      G4double tmp2 = table->FindValue(k) +  2. * electronDataset->FindValue(kElectron);
    328255                      delete electronDataset;
    329256                      return tmp2;
    330                     }
    331                 }     
     257                  }
     258              }     
    332259
    333260              // END ELECTRON CORRECTION
    334 
    335             }
    336         }
    337       else
    338         {
    339           // The track does not corresponds to a particle pertinent to this model
    340           G4Exception("G4CrossSectionIonisationRudd: attempting to calculate cross section for wrong particle");
    341         }
     261       }
    342262    }
     263    else
     264    {
     265        G4Exception("G4CrossSectionIonisationRudd: attempting to calculate cross section for wrong particle");
     266    }
     267  }
    343268
    344269  return sigma;
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionIonisationRuddPartial.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4CrossSectionIonisationRuddPartial.cc,v 1.3 2007/11/09 20:11:04 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // Reference: TNS Geant4-DNA paper
    33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    34 
    35 // History:
    36 // -----------
    37 // Date         Name              Modification
    38 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    39 //
    40 // -------------------------------------------------------------------
    41 
    42 // Class description:
    43 // Geant4-DNA Cross total cross section for electron elastic scattering in water
    44 // Reference: TNS Geant4-DNA paper
    45 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    46 // design foundation and implementation of the first set of models,
    47 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    48 // Further documentation available from http://www.ge.infn.it/geant4/dna
    49 
    50 // -------------------------------------------------------------------
    51 
     26// $Id: G4CrossSectionIonisationRuddPartial.cc,v 1.4 2008/07/14 20:47:34 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5228
    5329#include "G4CrossSectionIonisationRuddPartial.hh"
    54 #include "G4ParticleDefinition.hh"
    55 #include "G4Electron.hh"
    56 #include "G4Proton.hh"
    57 #include "G4Track.hh"
    58 #include "G4LogLogInterpolation.hh"
    59 #include "G4SystemOfUnits.hh"
    60 #include "G4DNAGenericIonsManager.hh"
    61 
    62 #include "Randomize.hh"
    63 
    64 #include <utility>
     30
     31//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    6532
    6633G4CrossSectionIonisationRuddPartial::G4CrossSectionIonisationRuddPartial()
    6734{
    68   name = "IonisationRudd";
    69  
    70   // Default energy limits (defined for protection against anomalous behaviour only)
    71   name = "IonisationRuddPartial";
    7235  lowEnergyLimitDefault = 100 * eV;
    7336  highEnergyLimitDefault = 100 * MeV;
     
    9356  G4String helium;
    9457
    95   // Factor to scale microscopic/macroscopic cross section data in water
    96   // ---- MGP ---- Hardcoded (taken from prototype code); to be replaced with proper calculation
    9758  G4double scaleFactor = 1 * m*m;
    9859
    99   // Data members for protons
    100 
    10160  if (protonDef != 0)
    102     {
    103       proton = protonDef->GetParticleName();
    104       tableFile[proton] = fileProton;
    105 
    106       // Energy limits
    107       lowEnergyLimit[proton] = 100. * eV;
    108       highEnergyLimit[proton] = 500. * keV;
    109 
    110       // Create data set with proton cross section data and load values stored in file
    111       G4DNACrossSectionDataSet* tableProton = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor );
    112       tableProton->LoadData(fileProton);
    113      
    114       // Insert key-table pair in map
    115       tableData[proton] = tableProton;
    116     }
    117   else
    118     {
    119       G4Exception("G4CrossSectionIonisationRudd Constructor: proton is not defined");
    120     }
    121 
    122   // Data members for hydrogen
     61  {
     62    proton = protonDef->GetParticleName();
     63    tableFile[proton] = fileProton;
     64
     65    lowEnergyLimit[proton] = 100. * eV;
     66    highEnergyLimit[proton] = 500. * keV;
     67
     68    G4DNACrossSectionDataSet* tableProton = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor );
     69    tableProton->LoadData(fileProton);
     70     
     71    tableData[proton] = tableProton;
     72  }
     73  else
     74  {
     75    G4Exception("G4CrossSectionIonisationRudd Constructor: proton is not defined");
     76  }
    12377
    12478  if (hydrogenDef != 0)
    125     {
    126       hydrogen = hydrogenDef->GetParticleName();
    127       tableFile[hydrogen] = fileHydrogen;
    128 
    129       // Energy limits
    130       lowEnergyLimit[hydrogen] = 100. * eV;
    131       highEnergyLimit[hydrogen] = 100. * MeV;
    132 
    133       // Create data set with hydrogen cross section data and load values stored in file
    134       G4DNACrossSectionDataSet* tableHydrogen = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor );
    135       tableHydrogen->LoadData(fileHydrogen);
    136      
    137       // Insert key-table pair in map
    138       tableData[hydrogen] = tableHydrogen;
    139     }
    140   else
    141     {
    142       G4Exception("G4CrossSectionIonisationRudd Constructor: hydrogen is not defined");
    143     }
    144 
    145   // Data members for alphaPlusPlus
     79  {
     80    hydrogen = hydrogenDef->GetParticleName();
     81    tableFile[hydrogen] = fileHydrogen;
     82
     83    lowEnergyLimit[hydrogen] = 100. * eV;
     84    highEnergyLimit[hydrogen] = 100. * MeV;
     85
     86    G4DNACrossSectionDataSet* tableHydrogen = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor );
     87    tableHydrogen->LoadData(fileHydrogen);
     88     
     89    tableData[hydrogen] = tableHydrogen;
     90  }
     91  else
     92  {
     93    G4Exception("G4CrossSectionIonisationRudd Constructor: hydrogen is not defined");
     94  }
    14695
    14796  if (alphaPlusPlusDef != 0)
    148     {
    149       alphaPlusPlus = alphaPlusPlusDef->GetParticleName();
    150       tableFile[alphaPlusPlus] = fileAlphaPlusPlus;
    151 
    152       // Energy limits
    153       lowEnergyLimit[alphaPlusPlus] = 1. * keV;
    154       highEnergyLimit[alphaPlusPlus] = 10. * MeV;
    155 
    156       // Create data set with hydrogen cross section data and load values stored in file
    157       G4DNACrossSectionDataSet* tableAlphaPlusPlus = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor );
    158       tableAlphaPlusPlus->LoadData(fileAlphaPlusPlus);
    159      
    160       // Insert key-table pair in map
    161       tableData[alphaPlusPlus] = tableAlphaPlusPlus;
    162     }
    163   else
    164     {
    165       G4Exception("G4CrossSectionIonisationRudd Constructor: alphaPlusPlus is not defined");
    166     }
    167 
    168   // Data members for alphaPlus
     97  {
     98    alphaPlusPlus = alphaPlusPlusDef->GetParticleName();
     99    tableFile[alphaPlusPlus] = fileAlphaPlusPlus;
     100
     101    lowEnergyLimit[alphaPlusPlus] = 1. * keV;
     102    highEnergyLimit[alphaPlusPlus] = 10. * MeV;
     103
     104    G4DNACrossSectionDataSet* tableAlphaPlusPlus = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor );
     105    tableAlphaPlusPlus->LoadData(fileAlphaPlusPlus);
     106     
     107    tableData[alphaPlusPlus] = tableAlphaPlusPlus;
     108  }
     109  else
     110  {
     111    G4Exception("G4CrossSectionIonisationRudd Constructor: alphaPlusPlus is not defined");
     112  }
    169113
    170114  if (alphaPlusDef != 0)
    171     {
    172       alphaPlus = alphaPlusDef->GetParticleName();
    173       tableFile[alphaPlus] = fileAlphaPlus;
    174 
    175       // Energy limits
    176       lowEnergyLimit[alphaPlus] = 1. * keV;
    177       highEnergyLimit[alphaPlus] = 10. * MeV;
    178 
    179       // Create data set with hydrogen cross section data and load values stored in file
    180       G4DNACrossSectionDataSet* tableAlphaPlus = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor );
    181       tableAlphaPlus->LoadData(fileAlphaPlus);
    182      
    183       // Insert key-table pair in map
    184       tableData[alphaPlus] = tableAlphaPlus;
    185     }
    186   else
    187     {
    188       G4Exception("G4CrossSectionIonisationRudd Constructor: alphaPlus is not defined");
    189     }
    190 
    191   // Data members for helium
     115  {
     116    alphaPlus = alphaPlusDef->GetParticleName();
     117    tableFile[alphaPlus] = fileAlphaPlus;
     118
     119    lowEnergyLimit[alphaPlus] = 1. * keV;
     120    highEnergyLimit[alphaPlus] = 10. * MeV;
     121
     122    G4DNACrossSectionDataSet* tableAlphaPlus = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor );
     123    tableAlphaPlus->LoadData(fileAlphaPlus);
     124
     125    tableData[alphaPlus] = tableAlphaPlus;
     126  }
     127  else
     128  {
     129    G4Exception("G4CrossSectionIonisationRudd Constructor: alphaPlus is not defined");
     130  }
    192131
    193132  if (heliumDef != 0)
    194     {
    195       helium = heliumDef->GetParticleName();
    196       tableFile[helium] = fileHelium;
    197 
    198       // Energy limits
    199       lowEnergyLimit[helium] = 1. * keV;
    200       highEnergyLimit[helium] = 10. * MeV;
    201 
    202       // Create data set with hydrogen cross section data and load values stored in file
    203       G4DNACrossSectionDataSet* tableHelium = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor );
    204       tableHelium->LoadData(fileHelium);
    205      
    206       // Insert key-table pair in map
    207       tableData[helium] = tableHelium;
    208     }
    209   else
    210     {
    211       G4Exception("G4CrossSectionIonisationRudd Constructor: helium is not defined");
    212     }
    213 }
    214 
     133  {
     134    helium = heliumDef->GetParticleName();
     135    tableFile[helium] = fileHelium;
     136
     137    lowEnergyLimit[helium] = 1. * keV;
     138    highEnergyLimit[helium] = 10. * MeV;
     139
     140    G4DNACrossSectionDataSet* tableHelium = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor );
     141    tableHelium->LoadData(fileHelium);
     142     
     143    tableData[helium] = tableHelium;
     144  }
     145  else
     146  {
     147    G4Exception("G4CrossSectionIonisationRudd Constructor: helium is not defined");
     148  }
     149}
     150
     151//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    215152
    216153G4CrossSectionIonisationRuddPartial::~G4CrossSectionIonisationRuddPartial()
    217154{
    218   // Destroy the content of the map
    219155  std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos;
    220156  for (pos = tableData.begin(); pos != tableData.end(); ++pos)
    221     {
    222       G4DNACrossSectionDataSet* table = pos->second;
    223       delete table;
    224     }
    225 }
    226 
     157  {
     158    G4DNACrossSectionDataSet* table = pos->second;
     159    delete table;
     160  }
     161}
     162
     163//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    227164
    228165G4int G4CrossSectionIonisationRuddPartial::RandomSelect(G4double k, const G4String& particle )
     
    243180       particle == instance->GetIon("helium")->GetParticleName()
    244181       )
    245     {     
     182  {     
    246183      electronDataset->LoadData("dna/sigma_ionisation_e_born");
    247184
     
    250187      electronComponent = electronDataset->FindValue(kElectron);
    251188       
    252     }     
     189  }     
    253190 
    254191  delete electronDataset;
     
    264201
    265202  if (pos != tableData.end())
    266     {
     203  {
    267204      G4DNACrossSectionDataSet* table = pos->second;
    268205
    269206      if (table != 0)
    270         {
    271           // C-style arrays are used in G4DNACrossSectionDataSet: this design feature was
    272           // introduced without authorization and should be replaced by the use of STL containers
    273            
     207      {
    274208          G4double* valuesBuffer = new G4double[table->NumberOfComponents()];
    275209           
     
    279213           
    280214          while (i>0)
    281             {
     215          {
    282216              i--;
    283217              valuesBuffer[i] = table->GetComponent(i)->FindValue(k);
     
    294228
    295229              value += valuesBuffer[i];
    296             }
     230          }
    297231           
    298232          value *= G4UniformRand();
     
    301235           
    302236          while (i > 0)
    303             {
     237          {
    304238              i--;
    305239               
    306240              if (valuesBuffer[i] > value)
    307                 {
     241              {
    308242                  delete[] valuesBuffer;
    309243                  return i;
    310                 }
     244              }
    311245              value -= valuesBuffer[i];
    312             }
    313            
    314           // It should never end up here
    315 
    316           // ---- MGP ---- Is the following line really necessary? 
     246          }
     247           
    317248          if (valuesBuffer) delete[] valuesBuffer;
    318249           
    319         }
    320     }
    321   else
    322     {
    323       G4Exception("G4CrossSectionIonisationRuddPartial: attempting to calculate cross section for wrong particle");
    324     }
     250      }
     251  }
     252  else
     253  {
     254    G4Exception("G4CrossSectionIonisationRuddPartial: attempting to calculate cross section for wrong particle");
     255  }
    325256     
    326257  return level;
    327258}
    328259
     260//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    329261
    330262G4double G4CrossSectionIonisationRuddPartial::CrossSection(const G4Track& track )
     
    335267  G4double k = particle->GetKineticEnergy();
    336268 
    337   // Cross section = 0 outside the energy validity limits set in the constructor
    338   // ---- MGP ---- Better handling of these limits to be set in a following design iteration
    339 
    340269  G4double lowLim = lowEnergyLimitDefault;
    341270  G4double highLim = highEnergyLimitDefault;
     
    343272  const G4String& particleName = particle->GetDefinition()->GetParticleName();
    344273
    345   // Retrieve energy limits for the current particle type
    346 
    347274  std::map< G4String,G4double,std::less<G4String> >::iterator pos1;
    348275  pos1 = lowEnergyLimit.find(particleName);
    349276
    350   // Lower limit
    351277  if (pos1 != lowEnergyLimit.end())
    352     {
    353       lowLim = pos1->second;
    354     }
    355 
    356   // Upper limit
     278  {
     279    lowLim = pos1->second;
     280  }
     281
    357282  std::map< G4String,G4double,std::less<G4String> >::iterator pos2;
    358283  pos2 = highEnergyLimit.find(particleName);
    359284
    360285  if (pos2 != highEnergyLimit.end())
    361     {
    362       highLim = pos2->second;
    363     }
    364 
    365   // Verify that the current track is within the energy limits of validity of the cross section model
     286  {
     287    highLim = pos2->second;
     288  }
     289
    366290  if (k >= lowLim && k <= highLim)
    367     {
     291  {
    368292      std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos;
    369293      pos = tableData.find(particleName);
    370294       
    371295      if (pos != tableData.end())
    372         {
     296      {
    373297          G4DNACrossSectionDataSet* table = pos->second;
    374298          if (table != 0)
    375             {
    376               // ---- MGP ---- Temporary
    377               // table->PrintData();
    378 
    379               // Cross section
     299          {
    380300              sigma = table->FindValue(k);
    381             }
    382         }
     301          }
     302      }
    383303      else
    384         {
    385           // The track corresponds to a not pertinent particle
     304      {
    386305          G4Exception("G4CrossSectionIonisationRuddPartial: attempting to calculate cross section for wrong particle");
    387         }
    388     }
     306      }
     307  }
    389308
    390309  return sigma;
    391310}
    392311
     312//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    393313
    394314G4double G4CrossSectionIonisationRuddPartial::Sum(G4double /* energy */, const G4String& /* particle */)
    395315{
    396 
    397316  return 0;
    398317}
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionKill.cc

    r819 r961  
    2626//
    2727// $Id: G4CrossSectionKill.cc,v 1.1 2007/11/09 20:26:12 pia Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4DNACrossSectionDataSet.cc

    r819 r961  
    2727
    2828// $Id: G4DNACrossSectionDataSet.cc,v 1.7 2007/11/09 18:06:26 pia Exp $
    29 // GEANT4 tag $Name: $
     29// GEANT4 tag $Name: geant4-09-02-ref-02 $
    3030//
    3131// Author: Riccardo Capra <capra@ge.infn.it>
  • trunk/source/processes/electromagnetic/lowenergy/src/G4DNAGenericIonsManager.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4DNAGenericIonsManager.cc,v 1.4 2006/06/29 19:39:24 gunter Exp $
    28 // GEANT4 tag $Name:  $
     26// $Id: G4DNAGenericIonsManager.cc,v 1.5 2008/07/16 19:01:07 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2928
    3029#include "G4DNAGenericIonsManager.hh"
     
    3231#include "G4Ions.hh"
    3332
    34 G4DNAGenericIonsManager *                G4DNAGenericIonsManager :: Instance(void)
     33//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     34
     35G4DNAGenericIonsManager * G4DNAGenericIonsManager :: Instance(void)
    3536{
    3637 if (!theInstance)
     
    4041}
    4142
    42 G4ParticleDefinition *                   G4DNAGenericIonsManager :: GetIon(const G4String & name)
     43//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     44
     45G4ParticleDefinition * G4DNAGenericIonsManager :: GetIon(const G4String & name)
    4346{
    4447 IonsMap::const_iterator i(map.find(name));
     
    4750  return 0;
    4851 
    49 // return map[name];
    50 
    5152 return i->second;
    5253}
    5354
    54                                          G4DNAGenericIonsManager :: G4DNAGenericIonsManager()
     55//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     56
     57G4DNAGenericIonsManager :: G4DNAGenericIonsManager()
    5558{
    5659 //               name             mass          width         charge
     
    6063 //             stable         lifetime    decay table
    6164
    62 
    6365 G4Ions *helium;
    6466 G4Ions *hydrogen;
    6567 G4Ions *alphaPlus;
     68 G4Ions *positronium1s;
     69 G4Ions *positronium2s;
    6670
    6771 helium=     new G4Ions("helium",    3.727417*GeV,       0.0*MeV,  +0.0*eplus,
     
    8387                               0,               0,             0,
    8488                       "nucleus",              +1,            +1,           0,
    85                       true,            -1.0,             0, false,
     89                        true,            -1.0,             0, false,
     90                              "",               0,             0.0);
     91
     92 positronium1s= new G4Ions("Ps-1s",   2*electron_mass_c2,      0.0*MeV,  +0.0*eplus,
     93                               0,               0,             0,
     94                               0,               0,             0,
     95                       "nucleus",               0,             0,           0,
     96                            true,            -1.0,             0, false,
     97                              "",               0,             0.0);
     98
     99 positronium2s= new G4Ions("Ps-2s",   2*electron_mass_c2,      0.0*MeV,  +0.0*eplus,
     100                               0,               0,             0,
     101                               0,               0,             0,
     102                       "nucleus",               0,             0,           0,
     103                            true,            -1.0,             0, false,
    86104                              "",               0,             0.0);
    87105
     
    90108 map["alpha+"]=alphaPlus;
    91109 map["alpha++"]=G4Alpha::Alpha();
     110 map["Ps-1s"]=positronium1s;
     111 map["Ps-2s"]=positronium2s;
     112
    92113}
    93114
     115//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    94116
    95 G4DNAGenericIonsManager *                G4DNAGenericIonsManager::theInstance(0);
     117G4DNAGenericIonsManager * G4DNAGenericIonsManager::theInstance(0);
    96118   
  • trunk/source/processes/electromagnetic/lowenergy/src/G4DummyFinalState.cc

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

    r819 r961  
    2525//
    2626//
    27 // $Id: G4EMDataSet.cc,v 1.12 2006/06/29 19:39:44 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     27// $Id: G4EMDataSet.cc,v 1.18 2008/03/17 13:40:53 pia Exp $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
     
    4040#include <fstream>
    4141#include <sstream>
    42 
    43                                                  G4EMDataSet :: G4EMDataSet(G4int argZ, G4VDataSetAlgorithm * argAlgorithm, G4double argUnitEnergies, G4double argUnitData)
    44 :
    45  z(argZ),
    46  energies(0),
    47  data(0),
    48  algorithm(argAlgorithm),
    49  unitEnergies(argUnitEnergies),
    50  unitData(argUnitData)
    51 {
    52  if (algorithm == 0)
    53   G4Exception("G4EMDataSet::G4EMDataSet - interpolation == 0");
    54 }
    55 
    56 
    57 
    58                                                  G4EMDataSet :: G4EMDataSet(G4int argZ, G4DataVector * argEnergies, G4DataVector * argData, G4VDataSetAlgorithm * argAlgorithm, G4double argUnitEnergies, G4double argUnitData)
    59 :
    60  z(argZ),
    61  energies(argEnergies),
    62  data(argData),
    63  algorithm(argAlgorithm),
    64  unitEnergies(argUnitEnergies),
    65  unitData(argUnitData)
    66 {
    67  if (algorithm==0)
    68   G4Exception("G4EMDataSet::G4EMDataSet - interpolation == 0");
    69 
    70  if ((energies==0) ^ (data==0))
    71   G4Exception("G4EMDataSet::G4EMDataSet - different size for energies and data (zero case)");
    72 
    73  if (energies==0)
    74   return;
    75  
    76  if (energies->size()!=data->size())
    77   G4Exception("G4EMDataSet::G4EMDataSet - different size for energies and data");
    78 }
    79 
    80 
    81 
    82                                                  G4EMDataSet :: ~G4EMDataSet()
     42#include "G4Integrator.hh"
     43#include "Randomize.hh"
     44#include "G4LinInterpolation.hh"
     45
     46
     47G4EMDataSet::G4EMDataSet(G4int Z,
     48                         G4VDataSetAlgorithm* algo,
     49                         G4double xUnit,
     50                         G4double yUnit,
     51                         G4bool random):
     52  z(Z),
     53  energies(0),
     54  data(0),
     55  algorithm(algo),
     56  unitEnergies(xUnit),
     57  unitData(yUnit),
     58  pdf(0),
     59  randomSet(random)
     60{
     61  if (algorithm == 0) G4Exception("G4EMDataSet::G4EMDataSet - interpolation == 0");
     62  if (randomSet) BuildPdf();
     63}
     64
     65G4EMDataSet::G4EMDataSet(G4int argZ,
     66                         G4DataVector* dataX,
     67                         G4DataVector* dataY,
     68                         G4VDataSetAlgorithm* algo,
     69                         G4double xUnit,
     70                         G4double yUnit,
     71                         G4bool random):
     72  z(argZ),
     73  energies(dataX),
     74  data(dataY),
     75  algorithm(algo),
     76  unitEnergies(xUnit),
     77  unitData(yUnit),
     78  pdf(0),
     79  randomSet(random)
     80{
     81  if (algorithm == 0) G4Exception("G4EMDataSet::G4EMDataSet - interpolation == 0");
     82
     83  if ((energies == 0) ^ (data == 0))
     84    G4Exception("G4EMDataSet::G4EMDataSet - different size for energies and data (zero case)");
     85
     86  if (energies == 0) return;
     87 
     88  if (energies->size() != data->size())
     89    G4Exception("G4EMDataSet::G4EMDataSet - different size for energies and data");
     90
     91  if (randomSet) BuildPdf();
     92}
     93
     94G4EMDataSet::~G4EMDataSet()
    8395{
    84  delete algorithm;
    85  
    86  if (energies)
    87   delete energies;
    88 
    89  if (data)
    90   delete data;
    91 }
    92 
    93 
    94 
    95 
    96 
    97 G4double                                        G4EMDataSet :: FindValue(G4double argEnergy, G4int /* argComponentId */) const
    98 {
    99  if (!energies)
    100   G4Exception("G4EMDataSet::FindValue - energies == 0");
    101  
    102  if (energies->empty())
    103   return 0;
    104 
    105  if (argEnergy <= (*energies)[0])
    106   return (*data)[0];
    107 
    108  size_t i(energies->size()-1);
    109 
    110  if (argEnergy >= (*energies)[i])
    111   return (*data)[i];
    112 
    113  return algorithm->Calculate(argEnergy, FindLowerBound(argEnergy), *energies, *data);
    114 }
    115 
    116 
    117 
    118 
    119 
    120 void                                            G4EMDataSet :: PrintData(void) const
    121 {
    122  if (!energies)
    123  {
    124   G4cout << "Data not available." << G4endl;
    125   return;
    126  }
    127  
    128  size_t size = energies->size();
    129  
    130  for (size_t i(0); i<size; i++)
    131   G4cout << "Point: " << ((*energies)[i]/unitEnergies)
    132          << " - Data value : " << ((*data)[i]/unitData) << G4endl;
    133 }
    134 
    135 
    136 
    137 
    138 
    139 void                                            G4EMDataSet :: SetEnergiesData(G4DataVector * argEnergies, G4DataVector * argData, G4int /* argComponentId */)
    140 {
    141  if (energies)
    142   delete energies;
    143  energies=argEnergies;
    144 
    145  if (data)
    146   delete data;
    147  data=argData;
    148  
    149  if ((energies==0) ^ (data==0))
    150   G4Exception("G4EMDataSet::SetEnergiesData - different size for energies and data (zero case)");
    151 
    152  if (energies==0)
    153   return;
    154  
    155  if (energies->size()!=data->size())
    156   G4Exception("G4EMDataSet::SetEnergiesData - different size for energies and data");
    157 }
    158 
    159 
    160 
    161 
    162 
    163 G4bool                                          G4EMDataSet :: LoadData(const G4String & argFileName)
    164 {
    165  // The file is organized into two columns:
    166  // 1st column is the energy
    167  // 2nd column is the corresponding value
    168  // The file terminates with the pattern: -1   -1
    169  //                                       -2   -2
    170  
    171  G4String fullFileName(FullFileName(argFileName));
    172  std::ifstream in(fullFileName);
    173 
    174  if (!in.is_open())
    175  {
    176   G4String message("G4EMDataSet::LoadData - data file \"");
    177   message+=fullFileName;
    178   message+="\" not found";
    179   G4Exception(message);
    180  }
    181 
    182  G4DataVector * argEnergies=new G4DataVector;
    183  G4DataVector * argData=new G4DataVector;
    184 
    185  G4double a;
    186  bool energyColumn(true);
    187 
    188  do
    189  {
    190   in >> a;
    191  
    192   if (a!=-1 && a!=-2)
    193   {
    194    if (energyColumn)
    195     argEnergies->push_back(a*unitEnergies);
    196    else
    197     argData->push_back(a*unitData);
    198    energyColumn=(!energyColumn);
    199   }
    200  }
    201  while (a != -2);
    202  
    203  SetEnergiesData(argEnergies, argData, 0);
    204  
    205  return true;
    206 }
    207 
    208 
    209 
    210 G4bool                                          G4EMDataSet :: SaveData(const G4String & argFileName) const
    211 {
    212  // The file is organized into two columns:
    213  // 1st column is the energy
    214  // 2nd column is the corresponding value
    215  // The file terminates with the pattern: -1   -1
    216  //                                       -2   -2
    217  
    218  G4String fullFileName(FullFileName(argFileName));
    219  std::ofstream out(fullFileName);
    220 
    221  if (!out.is_open())
    222  {
    223   G4String message("G4EMDataSet::SaveData - cannot open \"");
    224   message+=fullFileName;
    225   message+="\"";
    226   G4Exception(message);
    227  }
    228  
    229  out.precision(10);
    230  out.width(15);
    231  out.setf(std::ofstream::left);
    232  
    233  if (energies!=0 && data!=0)
    234  {
    235   G4DataVector::const_iterator i(energies->begin());
    236   G4DataVector::const_iterator endI(energies->end());
    237   G4DataVector::const_iterator j(data->begin());
    238  
    239   while (i!=endI)
    240   {
    241    out.precision(10);
    242    out.width(15);
    243    out.setf(std::ofstream::left);
    244    out << ((*i)/unitEnergies) << ' ';
    245 
    246    out.precision(10);
    247    out.width(15);
    248    out.setf(std::ofstream::left);
    249    out << ((*j)/unitData) << std::endl;
    250 
    251    i++;
    252    j++;
    253   }
    254  }
    255  
    256  out.precision(10);
    257  out.width(15);
    258  out.setf(std::ofstream::left);
    259  out << -1.f << ' ';
    260 
    261  out.precision(10);
    262  out.width(15);
    263  out.setf(std::ofstream::left);
    264  out << -1.f << std::endl;
    265 
    266  out.precision(10);
    267  out.width(15);
    268  out.setf(std::ofstream::left);
    269  out << -2.f << ' ';
    270 
    271  out.precision(10);
    272  out.width(15);
    273  out.setf(std::ofstream::left);
    274  out << -2.f << std::endl;
    275 
    276  return true;
    277 }
    278 
    279 
    280 
    281 
    282 
    283 size_t                                          G4EMDataSet :: FindLowerBound(G4double argEnergy) const
    284 {
    285  size_t lowerBound(0);
    286  size_t upperBound(energies->size() - 1);
    287  
    288  while (lowerBound <= upperBound)
    289  {
    290   size_t midBin((lowerBound + upperBound)/2);
    291 
    292   if (argEnergy < (*energies)[midBin])
    293    upperBound = midBin-1;
     96  delete algorithm;
     97  if (energies) delete energies;
     98  if (data) delete data;
     99  if (pdf) delete pdf;
     100}
     101
     102G4double G4EMDataSet::FindValue(G4double energy, G4int /* componentId */) const
     103{
     104  if (!energies) G4Exception("G4EMDataSet::FindValue - energies == 0");
     105  if (energies->empty()) return 0;
     106  if (energy <= (*energies)[0]) return (*data)[0];
     107
     108  size_t i = energies->size()-1;
     109  if (energy >= (*energies)[i]) return (*data)[i];
     110
     111  return algorithm->Calculate(energy, FindLowerBound(energy), *energies, *data);
     112}
     113
     114
     115void G4EMDataSet::PrintData(void) const
     116{
     117  if (!energies)
     118    {
     119      G4cout << "Data not available." << G4endl;
     120    }
    294121  else
    295    lowerBound = midBin+1;
    296  }
    297  
    298  return upperBound;
    299 }
    300 
    301 
    302 
    303 
    304 
    305 G4String                                        G4EMDataSet :: FullFileName(const G4String & argFileName) const
    306 {
    307  char* path = getenv("G4LEDATA");
    308  if (!path)
    309   G4Exception("G4EMDataSet::FullFileName - G4LEDATA environment variable not set");
    310  
    311  std::ostringstream fullFileName;
    312  
    313  fullFileName << path << '/' << argFileName << z << ".dat";
     122    {
     123      size_t size = energies->size();
     124      for (size_t i(0); i<size; i++)
     125        {
     126          G4cout << "Point: " << ((*energies)[i]/unitEnergies)
     127                 << " - Data value: " << ((*data)[i]/unitData);
     128          if (pdf != 0) G4cout << " - PDF : " << (*pdf)[i];
     129          G4cout << G4endl;
     130        }
     131    }
     132}
     133
     134
     135void G4EMDataSet::SetEnergiesData(G4DataVector* dataX,
     136                                  G4DataVector* dataY,
     137                                  G4int /* componentId */)
     138{
     139  if (energies) delete energies;
     140  energies = dataX;
     141
     142  if (data) delete data;
     143  data = dataY;
     144 
     145  if ((energies == 0) ^ (data==0))
     146    G4Exception("G4EMDataSet::SetEnergiesData - different size for energies and data (zero case)");
     147
     148  if (energies == 0) return;
     149 
     150  if (energies->size() != data->size())
     151    G4Exception("G4EMDataSet::SetEnergiesData - different size for energies and data");
     152}
     153
     154G4bool G4EMDataSet::LoadData(const G4String& fileName)
     155{
     156  // The file is organized into two columns:
     157  // 1st column is the energy
     158  // 2nd column is the corresponding value
     159  // The file terminates with the pattern: -1   -1
     160  //                                       -2   -2
     161 
     162  G4String fullFileName(FullFileName(fileName));
     163  std::ifstream in(fullFileName);
     164
     165  if (!in.is_open())
     166    {
     167      G4String message("G4EMDataSet::LoadData - data file \"");
     168      message += fullFileName;
     169      message += "\" not found";
     170      G4Exception(message);
     171    }
     172
     173  G4DataVector* argEnergies=new G4DataVector;
     174  G4DataVector* argData=new G4DataVector;
     175
     176  G4double a;
     177  bool energyColumn(true);
     178
     179  do
     180    {
     181      in >> a;
     182 
     183      if (a!=-1 && a!=-2)
     184        {
     185          if (energyColumn)
     186            argEnergies->push_back(a*unitEnergies);
     187          else
     188            argData->push_back(a*unitData);
     189          energyColumn=(!energyColumn);
     190        }
     191    }
     192  while (a != -2);
     193 
     194  SetEnergiesData(argEnergies, argData, 0);
     195  if (randomSet) BuildPdf();
     196 
     197  return true;
     198}
     199
     200G4bool G4EMDataSet::SaveData(const G4String& name) const
     201{
     202  // The file is organized into two columns:
     203  // 1st column is the energy
     204  // 2nd column is the corresponding value
     205  // The file terminates with the pattern: -1   -1
     206  //                                       -2   -2
     207 
     208  G4String fullFileName(FullFileName(name));
     209  std::ofstream out(fullFileName);
     210
     211  if (!out.is_open())
     212    {
     213      G4String message("G4EMDataSet::SaveData - cannot open \"");
     214      message+=fullFileName;
     215      message+="\"";
     216      G4Exception(message);
     217    }
     218 
     219  out.precision(10);
     220  out.width(15);
     221  out.setf(std::ofstream::left);
     222 
     223  if (energies!=0 && data!=0)
     224    {
     225      G4DataVector::const_iterator i(energies->begin());
     226      G4DataVector::const_iterator endI(energies->end());
     227      G4DataVector::const_iterator j(data->begin());
     228 
     229      while (i!=endI)
     230        {
     231          out.precision(10);
     232          out.width(15);
     233          out.setf(std::ofstream::left);
     234          out << ((*i)/unitEnergies) << ' ';
     235
     236          out.precision(10);
     237          out.width(15);
     238          out.setf(std::ofstream::left);
     239          out << ((*j)/unitData) << std::endl;
     240
     241          i++;
     242          j++;
     243        }
     244    }
     245 
     246  out.precision(10);
     247  out.width(15);
     248  out.setf(std::ofstream::left);
     249  out << -1.f << ' ';
     250
     251  out.precision(10);
     252  out.width(15);
     253  out.setf(std::ofstream::left);
     254  out << -1.f << std::endl;
     255
     256  out.precision(10);
     257  out.width(15);
     258  out.setf(std::ofstream::left);
     259  out << -2.f << ' ';
     260
     261  out.precision(10);
     262  out.width(15);
     263  out.setf(std::ofstream::left);
     264  out << -2.f << std::endl;
     265
     266  return true;
     267}
     268
     269size_t G4EMDataSet::FindLowerBound(G4double x) const
     270{
     271  size_t lowerBound = 0;
     272  size_t upperBound(energies->size() - 1);
     273 
     274  while (lowerBound <= upperBound)
     275    {
     276      size_t midBin((lowerBound + upperBound) / 2);
     277
     278      if (x < (*energies)[midBin]) upperBound = midBin - 1;
     279      else lowerBound = midBin + 1;
     280    }
     281 
     282  return upperBound;
     283}
     284
     285
     286size_t G4EMDataSet::FindLowerBound(G4double x, G4DataVector* values) const
     287{
     288  size_t lowerBound = 0;;
     289  size_t upperBound(values->size() - 1);
     290 
     291  while (lowerBound <= upperBound)
     292    {
     293      size_t midBin((lowerBound + upperBound) / 2);
     294
     295      if (x < (*values)[midBin]) upperBound = midBin - 1;
     296      else lowerBound = midBin + 1;
     297    }
     298 
     299  return upperBound;
     300}
     301
     302
     303G4String G4EMDataSet::FullFileName(const G4String& name) const
     304{
     305  char* path = getenv("G4LEDATA");
     306  if (!path)
     307    G4Exception("G4EMDataSet::FullFileName - G4LEDATA environment variable not set");
     308 
     309  std::ostringstream fullFileName;
     310  fullFileName << path << '/' << name << z << ".dat";
    314311                     
    315  return G4String(fullFileName.str().c_str());
    316 }
     312  return G4String(fullFileName.str().c_str());
     313}
     314
     315
     316void G4EMDataSet::BuildPdf()
     317{
     318  pdf = new G4DataVector;
     319  G4Integrator <G4EMDataSet, G4double(G4EMDataSet::*)(G4double)> integrator;
     320
     321  G4int nData = data->size();
     322  pdf->push_back(0.);
     323
     324  // Integrate the data distribution
     325  G4int i;
     326  G4double totalSum = 0.;
     327  for (i=1; i<nData; i++)
     328    {
     329      G4double xLow = (*energies)[i-1];
     330      G4double xHigh = (*energies)[i];
     331      G4double sum = integrator.Legendre96(this, &G4EMDataSet::IntegrationFunction, xLow, xHigh);
     332      totalSum = totalSum + sum;
     333      pdf->push_back(totalSum);
     334    }
     335
     336  // Normalize to the last bin
     337  G4double tot = 0.;
     338  if (totalSum > 0.) tot = 1. / totalSum;
     339  for (i=1;  i<nData; i++)
     340    {
     341      (*pdf)[i] = (*pdf)[i] * tot;
     342    }
     343}
     344
     345
     346G4double G4EMDataSet::RandomSelect(G4int /* componentId */) const
     347{
     348  // Random select a X value according to the cumulative probability distribution
     349  // derived from the data
     350
     351  if (!pdf) G4Exception("G4EMDataSet::RandomSelect - PDF has not been created for this data set");
     352
     353  G4double value = 0.;
     354  G4double x = G4UniformRand();
     355
     356  // Locate the random value in the X vector based on the PDF
     357  size_t bin = FindLowerBound(x,pdf);
     358
     359  // Interpolate the PDF to calculate the X value:
     360  // linear interpolation in the first bin (to avoid problem with 0),
     361  // interpolation with associated data set algorithm in other bins
     362
     363  G4LinInterpolation linearAlgo;
     364  if (bin == 0) value = linearAlgo.Calculate(x, bin, *pdf, *energies);
     365  else value = algorithm->Calculate(x, bin, *pdf, *energies);
     366
     367  //  G4cout << x << " random bin "<< bin << " - " << value << G4endl;
     368  return value;
     369}
     370
     371G4double G4EMDataSet::IntegrationFunction(G4double x)
     372{
     373  // This function is needed by G4Integrator to calculate the integral of the data distribution
     374
     375  G4double y = 0;
     376
     377 // Locate the random value in the X vector based on the PDF
     378  size_t bin = FindLowerBound(x);
     379
     380  // Interpolate to calculate the X value:
     381  // linear interpolation in the first bin (to avoid problem with 0),
     382  // interpolation with associated algorithm in other bins
     383
     384  G4LinInterpolation linearAlgo;
     385 
     386  if (bin == 0) y = linearAlgo.Calculate(x, bin, *energies, *data);
     387  else y = algorithm->Calculate(x, bin, *energies, *data);
     388 
     389  return y;
     390}
     391
  • trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateChargeDecrease.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4FinalStateChargeDecrease.cc,v 1.2 2007/11/09 20:11:04 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // Reference: TNS Geant4-DNA paper
    33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    34 
    35 // History:
    36 // -----------
    37 // Date         Name              Modification
    38 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    39 //
    40 // -------------------------------------------------------------------
    41 
    42 // Class description:
    43 // Reference: TNS Geant4-DNA paper
    44 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    45 // design foundation and implementation of the first set of models,
    46 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    47 // Further documentation available from http://www.ge.infn.it/geant4/dna
    48 
    49 // -------------------------------------------------------------------
    50 
     26// $Id: G4FinalStateChargeDecrease.cc,v 1.4 2009/01/20 07:50:28 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5128
    5229#include "G4FinalStateChargeDecrease.hh"
    53 #include "G4Track.hh"
    54 #include "G4Step.hh"
    55 #include "G4DynamicParticle.hh"
    56 //#include "Randomize.hh"
    5730
    58 #include "G4ParticleTypes.hh"
    59 #include "G4ParticleDefinition.hh"
    60 #include "G4SystemOfUnits.hh"
    61 //#include "G4ParticleMomentum.hh"
    62 #include "G4DNAGenericIonsManager.hh"
     31//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    6332
    6433G4FinalStateChargeDecrease::G4FinalStateChargeDecrease()
    6534{
    66   name = "ChargeDecrease";
    6735  lowEnergyLimit = 1 * keV;
    6836  highEnergyLimit = 10 * MeV;
    6937}
    7038
     39//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    7140
    7241G4FinalStateChargeDecrease::~G4FinalStateChargeDecrease()
    7342{}
    7443 
     44//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    7545
    7646const G4FinalStateProduct& G4FinalStateChargeDecrease::GenerateFinalState(const G4Track& track, const G4Step& /* step */)
    7747{
    78   // Clear previous secondaries, energy deposit and particle kill status
    7948  product.Clear();
    8049
     
    9564 
    9665  if (outK<0)
    97     {
    98       G4String message;
    99       message="ChargeDecreaseDingfelder::GenerateFinalState - Final kinetic energy is below 0! Process ";
    100       G4Exception(message);
    101     }
     66  {
     67    G4String message;
     68    message="ChargeDecreaseDingfelder::GenerateFinalState - Final kinetic energy is below 0! Process ";
     69    G4Exception(message);
     70  }
    10271 
    103   // Primary particle
     72  //SI - Added protection against total energy deposit
     73  product.DoNotDepositEnergy();
     74  //
    10475  product.KillPrimaryParticle();
     76
    10577  product.AddEnergyDeposit(waterBindingEnergy);
    106  
    107   //Secondary particle
     78
    10879  G4DynamicParticle* aSecondary = new G4DynamicParticle(OutgoingParticleDefinition(definition, finalStateIndex),
    10980                                                        track.GetDynamicParticle()->GetMomentumDirection(),
     
    11485  return product;
    11586}
     87
     88//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    11689
    11790G4int G4FinalStateChargeDecrease::NumberOfFinalStates(G4ParticleDefinition* particleDefinition,
     
    12598 
    12699  if (particleDefinition == instance->GetIon("alpha++") )
    127     {
    128       if (finalStateIndex==0)  return 1;
    129       return 2;   
    130     }
     100  {
     101    if (finalStateIndex==0)  return 1;
     102    return 2;   
     103  }
    131104 
    132105  if (particleDefinition == instance->GetIon("alpha+") ) return 1;
     
    135108}
    136109
     110//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    137111
    138112G4ParticleDefinition* G4FinalStateChargeDecrease::OutgoingParticleDefinition (G4ParticleDefinition* particleDefinition,
     
    144118 
    145119  if (particleDefinition == instance->GetIon("alpha++") )
    146     {
    147       if (finalStateIndex == 0) return instance->GetIon("alpha+");
    148 
    149       return instance->GetIon("helium");   
    150     }
     120  {
     121    if (finalStateIndex == 0) return instance->GetIon("alpha+");
     122    return instance->GetIon("helium");   
     123  }
    151124 
    152125  if (particleDefinition == instance->GetIon("alpha+") ) return instance->GetIon("helium");   
     
    155128}
    156129
     130//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    157131
    158132G4double G4FinalStateChargeDecrease::WaterBindingEnergyConstant(G4ParticleDefinition* particleDefinition,
     
    168142
    169143  if (particleDefinition == instance->GetIon("alpha++") )
    170     {
     144  {
    171145      // Binding energy for    W+ -> W++ + e-    10.79 eV
    172146      // Binding energy for    W  -> W+  + e-    10.79 eV
     
    178152 
    179153      return 10.79*2*eV;
    180     }
     154  }
    181155
    182156  if (particleDefinition == instance->GetIon("alpha+") )
    183     {
     157  {
    184158      // Binding energy for    W+ -> W++ + e-    10.79 eV
    185159      // Binding energy for    W  -> W+  + e-    10.79 eV
     
    189163
    190164      return 10.79*eV;
    191     }
     165  }
    192166 
    193167  return 0;
    194168}
    195169
     170//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    196171
    197172G4double G4FinalStateChargeDecrease::OutgoingParticleBindingEnergyConstant(G4ParticleDefinition* particleDefinition,
     
    203178
    204179  if (particleDefinition == instance->GetIon("alpha++") )
    205     {
     180  {
    206181      // Binding energy for    He+ -> He++ + e-    54.509 eV
    207182      // Binding energy for    He  -> He+  + e-    24.587 eV
     
    210185     
    211186      return (54.509 + 24.587)*eV;
    212     }
     187  }
    213188 
    214189  if (particleDefinition == instance->GetIon("alpha+") )
    215     {
     190  {
    216191      // Binding energy for    He+ -> He++ + e-    54.509 eV
    217192      // Binding energy for    He  -> He+  + e-    24.587 eV
    218193     
    219194      return 24.587*eV;
    220    
     195 
    221196 
    222197  return 0;
  • trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateChargeIncrease.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4FinalStateChargeIncrease.cc,v 1.2 2007/11/09 20:11:04 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // Reference: TNS Geant4-DNA paper
    33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    34 
    35 // History:
    36 // -----------
    37 // Date         Name              Modification
    38 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    39 //
    40 // -------------------------------------------------------------------
    41 
    42 // Class description:
    43 // Reference: TNS Geant4-DNA paper
    44 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    45 // design foundation and implementation of the first set of models,
    46 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    47 // Further documentation available from http://www.ge.infn.it/geant4/dna
    48 
    49 // -------------------------------------------------------------------
    50 
     26// $Id: G4FinalStateChargeIncrease.cc,v 1.4 2009/01/20 07:50:28 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5128
    5229#include "G4FinalStateChargeIncrease.hh"
    53 #include "G4Track.hh"
    54 #include "G4Step.hh"
    55 #include "G4DynamicParticle.hh"
    56 #include "Randomize.hh"
    57 #include "G4Electron.hh"
    58 #include "G4ParticleTypes.hh"
    59 #include "G4ParticleDefinition.hh"
    60 #include "G4SystemOfUnits.hh"
    61 #include "G4ParticleMomentum.hh"
    62 #include "G4DNAGenericIonsManager.hh"
     30
     31//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    6332
    6433G4FinalStateChargeIncrease::G4FinalStateChargeIncrease()
    6534{
    66   name = "ChargeIncrease";
    6735  lowEnergyLimit = 1 * keV;
    6836  highEnergyLimit = 10 * MeV;
    6937}
    7038
     39//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    7140
    7241G4FinalStateChargeIncrease::~G4FinalStateChargeIncrease()
    7342{}
    7443 
     44//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    7545
    7646const G4FinalStateProduct& G4FinalStateChargeIncrease::GenerateFinalState(const G4Track& track, const G4Step& /* step */)
    7747{
    78   // Clear previous secondaries, energy deposit and particle kill status
    7948  product.Clear();
    8049
    81   // Primary particle
     50  //SI - Added protection against total energy deposit
     51  product.DoNotDepositEnergy();
     52  //
    8253  product.KillPrimaryParticle();
    8354  product.AddEnergyDeposit(0.);
     55
    8456  G4ParticleDefinition* definition = track.GetDefinition();
    8557 
    86   // Secondaries
    8758  G4double inK = track.GetDynamicParticle()->GetKineticEnergy();
    8859 
     
    10071 
    10172  if (outK<0)
    102     {
    103       G4String message;
    104       message="G4FinalStateChargeIncrease - Final kinetic energy is below 0! Process ";
    105     }
     73  {
     74    G4String message;
     75    message="G4FinalStateChargeIncrease - Final kinetic energy is below 0! Process ";
     76  }
    10677 
    10778  product.AddSecondary(new G4DynamicParticle(OutgoingParticleDefinition(definition,finalStateIndex),
     
    11283 
    11384  while (n>0)
    114     {
    115       n--;
    116    
    117       product.AddSecondary
     85  {
     86    n--;
     87    product.AddSecondary
    11888        (new G4DynamicParticle(G4Electron::Electron(), track.GetDynamicParticle()->GetMomentumDirection(), electronK));
    119     }
     89  }
    12090       
    12191  return product;
    12292}
     93
     94//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    12395
    12496G4int G4FinalStateChargeIncrease::NumberOfFinalStates(G4ParticleDefinition* particleDefinition,
     
    132104 
    133105  if (particleDefinition == instance->GetIon("helium"))
    134     {    if (finalStateIndex==0) return 2;
    135     return 3;
    136     }
     106  {    if (finalStateIndex==0) return 2;
     107       return 3;
     108  }
    137109  return 0;
    138110}
    139111
     112//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    140113
    141114G4ParticleDefinition*  G4FinalStateChargeIncrease::OutgoingParticleDefinition (G4ParticleDefinition* particleDefinition,
     
    163136 
    164137  if(particleDefinition == instance->GetIon("alpha+"))
    165     {
     138  {
    166139      // Binding energy for    He+ -> He++ + e-    54.509 eV
    167140      // Binding energy for    He  -> He+  + e-    24.587 eV
    168141      return 54.509*eV;
    169     }
     142  }
    170143   
    171144  if(particleDefinition == instance->GetIon("helium"))
    172     {
     145  {
    173146      // Binding energy for    He+ -> He++ + e-    54.509 eV
    174147      // Binding energy for    He  -> He+  + e-    24.587 eV
     
    176149      if (finalStateIndex==0) return 24.587*eV;
    177150      return (54.509 + 24.587)*eV;
    178    
     151 
    179152
    180153  return 0;
    181154}
    182 
    183 
  • trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateElasticBrennerZaider.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4FinalStateElasticBrennerZaider.cc,v 1.1 2007/10/12 23:11:41 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // Reference: TNS Geant4-DNA paper
    33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    34 
    35 // History:
    36 // -----------
    37 // Date         Name              Modification
    38 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    39 //
    40 // -------------------------------------------------------------------
    41 
    42 // Class description:
    43 // Reference: TNS Geant4-DNA paper
    44 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    45 // design foundation and implementation of the first set of models,
    46 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    47 // Further documentation available from http://www.ge.infn.it/geant4/dna
    48 
    49 // -------------------------------------------------------------------
    50 
     26// $Id: G4FinalStateElasticBrennerZaider.cc,v 1.8 2008/12/05 11:58:16 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5128
    5229#include "G4FinalStateElasticBrennerZaider.hh"
    53 #include "G4Track.hh"
    54 #include "G4Step.hh"
    55 #include "G4DynamicParticle.hh"
    56 #include "Randomize.hh"
    5730
    58 #include "G4ParticleTypes.hh"
    59 #include "G4ParticleDefinition.hh"
    60 #include "G4Electron.hh"
    61 #include "G4SystemOfUnits.hh"
    62 #include "G4ParticleMomentum.hh"
     31//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    6332
    6433G4FinalStateElasticBrennerZaider::G4FinalStateElasticBrennerZaider()
    6534{
    66   // These data members will be used in the next implementation iteration,
    67   // when the enriched PhysicsModel policy is implemented
    68   name = "FinalStateElasticBrennerZaider";
    69   lowEnergyLimit = 7.4 * eV;
    70   highEnergyLimit = 10 * MeV;
     35  lowEnergyLimit = 8.23 * eV; // SI : i/o of 7.4 * eV;
     36  highEnergyLimit = 200 * eV;
    7137
    7238  betaCoeff.push_back(7.51525);
     
    10066}
    10167
     68//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    10269
    10370G4FinalStateElasticBrennerZaider::~G4FinalStateElasticBrennerZaider()
    104 {
    105   // empty
    106   // G4DynamicParticle objects produced are owned by client
    107 }
    108  
     71{}
     72
     73//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    10974
    11075const G4FinalStateProduct& G4FinalStateElasticBrennerZaider::GenerateFinalState(const G4Track& track, const G4Step& /* step */)
    11176{
    112   // Clear previous secondaries, energy deposit and particle kill status
    11377  product.Clear();
    11478
    115   // Kinetic energy of primary particle
    11679  G4double k = track.GetDynamicParticle()->GetKineticEnergy();
     80 
     81  if ( k>= lowEnergyLimit && k<=highEnergyLimit )
     82  {
     83    G4double cosTheta = RandomizeCosTheta(k);
     84 
     85    G4double phi = 2. * pi * G4UniformRand();
    11786
    118   // Assume material = water; H2O number of electrons
    119   // ---- MGP ---- To be generalized later
    120   // const G4int z = 10;
     87    G4ThreeVector zVers = track.GetDynamicParticle()->GetMomentumDirection();
     88    G4ThreeVector xVers = zVers.orthogonal();
     89    G4ThreeVector yVers = zVers.cross(xVers);
    12190
    122   G4double cosTheta = RandomizeCosTheta(k);
     91    G4double xDir = std::sqrt(1. - cosTheta*cosTheta);
     92    G4double yDir = xDir;
     93    xDir *= std::cos(phi);
     94    yDir *= std::sin(phi);
     95
     96    G4ThreeVector zPrimeVers((xDir*xVers + yDir*yVers + cosTheta*zVers));
     97
     98    product.ModifyPrimaryParticle(zPrimeVers,k);
     99  }
     100
     101  if (k<lowEnergyLimit)
     102  {
     103    product.KillPrimaryParticle();
     104  }
    123105 
    124   G4double phi = 2. * pi * G4UniformRand();
    125 
    126   // G4cout << "cosTheta in GenerateFinalState = " << cosTheta << ", phi = " << phi << G4endl;
    127 
    128   G4ThreeVector zVers = track.GetDynamicParticle()->GetMomentumDirection();
    129   G4ThreeVector xVers = zVers.orthogonal();
    130   G4ThreeVector yVers = zVers.cross(xVers);
    131 
    132   G4double xDir = std::sqrt(1. - cosTheta*cosTheta);
    133   G4double yDir = xDir;
    134   xDir *= std::cos(phi);
    135   yDir *= std::sin(phi);
    136 
    137   // G4cout << "xDir, yDir = " << xDir <<", " << yDir << G4endl;
    138 
    139   // G4ThreeVector zPrimeVers((xDir*xVers + yDir*yVers + cosTheta*zVers).unit());
    140   G4ThreeVector zPrimeVers((xDir*xVers + yDir*yVers + cosTheta*zVers));
    141 
    142   // G4cout << "zPrimeVers = (" << zPrimeVers.x() << ", "<< zPrimeVers.y() << ", "<< zPrimeVers.z() << ") " << G4endl;
    143 
    144   //  product.ModifyPrimaryParticle(zPrimeVers.x(),zPrimeVers.y(),zPrimeVers.z(),k);
    145   product.ModifyPrimaryParticle(zPrimeVers,k);
    146 
    147   //  this->aParticleChange.ProposeEnergy(k);
    148   //  this->aParticleChange.ProposeMomentumDirection(zPrimeVers);
    149   //  this->aParticleChange.SetNumberOfSecondaries(0);
    150 
    151106  return product;
    152107}
     108
     109//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    153110
    154111G4double G4FinalStateElasticBrennerZaider::RandomizeCosTheta(G4double k)
     
    158115  //   d Omega           (1 + 2 gamma(K) - cos(theta))^2     (1 + 2 delta(K) + cos(theta))^2
    159116  //
    160   // Maximum is < 1/(4 gamma(K)^2) + beta(K)/(4 delta(K)^2)
     117  // Maximum is < 1/(4 gamma(K)^2) + beta(K)/((2+2delta(K))^2)
    161118  //
    162119  // Phys. Med. Biol. 29 N.4 (1983) 443-447
    163120 
    164121  // gamma(K), beta(K) and delta(K) are polynomials with coefficients for energy measured in eV
     122
    165123  k /= eV;
    166124 
    167125  G4double beta = std::exp(CalculatePolynomial(k,betaCoeff));
    168126  G4double delta = std::exp(CalculatePolynomial(k,deltaCoeff));
     127  G4double gamma;
    169128 
    170   G4double gamma;
    171129  if (k > 100.)
    172     {
    173       gamma = CalculatePolynomial(k, gamma100_200Coeff); // Only in this case it is not the exponent of the polynomial
    174     } 
     130  {
     131      gamma = CalculatePolynomial(k, gamma100_200Coeff);
     132      // Only in this case it is not the exponent of the polynomial
     133  } 
    175134  else
    176     {
     135  {
     136      if (k>10)
     137      {
     138          gamma = std::exp(CalculatePolynomial(k, gamma10_100Coeff));
     139      }
     140      else
     141      {
     142          gamma = std::exp(CalculatePolynomial(k, gamma035_10Coeff));
     143      }
     144  }
    177145
    178       if (k>10)
    179         {
    180           gamma = std::exp(CalculatePolynomial(k, gamma10_100Coeff));
    181         }
    182       else
    183         {
    184           gamma = std::exp(CalculatePolynomial(k, gamma035_10Coeff));
    185         }
    186     }
    187  
    188   // G4cout << "beta = " << beta << ", gamma = " << gamma << ", delta = " << delta << G4endl;
    189 
    190   G4double oneOverMax = 1. / (1./(4.*gamma*gamma) + beta/(4.*delta*delta));
     146  G4double oneOverMax = 1. / (1./(4.*gamma*gamma) + beta/( (2.+2.*delta)*(2.+2.*delta) ));
    191147 
    192148  G4double cosTheta = 0.;
     
    196152 
    197153  do
    198     {
     154  {
    199155      cosTheta = 2. * G4UniformRand() - 1.;
    200       leftDenominator = (1 + 2.*gamma - cosTheta);
    201       rightDenominator = (1 + 2.*delta + cosTheta);
    202       fCosTheta = oneOverMax * (1./(leftDenominator*leftDenominator) + beta/(rightDenominator*rightDenominator));
    203     }
     156      leftDenominator = (1. + 2.*gamma - cosTheta);
     157      rightDenominator = (1. + 2.*delta + cosTheta);
     158      if ( (leftDenominator * rightDenominator) != 0. )
     159      {
     160          fCosTheta = oneOverMax * (1./(leftDenominator*leftDenominator) + beta/(rightDenominator*rightDenominator));
     161      }
     162  }
    204163  while (fCosTheta < G4UniformRand());
    205164
    206   //  G4cout << "cosTheta = " << cosTheta << G4endl;
    207  
    208165  return cosTheta;
    209166}
     167
     168//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    210169
    211170G4double G4FinalStateElasticBrennerZaider::CalculatePolynomial(G4double k, std::vector<G4double>& vec)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateElasticScreenedRutherford.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4FinalStateElasticScreenedRutherford.cc,v 1.2 2007/10/12 23:10:33 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // Reference: TNS Geant4-DNA paper
    33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    34 
    35 // History:
    36 // -----------
    37 // Date         Name              Modification
    38 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    39 //
    40 // -------------------------------------------------------------------
    41 
    42 // Class description:
    43 // Reference: TNS Geant4-DNA paper
    44 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    45 // design foundation and implementation of the first set of models,
    46 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    47 // Further documentation available from http://www.ge.infn.it/geant4/dna
    48 
    49 // -------------------------------------------------------------------
    50 
     26// $Id: G4FinalStateElasticScreenedRutherford.cc,v 1.4 2008/07/14 20:47:34 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5128
    5229#include "G4FinalStateElasticScreenedRutherford.hh"
    53 #include "G4Track.hh"
    54 #include "G4Step.hh"
    55 #include "G4DynamicParticle.hh"
    56 #include "Randomize.hh"
    5730
    58 #include "G4ParticleTypes.hh"
    59 #include "G4ParticleDefinition.hh"
    60 #include "G4Electron.hh"
    61 #include "G4SystemOfUnits.hh"
    62 #include "G4ParticleMomentum.hh"
     31//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    6332
    6433G4FinalStateElasticScreenedRutherford::G4FinalStateElasticScreenedRutherford()
    6534{
    66   // These data members will be used in the next implementation iteration,
    67   // when the enriched PhysicsModel policy is implemented
    68   name = "FinalStateElasticScreenedRutherford";
    69   lowEnergyLimit = 7.4 * eV;
     35  lowEnergyLimit = 200 * eV;
    7036  highEnergyLimit = 10 * MeV;
    7137}
    7238
     39//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    7340
    7441G4FinalStateElasticScreenedRutherford::~G4FinalStateElasticScreenedRutherford()
    75 {
    76   // empty
    77   // G4DynamicParticle objects produced are owned by client
    78 }
     42{}
    7943 
     44//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    8045
    81 const G4FinalStateProduct& G4FinalStateElasticScreenedRutherford::GenerateFinalState(const G4Track& track, const G4Step& step)
     46const G4FinalStateProduct& G4FinalStateElasticScreenedRutherford::GenerateFinalState(const G4Track& track, const G4Step& )
    8247{
    83   // Clear previous secondaries, energy deposit and particle kill status
    8448  product.Clear();
    8549
    86   // Kinetic energy of primary particle
    8750  G4double k = track.GetDynamicParticle()->GetKineticEnergy();
    8851
    89   // Assume material = water; H2O number of electrons
    90   // ---- MGP ---- To be generalized later
    9152  const G4int z = 10;
    9253
     
    9455 
    9556  G4double phi = 2. * pi * G4UniformRand();
    96 
    97   // G4cout << "cosTheta in GenerateFinalState = " << cosTheta << ", phi = " << phi << G4endl;
    9857
    9958  G4ThreeVector zVers = track.GetDynamicParticle()->GetMomentumDirection();
     
    10665  yDir *= std::sin(phi);
    10766
    108   // G4cout << "xDir, yDir = " << xDir <<", " << yDir << G4endl;
    109 
    110   // G4ThreeVector zPrimeVers((xDir*xVers + yDir*yVers + cosTheta*zVers).unit());
    11167  G4ThreeVector zPrimeVers((xDir*xVers + yDir*yVers + cosTheta*zVers));
    11268
    113   // G4cout << "zPrimeVers = (" << zPrimeVers.x() << ", "<< zPrimeVers.y() << ", "<< zPrimeVers.z() << ") " << G4endl;
    114 
    115   //  product.ModifyPrimaryParticle(zPrimeVers.x(),zPrimeVers.y(),zPrimeVers.z(),k);
    11669  product.ModifyPrimaryParticle(zPrimeVers,k);
    117 
    118   //  this->aParticleChange.ProposeEnergy(k);
    119   //  this->aParticleChange.ProposeMomentumDirection(zPrimeVers);
    120   //  this->aParticleChange.SetNumberOfSecondaries(0);
    12170
    12271  return product;
    12372}
     73
     74//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    12475
    12576G4double G4FinalStateElasticScreenedRutherford::RandomizeCosTheta(G4double k, G4int z) const
     
    14495
    14596 do
    146    {
    147      cosTheta = 2. * G4UniformRand() - 1.;
    148      fCosTheta = (1 + 2.*n - cosTheta);
    149      fCosTheta = oneOverMax / (fCosTheta*fCosTheta);
    150    }
     97 {
     98   cosTheta = 2. * G4UniformRand() - 1.;
     99   fCosTheta = (1 + 2.*n - cosTheta);
     100   fCosTheta = oneOverMax / (fCosTheta*fCosTheta);
     101 }
    151102 while (fCosTheta < G4UniformRand());
    152103 
    153104 return cosTheta;
    154105}
     106
     107//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    155108
    156109G4double G4FinalStateElasticScreenedRutherford::ScreeningFactor(G4double k, G4int z) const
     
    180133  G4double result = 0.;
    181134  if (denominator != 0.)
    182     {
    183       result = numerator / denominator;
    184     }
     135  {
     136    result = numerator / denominator;
     137  }
    185138  else
    186     {
    187       // Throw an exception
    188       G4Exception("G4FinalStateElasticScreenedRutherford::ScreeningFactor - denominator = 0");
    189     }
     139  {
     140    G4Exception("G4FinalStateElasticScreenedRutherford::ScreeningFactor - denominator = 0");
     141  }
    190142  return result;
    191 
    192143}
  • trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateExcitationBorn.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4FinalStateExcitationBorn.cc,v 1.2 2007/11/09 20:11:04 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // Reference: TNS Geant4-DNA paper
    33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    34 
    35 // History:
    36 // -----------
    37 // Date         Name              Modification
    38 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    39 //
    40 // -------------------------------------------------------------------
    41 
    42 // Class description:
    43 // Reference: TNS Geant4-DNA paper
    44 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    45 // design foundation and implementation of the first set of models,
    46 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    47 // Further documentation available from http://www.ge.infn.it/geant4/dna
    48 
    49 // -------------------------------------------------------------------
    50 
     26// $Id: G4FinalStateExcitationBorn.cc,v 1.3 2008/07/14 20:47:34 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5128
    5229#include "G4FinalStateExcitationBorn.hh"
    53 #include "G4Track.hh"
    54 #include "G4Step.hh"
    55 #include "G4DynamicParticle.hh"
    56 #include "Randomize.hh"
    5730
    58 #include "G4ParticleTypes.hh"
    59 #include "G4ParticleDefinition.hh"
    60 #include "G4Electron.hh"
    61 #include "G4SystemOfUnits.hh"
    62 #include "G4ParticleMomentum.hh"
     31//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    6332
    6433G4FinalStateExcitationBorn::G4FinalStateExcitationBorn()
    6534{
    66   name = "FinalStateExcitationBorn";
    67   lowEnergyLimit = 7.4 * eV;
     35  lowEnergyLimit = 500 * keV;
    6836  highEnergyLimit = 10 * MeV;
    6937}
    7038
     39//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    7140
    7241G4FinalStateExcitationBorn::~G4FinalStateExcitationBorn()
    73 {
    74   // empty
    75   // G4DynamicParticle objects produced are owned by client
    76 }
    77  
     42{}
     43
     44//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    7845
    7946const G4FinalStateProduct& G4FinalStateExcitationBorn::GenerateFinalState(const G4Track& track, const G4Step& /* step */)
    8047{
    81   // Clear previous secondaries, energy deposit and particle kill status
    8248  product.Clear();
    8349
    8450  const G4DynamicParticle* particle = track.GetDynamicParticle();
    8551
    86   // Kinetic energy of primary particle
    8752  G4double k = particle->GetKineticEnergy();
    8853
    89   // Select excitation level on the basis of partial excitation cross section
    9054  G4int level = cross.RandomSelect(k);
    91   // Excitation energy corresponding to the selected level
    9255  G4double excitationEnergy = waterStructure.ExcitationEnergy(level);
    9356  G4double newEnergy = k - excitationEnergy;
    9457 
    95   if (newEnergy > lowEnergyLimit)
    96     {
    97       // Deposit excitation energy locally, modify primary energy accordingly
    98       // Particle direction is unchanged
    99       product.ModifyPrimaryParticle(particle->GetMomentumDirection(),newEnergy);
    100       product.AddEnergyDeposit(excitationEnergy);
    101     }
    102   else
    103     {
    104       // Primary particle is killed
    105       product.KillPrimaryParticle();
    106     }
     58  if (newEnergy > 0)
     59  {
     60    product.ModifyPrimaryParticle(particle->GetMomentumDirection(),newEnergy);
     61    product.AddEnergyDeposit(excitationEnergy);
     62  }
    10763
    10864  return product;
    10965}
    11066
    111 
  • trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateExcitationEmfietzoglou.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4FinalStateExcitationEmfietzoglou.cc,v 1.2 2007/11/09 20:11:04 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // Reference: TNS Geant4-DNA paper
    33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    34 
    35 // History:
    36 // -----------
    37 // Date         Name              Modification
    38 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    39 //
    40 // -------------------------------------------------------------------
    41 
    42 // Class description:
    43 // Reference: TNS Geant4-DNA paper
    44 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    45 // design foundation and implementation of the first set of models,
    46 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    47 // Further documentation available from http://www.ge.infn.it/geant4/dna
    48 
    49 // -------------------------------------------------------------------
    50 
     26// $Id: G4FinalStateExcitationEmfietzoglou.cc,v 1.5 2008/12/05 11:58:16 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5128
    5229#include "G4FinalStateExcitationEmfietzoglou.hh"
    53 #include "G4Track.hh"
    54 #include "G4Step.hh"
    55 #include "G4DynamicParticle.hh"
    56 #include "Randomize.hh"
    5730
    58 #include "G4ParticleTypes.hh"
    59 #include "G4ParticleDefinition.hh"
    60 #include "G4Electron.hh"
    61 #include "G4SystemOfUnits.hh"
    62 #include "G4ParticleMomentum.hh"
     31//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    6332
    6433G4FinalStateExcitationEmfietzoglou::G4FinalStateExcitationEmfietzoglou()
    6534{
    66   name = "FinalStateExcitationEmfietzoglou";
    67   lowEnergyLimit = 7.4 * eV;
     35  lowEnergyLimit = 8.23 * eV;
    6836  highEnergyLimit = 10 * MeV;
    6937}
    7038
     39//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    7140
    7241G4FinalStateExcitationEmfietzoglou::~G4FinalStateExcitationEmfietzoglou()
    73 {
    74   // empty
    75   // G4DynamicParticle objects produced are owned by client
    76 }
     42{}
    7743 
     44//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    7845
    7946const G4FinalStateProduct& G4FinalStateExcitationEmfietzoglou::GenerateFinalState(const G4Track& track, const G4Step& /* step */)
    8047{
    81   // Clear previous secondaries, energy deposit and particle kill status
    8248  product.Clear();
    8349
    8450  const G4DynamicParticle* particle = track.GetDynamicParticle();
    8551
    86   // Kinetic energy of primary particle
    8752  G4double k = particle->GetKineticEnergy();
    8853
    89   // Select excitation level on the basis of partial excitation cross section
    9054  G4int level = cross.RandomSelect(k);
    91   // Excitation energy corresponding to the selected level
     55
    9256  G4double excitationEnergy = waterStructure.ExcitationEnergy(level);
    9357  G4double newEnergy = k - excitationEnergy;
    9458 
    95   if (newEnergy > lowEnergyLimit)
    96     {
    97       // Deposit excitation energy locally, modify primary energy accordingly
    98       // Particle direction is unchanged
     59  if (newEnergy >= lowEnergyLimit)
     60  {
    9961      product.ModifyPrimaryParticle(particle->GetMomentumDirection(),newEnergy);
    10062      product.AddEnergyDeposit(excitationEnergy);
    101     }
    102   else
    103     {
    104       // Primary particle is killed
    105       product.KillPrimaryParticle();
    106     }
     63  }
     64 
     65  else product.KillPrimaryParticle();
    10766
    10867  return product;
    10968}
    11069
    111 
  • trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateExcitationMillerGreen.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4FinalStateExcitationMillerGreen.cc,v 1.2 2007/11/09 20:11:04 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
    32 // Reference: TNS Geant4-DNA paper
    33 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    34 
    35 // History:
    36 // -----------
    37 // Date         Name              Modification
    38 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    39 //
    40 // -------------------------------------------------------------------
    41 
    42 // Class description:
    43 // Reference: TNS Geant4-DNA paper
    44 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    45 // design foundation and implementation of the first set of models,
    46 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    47 // Further documentation available from http://www.ge.infn.it/geant4/dna
    48 
    49 // -------------------------------------------------------------------
    50 
     26// $Id: G4FinalStateExcitationMillerGreen.cc,v 1.3 2008/07/14 20:47:34 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5128
    5229#include "G4FinalStateExcitationMillerGreen.hh"
    53 #include "G4Track.hh"
    54 #include "G4Step.hh"
    55 #include "G4DynamicParticle.hh"
    56 #include "Randomize.hh"
    5730
    58 #include "G4ParticleTypes.hh"
    59 #include "G4ParticleDefinition.hh"
    60 #include "G4Electron.hh"
    61 #include "G4SystemOfUnits.hh"
    62 #include "G4ParticleMomentum.hh"
     31//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    6332
    6433G4FinalStateExcitationMillerGreen::G4FinalStateExcitationMillerGreen()
    6534{
    66   name = "ExcitationMillerGreen";
    6735  lowEnergyLimit = 10 * eV;
    6836  highEnergyLimit = 10 * MeV;
    6937}
    7038
     39//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    7140
    7241G4FinalStateExcitationMillerGreen::~G4FinalStateExcitationMillerGreen()
    7342{}
    7443 
     44//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    7545
    7646const G4FinalStateProduct& G4FinalStateExcitationMillerGreen::GenerateFinalState(const G4Track& track, const G4Step& /* step */)
    7747{
    78   // Clear previous secondaries, energy deposit and particle kill status
    7948  product.Clear();
    8049
    8150  const G4DynamicParticle* particle = track.GetDynamicParticle();
    8251
    83   // Kinetic energy of primary particle
    8452  G4double k = particle->GetKineticEnergy();
    8553
    86   // Select excitation level on the basis of partial excitation cross section
    8754  G4int level = cross.RandomSelect(k,track.GetDefinition());
    88   // Excitation energy corresponding to the selected level
    8955  G4double excitationEnergy = waterStructure.ExcitationEnergy(level);
    9056  G4double newEnergy = k - excitationEnergy;
    9157 
    92   // ---- SI ---- Test on newEnergy
    9358  if (newEnergy > 0)
    94     {
    95       // Deposit excitation energy locally, modify primary energy accordingly
    96       // Particle direction is unchanged
    97       product.ModifyPrimaryParticle(particle->GetMomentumDirection(),newEnergy);
    98       product.AddEnergyDeposit(excitationEnergy);
    99     }
    100 
    101   // ---- SI ---- Particle is not modified by default otherwise
    102 /*
    103   else
    104     {
    105       // Primary particle is killed
    106       product.KillPrimaryParticle();
    107     }
    108 */
     59  {
     60    product.ModifyPrimaryParticle(particle->GetMomentumDirection(),newEnergy);
     61    product.AddEnergyDeposit(excitationEnergy);
     62  }
    10963
    11064  return product;
  • trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateIonisationBorn.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4FinalStateIonisationBorn.cc,v 1.9 2007/11/26 17:27:09 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Sebastien Incerti (incerti@cenbg.in2p3.fr)
    31 //                 Maria Grazia Pia  (Maria.Grazia.Pia@cern.ch)
    32 //
    33 // Reference: TNS Geant4-DNA paper
    34 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    35 
    36 // History:
    37 // -----------
    38 // Date         Name              Modification
    39 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    40 //    Nov 2007  S. Incerti        Implementation
    41 // 26 Nov 2007  MGP               Cleaned up std::
    42 //
    43 // -------------------------------------------------------------------
    44 
    45 // Class description:
    46 // Reference: TNS Geant4-DNA paper
    47 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    48 // design foundation and implementation of the first set of models,
    49 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    50 // Further documentation available from http://www.ge.infn.it/geant4/dna
    51 
    52 // -------------------------------------------------------------------
    53 
     26// $Id: G4FinalStateIonisationBorn.cc,v 1.16 2008/12/06 13:47:12 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5428
    5529#include "G4FinalStateIonisationBorn.hh"
    56 #include "G4Track.hh"
    57 #include "G4Step.hh"
    58 #include "G4DynamicParticle.hh"
    59 #include "Randomize.hh"
    60 
    61 #include "G4ParticleTypes.hh"
    62 #include "G4ParticleDefinition.hh"
    63 #include "G4Electron.hh"
    64 #include "G4Proton.hh"
    65 #include "G4SystemOfUnits.hh"
    66 #include "G4ParticleMomentum.hh"
    67 
     30
     31//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    6832
    6933G4FinalStateIonisationBorn::G4FinalStateIonisationBorn()
    7034{
    71 
    72   name = "IonisationBorn";
    73 
    74   // NEW
    75   // Factor to scale microscopic/macroscopic cross section data in water
    76  
    7735  G4double scaleFactor = (1.e-22 / 3.343) * m*m;
    7836
    79   // Energy limits
    8037  G4ParticleDefinition* electronDef = G4Electron::ElectronDefinition();
    8138  G4ParticleDefinition* protonDef = G4Proton::ProtonDefinition();
     
    8441  G4String proton;
    8542
    86   // Default energy limits (defined for protection against anomalous behaviour only)
    87   lowEnergyLimitDefault = 25 * eV;
     43  lowEnergyLimitDefault = 12.61 * eV; // SI: i/o 25 eV
    8844  highEnergyLimitDefault = 10 * MeV;
    8945
     
    9349    G4Exception("G4DNACrossSectionDataSet::FullFileName - G4LEDATA environment variable not set");
    9450
    95   // Data members for electrons
    96 
    9751  if (electronDef != 0)
    98     {
    99       electron = electronDef->GetParticleName();
    100       lowEnergyLimit[electron] = 25. * eV;
    101       highEnergyLimit[electron] = 30. * keV;
    102 
    103       std::ostringstream eFullFileName;
    104       eFullFileName << path << "/dna/sigmadiff_ionisation_e_born.dat";
    105       std::ifstream eDiffCrossSection(eFullFileName.str().c_str());
    106       // eDiffCrossSection(eFullFileName.str().c_str());
    107       if (!eDiffCrossSection)
    108         {
    109           // G4cout << "ERROR OPENING DATA FILE IN ELECTRON BORN IONIZATION !!! " << G4endl;
    110           G4Exception("G4FinalStateIonisationBorn::ERROR OPENING electron DATA FILE");
    111           while(1); // ---- MGP ---- What is this?
    112         }
     52  {
     53    electron = electronDef->GetParticleName();
     54    lowEnergyLimit[electron] = 12.61 * eV; // SI: i/o 25 eV
     55    highEnergyLimit[electron] = 30. * keV;
     56
     57    std::ostringstream eFullFileName;
     58    eFullFileName << path << "/dna/sigmadiff_ionisation_e_born.dat";
     59    std::ifstream eDiffCrossSection(eFullFileName.str().c_str());
     60    if (!eDiffCrossSection)
     61    {
     62      G4Exception("G4FinalStateIonisationBorn::ERROR OPENING electron DATA FILE");
     63    }
    11364     
    114       eTdummyVec.push_back(0.);
    115       while(!eDiffCrossSection.eof())
    116         {
    117           double tDummy;
    118           double eDummy;
    119           eDiffCrossSection>>tDummy>>eDummy;
    120           if (tDummy != eTdummyVec.back()) eTdummyVec.push_back(tDummy);
    121           for (int j=0; j<5; j++)
    122             {
    123               eDiffCrossSection>>eDiffCrossSectionData[j][tDummy][eDummy];
    124               eDiffCrossSectionData[j][tDummy][eDummy]*=scaleFactor;
    125               eVecm[tDummy].push_back(eDummy);
    126             }
    127         }
    128 
    129     }
     65    eTdummyVec.push_back(0.);
     66    while(!eDiffCrossSection.eof())
     67    {
     68      double tDummy;
     69      double eDummy;
     70      eDiffCrossSection>>tDummy>>eDummy;
     71      if (tDummy != eTdummyVec.back()) eTdummyVec.push_back(tDummy);
     72      for (int j=0; j<5; j++)
     73      {
     74        eDiffCrossSection>>eDiffCrossSectionData[j][tDummy][eDummy];
     75
     76        // SI - only if eof is not reached !
     77        if (!eDiffCrossSection.eof()) eDiffCrossSectionData[j][tDummy][eDummy]*=scaleFactor;
     78
     79        eVecm[tDummy].push_back(eDummy);
     80
     81      }
     82    }
     83
     84  }
    13085  else
    131     {
    132       G4Exception("G4FinalStateIonisationBorn Constructor: electron is not defined");
    133     }
    134 
    135   // Data members for protons
     86  {
     87    G4Exception("G4FinalStateIonisationBorn Constructor: electron is not defined");
     88  }
    13689
    13790  if (protonDef != 0)
    138     {
    139       proton = protonDef->GetParticleName();
    140       lowEnergyLimit[proton] = 500. * keV;
    141       highEnergyLimit[proton] = 10. * MeV;
    142 
    143       std::ostringstream pFullFileName;
    144       pFullFileName << path << "/dna/sigmadiff_ionisation_p_born.dat";
    145       std::ifstream pDiffCrossSection(pFullFileName.str().c_str());
    146       //     pDiffCrossSection(pFullFileName.str().c_str());
    147       if (!pDiffCrossSection)
    148         {
    149           // G4cout<<"ERROR OPENING DATA FILE IN PROTON BORN IONIZATION !!! "<<G4endl;
    150           G4Exception("G4FinalStateIonisationBorn::ERROR OPENING proton DATA FILE");
    151           while(1); // ---- MGP ---- What is this?
    152         }
     91  {
     92    proton = protonDef->GetParticleName();
     93    lowEnergyLimit[proton] = 500. * keV;
     94    highEnergyLimit[proton] = 10. * MeV;
     95
     96    std::ostringstream pFullFileName;
     97    pFullFileName << path << "/dna/sigmadiff_ionisation_p_born.dat";
     98    std::ifstream pDiffCrossSection(pFullFileName.str().c_str());
     99    if (!pDiffCrossSection)
     100    {
     101      G4Exception("G4FinalStateIonisationBorn::ERROR OPENING proton DATA FILE");
     102    }
    153103     
    154       pTdummyVec.push_back(0.);
    155       while(!pDiffCrossSection.eof())
    156         {
    157           double tDummy;
    158           double eDummy;
    159           pDiffCrossSection>>tDummy>>eDummy;
    160           if (tDummy != pTdummyVec.back()) pTdummyVec.push_back(tDummy);
    161           for (int j=0; j<5; j++)
    162             {
    163               pDiffCrossSection>>pDiffCrossSectionData[j][tDummy][eDummy];
    164               pDiffCrossSectionData[j][tDummy][eDummy]*=scaleFactor;
    165               //G4cout << "j=" << j << " Tdum=" << tDummy << " Edum=" << eDummy << " pDiff=" << pDiffCrossSectionData[j][tDummy][eDummy] << G4endl;
    166               pVecm[tDummy].push_back(eDummy);
    167             }
    168         }
    169     }
     104    pTdummyVec.push_back(0.);
     105    while(!pDiffCrossSection.eof())
     106    {
     107      double tDummy;
     108      double eDummy;
     109      pDiffCrossSection>>tDummy>>eDummy;
     110      if (tDummy != pTdummyVec.back()) pTdummyVec.push_back(tDummy);
     111      for (int j=0; j<5; j++)
     112      {
     113        pDiffCrossSection>>pDiffCrossSectionData[j][tDummy][eDummy];
     114
     115        // SI - only if eof is not reached !
     116        if (!pDiffCrossSection.eof()) pDiffCrossSectionData[j][tDummy][eDummy]*=scaleFactor;
     117
     118        pVecm[tDummy].push_back(eDummy);
     119      }
     120    }
     121  }
    170122  else
    171     {
    172       G4Exception("G4FinalStateIonisationBorn Constructor: proton is not defined");
    173     }
    174 }
    175 
     123  {
     124    G4Exception("G4FinalStateIonisationBorn Constructor: proton is not defined");
     125  }
     126}
     127
     128//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    176129
    177130G4FinalStateIonisationBorn::~G4FinalStateIonisationBorn()
     
    181134}
    182135
     136//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    183137
    184138const G4FinalStateProduct& G4FinalStateIonisationBorn::GenerateFinalState(const G4Track& track, const G4Step& /* step */)
    185139{
    186   // Clear previous secondaries, energy deposit and particle kill status
    187140  product.Clear();
    188141
     
    196149  const G4String& particleName = particle->GetDefinition()->GetParticleName();
    197150
    198   // Retrieve energy limits for the current particle type
    199 
    200151  std::map< G4String,G4double,std::less<G4String> >::iterator pos1;
    201152  pos1 = lowEnergyLimit.find(particleName);
    202153
    203   // Lower limit
    204154  if (pos1 != lowEnergyLimit.end())
    205     {
    206       lowLim = pos1->second;
    207     }
    208 
    209   // Upper limit
     155  {
     156    lowLim = pos1->second;
     157  }
     158
    210159  std::map< G4String,G4double,std::less<G4String> >::iterator pos2;
    211160  pos2 = highEnergyLimit.find(particleName);
    212161
    213162  if (pos2 != highEnergyLimit.end())
    214     {
    215       highLim = pos2->second;
    216     }
    217 
    218   // Verify that the current track is within the energy limits of validity of the cross section model
     163  {
     164    highLim = pos2->second;
     165  }
    219166
    220167  if (k >= lowLim && k <= highLim)
    221     {
    222       // Kinetic energy of primary particle
    223 
    224       G4ParticleMomentum primaryDirection = particle->GetMomentumDirection();
    225       G4double particleMass = particle->GetDefinition()->GetPDGMass();
    226       G4double totalEnergy = k + particleMass;
    227       G4double pSquare = k * (totalEnergy + particleMass);
    228       G4double totalMomentum = std::sqrt(pSquare);
    229 
    230       const G4String& particleName = particle->GetDefinition()->GetParticleName();
    231  
    232       G4int ionizationShell = cross.RandomSelect(k,particleName);
    233  
    234       G4double secondaryKinetic = RandomizeEjectedElectronEnergy(particle->GetDefinition(),k,ionizationShell);
    235  
    236       G4double bindingEnergy = waterStructure.IonisationEnergy(ionizationShell);
    237 
    238       G4double cosTheta = 0.;
    239       G4double phi = 0.;
    240       RandomizeEjectedElectronDirection(track.GetDefinition(), k,secondaryKinetic, cosTheta, phi);
    241 
    242       G4double sinTheta = std::sqrt(1.-cosTheta*cosTheta);
    243       G4double dirX = sinTheta*std::cos(phi);
    244       G4double dirY = sinTheta*std::sin(phi);
    245       G4double dirZ = cosTheta;
    246       G4ThreeVector deltaDirection(dirX,dirY,dirZ);
    247       deltaDirection.rotateUz(primaryDirection);
    248 
    249       G4double deltaTotalMomentum = std::sqrt(secondaryKinetic*(secondaryKinetic + 2.*electron_mass_c2 ));
    250 
    251       //Primary Particle Direction
    252       G4double finalPx = totalMomentum*primaryDirection.x() - deltaTotalMomentum*deltaDirection.x();
    253       G4double finalPy = totalMomentum*primaryDirection.y() - deltaTotalMomentum*deltaDirection.y();
    254       G4double finalPz = totalMomentum*primaryDirection.z() - deltaTotalMomentum*deltaDirection.z();
    255       G4double finalMomentum = std::sqrt(finalPx*finalPx + finalPy*finalPy + finalPz*finalPz);
    256       finalPx /= finalMomentum;
    257       finalPy /= finalMomentum;
    258       finalPz /= finalMomentum;
    259 
    260       product.ModifyPrimaryParticle(finalPx,finalPy,finalPz,k-bindingEnergy-secondaryKinetic);
    261       product.AddEnergyDeposit(bindingEnergy);
    262 
    263       G4DynamicParticle* aElectron = new G4DynamicParticle(G4Electron::Electron(),deltaDirection,secondaryKinetic);
    264       product.AddSecondary(aElectron);
    265     }
     168  {
     169    G4ParticleMomentum primaryDirection = particle->GetMomentumDirection();
     170    G4double particleMass = particle->GetDefinition()->GetPDGMass();
     171    G4double totalEnergy = k + particleMass;
     172    G4double pSquare = k * (totalEnergy + particleMass);
     173    G4double totalMomentum = std::sqrt(pSquare);
     174
     175    const G4String& particleName = particle->GetDefinition()->GetParticleName();
     176 
     177    G4int ionizationShell = cross.RandomSelect(k,particleName);
     178 
     179    G4double secondaryKinetic = RandomizeEjectedElectronEnergy(particle->GetDefinition(),k,ionizationShell);
     180 
     181    G4double bindingEnergy = waterStructure.IonisationEnergy(ionizationShell);
     182
     183    G4double cosTheta = 0.;
     184    G4double phi = 0.;
     185    RandomizeEjectedElectronDirection(track.GetDefinition(), k,secondaryKinetic, cosTheta, phi);
     186
     187    G4double sinTheta = std::sqrt(1.-cosTheta*cosTheta);
     188    G4double dirX = sinTheta*std::cos(phi);
     189    G4double dirY = sinTheta*std::sin(phi);
     190    G4double dirZ = cosTheta;
     191    G4ThreeVector deltaDirection(dirX,dirY,dirZ);
     192    deltaDirection.rotateUz(primaryDirection);
     193
     194    G4double deltaTotalMomentum = std::sqrt(secondaryKinetic*(secondaryKinetic + 2.*electron_mass_c2 ));
     195
     196    G4double finalPx = totalMomentum*primaryDirection.x() - deltaTotalMomentum*deltaDirection.x();
     197    G4double finalPy = totalMomentum*primaryDirection.y() - deltaTotalMomentum*deltaDirection.y();
     198    G4double finalPz = totalMomentum*primaryDirection.z() - deltaTotalMomentum*deltaDirection.z();
     199    G4double finalMomentum = std::sqrt(finalPx*finalPx + finalPy*finalPy + finalPz*finalPz);
     200    finalPx /= finalMomentum;
     201    finalPy /= finalMomentum;
     202    finalPz /= finalMomentum;
     203
     204    product.ModifyPrimaryParticle(finalPx,finalPy,finalPz,k-bindingEnergy-secondaryKinetic);
     205    product.AddEnergyDeposit(bindingEnergy);
     206
     207    G4DynamicParticle* aElectron = new G4DynamicParticle(G4Electron::Electron(),deltaDirection,secondaryKinetic);
     208    product.AddSecondary(aElectron);
     209  }
    266210
    267211  return product;
    268212}
    269213
     214//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    270215
    271216G4double G4FinalStateIonisationBorn::RandomizeEjectedElectronEnergy(G4ParticleDefinition* particleDefinition,
    272                                                                     G4double k,
    273                                                                     G4int shell)
    274 {
    275 
     217G4double k, G4int shell)
     218{
    276219  if (particleDefinition == G4Electron::ElectronDefinition())
    277     {
    278 
    279       G4double maximumEnergyTransfer=0.;
    280       if ((k+waterStructure.IonisationEnergy(shell))/2. > k) maximumEnergyTransfer=k;
    281       else maximumEnergyTransfer = (k+waterStructure.IonisationEnergy(shell))/2.;
     220  {
     221    G4double maximumEnergyTransfer=0.;
     222    if ((k+waterStructure.IonisationEnergy(shell))/2. > k) maximumEnergyTransfer=k;
     223    else maximumEnergyTransfer = (k+waterStructure.IonisationEnergy(shell))/2.;
    282224   
    283       G4double crossSectionMaximum = 0.;
    284       for(G4double value=waterStructure.IonisationEnergy(shell); value<=maximumEnergyTransfer; value+=0.1*eV)
    285         {
    286           G4double differentialCrossSection = DifferentialCrossSection(particleDefinition, k/eV, value/eV, shell);
    287           if(differentialCrossSection >= crossSectionMaximum) crossSectionMaximum = differentialCrossSection;
    288         }
     225    G4double crossSectionMaximum = 0.;
     226    for(G4double value=waterStructure.IonisationEnergy(shell); value<=maximumEnergyTransfer; value+=0.1*eV)
     227    {
     228      G4double differentialCrossSection = DifferentialCrossSection(particleDefinition, k/eV, value/eV, shell);
     229      if(differentialCrossSection >= crossSectionMaximum) crossSectionMaximum = differentialCrossSection;
     230    }
    289231 
    290       G4double secondaryElectronKineticEnergy=0.;
    291       do
    292         {
    293           secondaryElectronKineticEnergy = G4UniformRand() * (maximumEnergyTransfer-waterStructure.IonisationEnergy(shell));
    294         } while(G4UniformRand()*crossSectionMaximum >
     232    G4double secondaryElectronKineticEnergy=0.;
     233    do
     234    {
     235      secondaryElectronKineticEnergy = G4UniformRand() * (maximumEnergyTransfer-waterStructure.IonisationEnergy(shell));
     236    } while(G4UniformRand()*crossSectionMaximum >
     237      DifferentialCrossSection(particleDefinition, k/eV,(secondaryElectronKineticEnergy+waterStructure.IonisationEnergy(shell))/eV,shell));
     238
     239    return secondaryElectronKineticEnergy;
     240 
     241  }
     242 
     243  if (particleDefinition == G4Proton::ProtonDefinition())
     244  {
     245    G4double maximumKineticEnergyTransfer = 4.* (electron_mass_c2 / proton_mass_c2) * k - (waterStructure.IonisationEnergy(shell));
     246
     247    G4double crossSectionMaximum = 0.;
     248    for (G4double value = waterStructure.IonisationEnergy(shell);
     249         value<=4.*waterStructure.IonisationEnergy(shell) ;
     250         value+=0.1*eV)
     251    {
     252      G4double differentialCrossSection = DifferentialCrossSection(particleDefinition, k/eV, value/eV, shell);
     253      if (differentialCrossSection >= crossSectionMaximum) crossSectionMaximum = differentialCrossSection;
     254    }
     255
     256    G4double secondaryElectronKineticEnergy = 0.;
     257    do
     258    {
     259      secondaryElectronKineticEnergy = G4UniformRand() * maximumKineticEnergyTransfer;
     260    } while(G4UniformRand()*crossSectionMaximum >=
    295261              DifferentialCrossSection(particleDefinition, k/eV,(secondaryElectronKineticEnergy+waterStructure.IonisationEnergy(shell))/eV,shell));
    296262
    297       return secondaryElectronKineticEnergy;
    298  
    299     }
    300  
    301   if (particleDefinition == G4Proton::ProtonDefinition())
    302     {
    303       G4double maximumKineticEnergyTransfer = 4.* (electron_mass_c2 / proton_mass_c2) * k - (waterStructure.IonisationEnergy(shell));
    304 
    305       G4double crossSectionMaximum = 0.;
    306       for (G4double value = waterStructure.IonisationEnergy(shell);
    307            value<=4.*waterStructure.IonisationEnergy(shell) ;
    308            value+=0.1*eV)
    309         {
    310           G4double differentialCrossSection = DifferentialCrossSection(particleDefinition, k/eV, value/eV, shell);
    311           if (differentialCrossSection >= crossSectionMaximum) crossSectionMaximum = differentialCrossSection;
    312         }
    313 
    314       G4double secondaryElectronKineticEnergy = 0.;
    315       do
    316         {
    317           secondaryElectronKineticEnergy = G4UniformRand() * maximumKineticEnergyTransfer;
    318         } while(G4UniformRand()*crossSectionMaximum >=
    319               DifferentialCrossSection(particleDefinition, k/eV,(secondaryElectronKineticEnergy+waterStructure.IonisationEnergy(shell))/eV,shell));
    320 
    321       return secondaryElectronKineticEnergy;
    322     }
     263    return secondaryElectronKineticEnergy;
     264  }
    323265
    324266  return 0;
    325267}
    326268
     269//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    327270
    328271void G4FinalStateIonisationBorn::RandomizeEjectedElectronDirection(G4ParticleDefinition* particleDefinition,
     
    333276{
    334277  if (particleDefinition == G4Electron::ElectronDefinition())
    335     {
    336 
    337       phi = twopi * G4UniformRand();
    338       if (secKinetic < 50.*eV) cosTheta = (2.*G4UniformRand())-1.;
    339       else if (secKinetic <= 200.*eV)   
    340         {
    341           if (G4UniformRand() <= 0.1) cosTheta = (2.*G4UniformRand())-1.;
    342           else cosTheta = G4UniformRand()*(std::sqrt(2.)/2);
    343         }
    344       else     
    345         {
    346           G4double sin2O = (1.-secKinetic/k) / (1.+secKinetic/(2.*electron_mass_c2));
    347           cosTheta = std::sqrt(1.-sin2O);
    348         }
    349     }
     278  {
     279    phi = twopi * G4UniformRand();
     280    if (secKinetic < 50.*eV) cosTheta = (2.*G4UniformRand())-1.;
     281    else if (secKinetic <= 200.*eV)     
     282    {
     283      if (G4UniformRand() <= 0.1) cosTheta = (2.*G4UniformRand())-1.;
     284      else cosTheta = G4UniformRand()*(std::sqrt(2.)/2);
     285    }
     286    else       
     287    {
     288      G4double sin2O = (1.-secKinetic/k) / (1.+secKinetic/(2.*electron_mass_c2));
     289      cosTheta = std::sqrt(1.-sin2O);
     290    }
     291  }
    350292 
    351293  if (particleDefinition == G4Proton::ProtonDefinition())
    352     {
    353       G4double maxSecKinetic = 4.* (electron_mass_c2 / proton_mass_c2) * k;
    354       phi = twopi * G4UniformRand();
    355       cosTheta = std::sqrt(secKinetic / maxSecKinetic);
    356     }                   
    357 }
    358 
     294  {
     295    G4double maxSecKinetic = 4.* (electron_mass_c2 / proton_mass_c2) * k;
     296    phi = twopi * G4UniformRand();
     297    cosTheta = std::sqrt(secKinetic / maxSecKinetic);
     298  }                     
     299}
     300
     301//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    359302
    360303double G4FinalStateIonisationBorn::DifferentialCrossSection(G4ParticleDefinition * particleDefinition,
     
    366309
    367310  if (energyTransfer >= waterStructure.IonisationEnergy(ionizationLevelIndex))
    368     {
    369       G4double valueT1 = 0;
    370       G4double valueT2 = 0;
    371       G4double valueE21 = 0;
    372       G4double valueE22 = 0;
    373       G4double valueE12 = 0;
    374       G4double valueE11 = 0;
    375 
    376       G4double xs11  =  0;   
    377       G4double xs12 = 0;
    378       G4double xs21 = 0;
    379       G4double xs22 = 0;
    380 
     311  {
     312    G4double valueT1 = 0;
     313    G4double valueT2 = 0;
     314    G4double valueE21 = 0;
     315    G4double valueE22 = 0;
     316    G4double valueE12 = 0;
     317    G4double valueE11 = 0;
     318
     319    G4double xs11 = 0;   
     320    G4double xs12 = 0;
     321    G4double xs21 = 0;
     322    G4double xs22 = 0;
     323
     324    if (particleDefinition == G4Electron::ElectronDefinition())
     325    {
     326      // k should be in eV and energy transfer eV also
     327
     328      std::vector<double>::iterator t2 = std::upper_bound(eTdummyVec.begin(),eTdummyVec.end(), k);
     329
     330      std::vector<double>::iterator t1 = t2-1;
     331
     332      // SI : the following condition avoids situations where energyTransfer >last vector element
     333      if (energyTransfer <= eVecm[(*t1)].back())
     334      {
     335        std::vector<double>::iterator e12 = std::upper_bound(eVecm[(*t1)].begin(),eVecm[(*t1)].end(), energyTransfer);
     336        std::vector<double>::iterator e11 = e12-1;
     337
     338        std::vector<double>::iterator e22 = std::upper_bound(eVecm[(*t2)].begin(),eVecm[(*t2)].end(), energyTransfer);
     339        std::vector<double>::iterator e21 = e22-1;
     340
     341        valueT1  =*t1;
     342        valueT2  =*t2;
     343        valueE21 =*e21;
     344        valueE22 =*e22;
     345        valueE12 =*e12;
     346        valueE11 =*e11;
     347
     348        xs11 = eDiffCrossSectionData[ionizationLevelIndex][valueT1][valueE11];
     349        xs12 = eDiffCrossSectionData[ionizationLevelIndex][valueT1][valueE12];
     350        xs21 = eDiffCrossSectionData[ionizationLevelIndex][valueT2][valueE21];
     351        xs22 = eDiffCrossSectionData[ionizationLevelIndex][valueT2][valueE22];
     352      }
     353
     354    }
     355 
     356   if (particleDefinition == G4Proton::ProtonDefinition())
     357   {
     358      // k should be in eV and energy transfer eV also
     359      std::vector<double>::iterator t2 = std::upper_bound(pTdummyVec.begin(),pTdummyVec.end(), k);
     360      std::vector<double>::iterator t1 = t2-1;
     361     
     362        std::vector<double>::iterator e12 = std::upper_bound(pVecm[(*t1)].begin(),pVecm[(*t1)].end(), energyTransfer);
     363        std::vector<double>::iterator e11 = e12-1;
     364
     365        std::vector<double>::iterator e22 = std::upper_bound(pVecm[(*t2)].begin(),pVecm[(*t2)].end(), energyTransfer);
     366        std::vector<double>::iterator e21 = e22-1;
    381367 
    382       if (particleDefinition == G4Electron::ElectronDefinition())
    383         {
    384           // k should be in eV and energy transfer eV also
    385           std::vector<double>::iterator t2 = std::upper_bound(eTdummyVec.begin(),eTdummyVec.end(), k);
    386           std::vector<double>::iterator t1 = t2-1;
    387           std::vector<double>::iterator e12 = std::upper_bound(eVecm[(*t1)].begin(),eVecm[(*t1)].end(), energyTransfer);
    388           std::vector<double>::iterator e11 = e12-1;
    389 
    390           std::vector<double>::iterator e22 = std::upper_bound(eVecm[(*t2)].begin(),eVecm[(*t2)].end(), energyTransfer);
    391           std::vector<double>::iterator e21 = e22-1;
    392 
    393           valueT1  =*t1;
    394           valueT2  =*t2;
    395           valueE21 =*e21;
    396           valueE22 =*e22;
    397           valueE12 =*e12;
    398           valueE11 =*e11;
    399 
    400           xs11 = eDiffCrossSectionData[ionizationLevelIndex][valueT1][valueE11];
    401           xs12 = eDiffCrossSectionData[ionizationLevelIndex][valueT1][valueE12];
    402           xs21 = eDiffCrossSectionData[ionizationLevelIndex][valueT2][valueE21];
    403           xs22 = eDiffCrossSectionData[ionizationLevelIndex][valueT2][valueE22];
    404 
    405         }
    406  
    407       if (particleDefinition == G4Proton::ProtonDefinition())
    408         {
    409           // k should be in eV and energy transfer eV also
    410           std::vector<double>::iterator t2 = std::upper_bound(pTdummyVec.begin(),pTdummyVec.end(), k);
    411           std::vector<double>::iterator t1 = t2-1;
    412           std::vector<double>::iterator e12 = std::upper_bound(pVecm[(*t1)].begin(),pVecm[(*t1)].end(), energyTransfer);
    413           std::vector<double>::iterator e11 = e12-1;
    414 
    415           std::vector<double>::iterator e22 = std::upper_bound(pVecm[(*t2)].begin(),pVecm[(*t2)].end(), energyTransfer);
    416           std::vector<double>::iterator e21 = e22-1;
    417  
    418           valueT1  =*t1;
    419           valueT2  =*t2;
    420           valueE21 =*e21;
    421           valueE22 =*e22;
    422           valueE12 =*e12;
    423           valueE11 =*e11;
    424 
    425           xs11 = pDiffCrossSectionData[ionizationLevelIndex][valueT1][valueE11];
    426           xs12 = pDiffCrossSectionData[ionizationLevelIndex][valueT1][valueE12];
    427           xs21 = pDiffCrossSectionData[ionizationLevelIndex][valueT2][valueE21];
    428           xs22 = pDiffCrossSectionData[ionizationLevelIndex][valueT2][valueE22];
    429         }
    430  
    431       G4double xsProduct = xs11 * xs12 * xs21 * xs22;
    432       // if (xs11==0 || xs12==0 ||xs21==0 ||xs22==0) return (0.);
    433       if (xsProduct != 0.)
    434         {
    435           sigma = QuadInterpolator(valueE11, valueE12,
     368        valueT1  =*t1;
     369        valueT2  =*t2;
     370        valueE21 =*e21;
     371        valueE22 =*e22;
     372        valueE12 =*e12;
     373        valueE11 =*e11;
     374
     375        xs11 = pDiffCrossSectionData[ionizationLevelIndex][valueT1][valueE11];
     376        xs12 = pDiffCrossSectionData[ionizationLevelIndex][valueT1][valueE12];
     377        xs21 = pDiffCrossSectionData[ionizationLevelIndex][valueT2][valueE21];
     378        xs22 = pDiffCrossSectionData[ionizationLevelIndex][valueT2][valueE22];
     379
     380   }
     381 
     382   G4double xsProduct = xs11 * xs12 * xs21 * xs22;
     383   if (xsProduct != 0.)
     384   {
     385     sigma = QuadInterpolator(     valueE11, valueE12,
    436386                                   valueE21, valueE22,
    437387                                   xs11, xs12,
     
    439389                                   valueT1, valueT2,
    440390                                   k, energyTransfer);
    441         }
    442     }
     391   }
     392 
     393 }
     394 
    443395  return sigma;
    444396}
    445397
     398//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    446399
    447400G4double G4FinalStateIonisationBorn::LogLogInterpolate(G4double e1,
     
    458411}
    459412
     413//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    460414
    461415G4double G4FinalStateIonisationBorn::QuadInterpolator(G4double e11, G4double e12,
  • trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateIonisationRudd.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4FinalStateIonisationRudd.cc,v 1.5 2007/11/26 17:27:09 pia Exp $
    28 // GEANT4 tag $Name:  $
    29 //
    30 // Contact Author: Sebastien Incerti (incerti@cenbg.in2p3.fr)
    31 //                 Maria Grazia Pia  (Maria.Grazia.Pia@cern.ch)
    32 //
    33 ///
    34 // Reference: TNS Geant4-DNA paper
    35 // Reference for implementation model: NIM. 155, pp. 145-156, 1978
    36 //
    37 // History:
    38 // -----------
    39 // Date         Name              Modification
    40 // 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
    41 //    Nov 2007  S. Incerti        Implementation
    42 // 26 Nov 2007  MGP               Cleaned up std::
    43 //
    44 // -------------------------------------------------------------------
    45 
    46 // Class description:
    47 // Reference: TNS Geant4-DNA paper
    48 // S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
    49 // design foundation and implementation of the first set of models,
    50 // IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
    51 // Further documentation available from http://www.ge.infn.it/geant4/dna
    52 
    53 // -------------------------------------------------------------------
    54 
     26// $Id: G4FinalStateIonisationRudd.cc,v 1.8 2008/08/20 14:51:48 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    5528
    5629#include "G4FinalStateIonisationRudd.hh"
    57 #include "G4Track.hh"
    58 #include "G4Step.hh"
    59 #include "G4DynamicParticle.hh"
    60 #include "Randomize.hh"
    61 
    62 #include "G4ParticleTypes.hh"
    63 #include "G4ParticleDefinition.hh"
    64 #include "G4Electron.hh"
    65 #include "G4Proton.hh"
    66 #include "G4SystemOfUnits.hh"
    67 #include "G4ParticleMomentum.hh"
    68 #include "G4DNAGenericIonsManager.hh"
    69 
     30
     31//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    7032
    7133G4FinalStateIonisationRudd::G4FinalStateIonisationRudd()
    7234{
    73   name = "IonisationBorn";
    74   // Default energy limits (defined for protection against anomalous behaviour only)
    7535  lowEnergyLimitDefault = 100 * eV;
    7636  highEnergyLimitDefault = 100 * MeV;
     
    11272}
    11373
     74//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    11475
    11576G4FinalStateIonisationRudd::~G4FinalStateIonisationRudd()
    116 { }
    117 
    118 
     77{}
     78
     79//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    11980
    12081const G4FinalStateProduct& G4FinalStateIonisationRudd::GenerateFinalState(const G4Track& track, const G4Step& /* step */)
    12182{
    122   // Clear previous secondaries, energy deposit and particle kill status
    12383  product.Clear();
    12484
     
    13292  const G4String& particleName = particle->GetDefinition()->GetParticleName();
    13393
    134   // Retrieve energy limits for the current particle type
    135 
    13694  std::map< G4String,G4double,std::less<G4String> >::iterator pos1;
    13795  pos1 = lowEnergyLimit.find(particleName);
    13896
    139   // Lower limit
    14097  if (pos1 != lowEnergyLimit.end())
    141     {
    142       lowLim = pos1->second;
    143     }
    144 
    145   // Upper limit
     98  {
     99    lowLim = pos1->second;
     100  }
     101
    146102  std::map< G4String,G4double,std::less<G4String> >::iterator pos2;
    147103  pos2 = highEnergyLimit.find(particleName);
    148104
    149105  if (pos2 != highEnergyLimit.end())
    150     {
    151       highLim = pos2->second;
    152     }
    153 
    154   // Verify that the current track is within the energy limits of validity of the cross section model
     106  {
     107    highLim = pos2->second;
     108  }
    155109
    156110  if (k >= lowLim && k <= highLim)
    157     {
    158       // Kinetic energy of primary particle
    159 
     111  {
    160112      G4ParticleDefinition* definition = particle->GetDefinition();
    161113      G4ParticleMomentum primaryDirection = particle->GetMomentumDirection();
     
    186138      G4double deltaTotalMomentum = std::sqrt(secondaryKinetic*(secondaryKinetic + 2.*electron_mass_c2 ));
    187139
    188       // Primary Particle Direction
    189140      G4double finalPx = totalMomentum*primaryDirection.x() - deltaTotalMomentum*deltaDirection.x();
    190141      G4double finalPy = totalMomentum*primaryDirection.y() - deltaTotalMomentum*deltaDirection.y();
     
    200151      G4DynamicParticle* aElectron = new G4DynamicParticle(G4Electron::Electron(),deltaDirection,secondaryKinetic);
    201152      product.AddSecondary(aElectron);
    202     }
    203 
    204   if (k < lowLim) {product.KillPrimaryParticle();product.AddEnergyDeposit(k);}
     153  }
     154
     155  if (k < lowLim)
     156  { 
     157    product.KillPrimaryParticle();
     158  }
    205159 
    206160  return product;
    207161}
    208162
    209 
     163//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    210164
    211165G4double G4FinalStateIonisationRudd::RandomizeEjectedElectronEnergy(G4ParticleDefinition* particleDefinition,
     
    220174  if (particleDefinition == G4Proton::ProtonDefinition()
    221175      || particleDefinition == instance->GetIon("hydrogen"))
    222          
    223     {
     176  {
    224177      maximumKineticEnergyTransfer= 4.* (electron_mass_c2 / proton_mass_c2) * k;
    225     }
     178  }
    226179
    227180  if (particleDefinition == instance->GetIon("helium")
    228181      || particleDefinition == instance->GetIon("alpha+")
    229182      || particleDefinition == instance->GetIon("alpha++"))
    230     {
     183  {
    231184      maximumKineticEnergyTransfer= 4.* (0.511 / 3728) * k;
    232     }
     185  }
    233186
    234187  G4double crossSectionMaximum = 0.;
     188 
    235189  for(G4double value=waterStructure.IonisationEnergy(shell); value<=4.*waterStructure.IonisationEnergy(shell) ; value+=0.1*eV)
    236     {
     190  {
    237191      G4double differentialCrossSection = DifferentialCrossSection(particleDefinition, k, value, shell);
    238192      if(differentialCrossSection >= crossSectionMaximum) crossSectionMaximum = differentialCrossSection;
    239     }
     193  }
     194 
    240195  G4double secElecKinetic = 0.;
    241   do{
     196 
     197  do
     198  {
    242199    secElecKinetic = G4UniformRand() * maximumKineticEnergyTransfer;
    243200  } while(G4UniformRand()*crossSectionMaximum > DifferentialCrossSection(particleDefinition,
     
    249206}
    250207
     208//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     209
    251210
    252211void G4FinalStateIonisationRudd::RandomizeEjectedElectronDirection(G4ParticleDefinition* particleDefinition,
    253212                                                                   G4double k,
    254213                                                                   G4double secKinetic,
    255                                                                    G4double cosTheta,
    256                                                                    G4double phi )
     214                                                                   G4double & cosTheta,
     215                                                                   G4double & phi )
    257216{
    258217  G4DNAGenericIonsManager *instance;
     
    263222  if (particleDefinition == G4Proton::ProtonDefinition()
    264223      || particleDefinition == instance->GetIon("hydrogen"))
    265     {
     224  {
    266225      maxSecKinetic = 4.* (electron_mass_c2 / proton_mass_c2) * k;
    267     }
     226  }
    268227 
    269228  if (particleDefinition == instance->GetIon("helium")
    270229      || particleDefinition == instance->GetIon("alpha+")
    271230      || particleDefinition == instance->GetIon("alpha++"))
    272     {
     231  {
    273232      maxSecKinetic = 4.* (0.511 / 3728) * k;
    274     }
     233  }
    275234 
    276235  phi = twopi * G4UniformRand();
    277236  cosTheta = std::sqrt(secKinetic / maxSecKinetic);
    278237}
     238
     239//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    279240
    280241
     
    314275
    315276  if (j == 4)
    316     {
     277  {
    317278      //Data For Liquid Water K SHELL from Dingfelder (Protons in Water)
    318279      A1 = 1.25;
     
    326287      D2 = 0.00;
    327288      alphaConst = 0.66;
    328     }
     289  }
    329290  else
    330     {
     291  {
    331292      //Data For Liquid Water from Dingfelder (Protons in Water)
    332293      A1 = 1.02;
     
    340301      D2 = 0.04;
    341302      alphaConst = 0.64;
    342     }
     303  }
    343304 
    344305  const G4double n = 2.;
    345306  const G4double Gj[5] = {0.99, 1.11, 1.11, 0.52, 1.};
    346 
    347   //const G4double I[5]={12.61*eV, 14.73*eV, 18.55*eV, 32.2*eV, 539.7*eV}; // for water Vapor
    348   //const G4double energyConstant[]={10.79*eV, 13.39*eV, 16.05*eV, 32.30*eV, 539.*eV};
    349307
    350308  G4DNAGenericIonsManager* instance;
     
    359317  if (particleDefinition == G4Proton::ProtonDefinition()
    360318      || particleDefinition == instance->GetIon("hydrogen"))
    361     {
     319  {
    362320      tau = (electron_mass_c2/proton_mass_c2) * k ;
    363     }
     321  }
    364322   
    365323  if ( particleDefinition == instance->GetIon("helium")
    366324       || particleDefinition == instance->GetIon("alpha+")
    367325       || particleDefinition == instance->GetIon("alpha++"))
    368     {
     326  {
    369327      tau = (0.511/3728.) * k ;
    370     }
     328  }
    371329 
    372330  G4double S = 4.*pi * Bohr_radius*Bohr_radius * n * std::pow((Ry/waterStructure.IonisationEnergy(ionizationLevelIndex)),2);
     
    390348          || particleDefinition == instance->GetIon("hydrogen")
    391349          )
    392     {
     350  {
    393351      return(sigma);
    394     }
    395 
    396   // ------------
    397  
     352  }
     353
    398354  if (particleDefinition == instance->GetIon("alpha++") )
    399     {
     355  {
    400356      slaterEffectiveCharge[0]=0.;
    401357      slaterEffectiveCharge[1]=0.;
     
    404360      sCoefficient[1]=0.;
    405361      sCoefficient[2]=0.;
    406     }
     362  }
    407363
    408364  if (particleDefinition == instance->GetIon("alpha+") )
    409     {
     365  {
    410366      slaterEffectiveCharge[0]=2.0;
    411367      slaterEffectiveCharge[1]=1.15;
     
    414370      sCoefficient[1]=0.15;
    415371      sCoefficient[2]=0.15;
    416     }
     372  }
    417373
    418374  if (particleDefinition == instance->GetIon("helium") )
    419     {
     375  {
    420376      slaterEffectiveCharge[0]=1.7;
    421377      slaterEffectiveCharge[1]=1.15;
     
    424380      sCoefficient[1]=0.25;
    425381      sCoefficient[2]=0.25;
    426     }
     382  }
    427383 
    428384  if (    particleDefinition == instance->GetIon("helium")
     
    430386          || particleDefinition == instance->GetIon("alpha++")
    431387          )
    432     {
     388  {
    433389      sigma = Gj[j] * (S/waterStructure.IonisationEnergy(ionizationLevelIndex)) * ( (F1+w*F2) / ( std::pow((1.+w),3) * ( 1.+std::exp(alphaConst*(w-wc)/v))) );
    434390   
     
    440396           
    441397      return zEff * zEff * sigma ;
    442    
     398 
    443399 
    444400  return 0;
    445401}
     402
     403//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    446404
    447405G4double G4FinalStateIonisationRudd::S_1s(G4double t,
     
    459417}
    460418
    461 
     419//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    462420
    463421G4double G4FinalStateIonisationRudd::S_2s(G4double t,
     
    476434}
    477435
    478 
     436//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    479437
    480438G4double G4FinalStateIonisationRudd::S_2p(G4double t,
     
    492450}
    493451
    494 
     452//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    495453
    496454G4double G4FinalStateIonisationRudd::R(G4double t,
     
    500458{
    501459  // tElectron = m_electron / m_alpha * t
    502   // Hardcoded in Riccardo's implementation; to be corrected
    503460  // Dingfelder, in Chattanooga 2005 proceedings, p 4
    504461
     
    509466}
    510467
    511 
     468//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    512469
    513470G4double G4FinalStateIonisationRudd::CorrectionFactor(G4ParticleDefinition* particleDefinition, G4double k)
     
    517474
    518475  if (particleDefinition == G4Proton::Proton())
    519     {
     476  {
    520477      return(1.);
    521     }
     478  }
    522479  else
    523480    if (particleDefinition == instance->GetIon("hydrogen"))
    524       {
     481    {
    525482        G4double value = (std::log(k/eV)-4.2)/0.5;
    526483        return((0.8/(1+std::exp(value))) + 0.9);
    527       }
     484    }
    528485    else
    529       {   
     486    {   
    530487        return(1.);
    531       }
    532 }
     488    }
     489}
  • trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateKill.cc

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

    r819 r961  
    2525//
    2626//
    27 // $Id: G4FinalStateProduct.cc,v 1.5 2007/11/09 20:11:04 pia Exp $
    28 // GEANT4 tag $Name: $
     27// $Id: G4FinalStateProduct.cc,v 1.6 2009/01/20 07:50:28 sincerti Exp $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
     
    5353#include "G4ThreeVector.hh"
    5454
    55 G4FinalStateProduct::G4FinalStateProduct() : killStatus(false), isModified(false), localEnergyDeposit(0.), modifiedEnergy(0)
     55G4FinalStateProduct::G4FinalStateProduct() : killStatus(false), doNotDepositStatus(false), isModified(false), localEnergyDeposit(0.), modifiedEnergy(0)
    5656{
    5757  // empty
     
    6868  // Reset object status
    6969  killStatus = false;
     70  doNotDepositStatus = false;
    7071  isModified = false;
    7172  localEnergyDeposit = 0.;
     
    9899}
    99100 
     101void G4FinalStateProduct::DoNotDepositEnergy()
     102{
     103  doNotDepositStatus = true;
     104}
     105
    100106void G4FinalStateProduct::KillPrimaryParticle()
    101107{
     108 
    102109  // ---- MGP ---- To be added: Handle local energy deposit here
    103110  killStatus = true;
  • trunk/source/processes/electromagnetic/lowenergy/src/G4FluoTransition.cc

    r819 r961  
    2626//
    2727// $Id: G4FluoTransition.cc,v 1.2 ????
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Author: Elena Guardincerri (Elena.Guardincerri@ge.infn.it)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LinInterpolation.cc

    r819 r961  
    2626//
    2727// $Id: G4LinInterpolation.cc,v 1.3 2006/06/29 19:40:03 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LogLogInterpolation.cc

    r819 r961  
    2525//
    2626//
    27 // $Id: G4LogLogInterpolation.cc,v 1.7 2006/06/29 19:40:09 gunter Exp $
    28 // GEANT4 tag $Name: $
     27// $Id: G4LogLogInterpolation.cc,v 1.14 2008/12/12 08:50:59 sincerti Exp $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
    31 //
     31//         Sebastian Incerti (incerti@cenbg.in2p3.fr)
     32//         Nicolas A. Karakatsanis (knicolas@mail.ntua.gr)
    3233// History:
    3334// -----------
    3435// 31 Jul 2001   MGP        Created
    35 //
     36// 27 Jun 2008   SI         Add check to avoid FPE errors
     37// 08 Dec 2008   NAK        Log-Log interpolation math formula streamlined, self-test function
    3638// -------------------------------------------------------------------
    3739
     
    5759{
    5860  G4int nBins = data.size() - 1;
     61//G4double oldresult = 0.;
    5962  G4double value = 0.;
    6063  if (x < points[0])
     
    6871      G4double d1 = data[bin];
    6972      G4double d2 = data[bin+1];
    70       value = (std::log10(d1)*std::log10(e2/x) + std::log10(d2)*std::log10(x/e1)) / std::log10(e2/e1);
    71       value = std::pow(10.,value);
     73// Check of e1, e2, d1 and d2 values to avoid floating-point errors when estimating the interpolated value below -- S.I., Jun. 2008
     74      if ((d1 > 0.) && (d2 > 0.) && (e1 > 0.) && (e2 > 0.))
     75        {
     76// Streamline the Log-Log Interpolation formula in order to reduce the required number of log10() function calls
     77// Variable oldresult contains the result of old implementation of Log-Log interpolation -- M.G.P. Jun. 2001
     78//       oldresult = (std::log10(d1)*std::log10(e2/x) + std::log10(d2)*std::log10(x/e1)) / std::log10(e2/e1);
     79//       oldresult = std::pow(10.,oldresult);
     80// Variable value contains the result of new implementation, after streamlining the math operation -- N.A.K. Oct. 2008
     81         value = std::log10(d1)+(std::log10(d2/d1)/std::log10(e2/e1)*std::log10(x/e1));
     82         value = std::pow(10.,value);
     83// Test of the new implementation result (value variable) against the old one (oldresult) -- N.A.K. Dec. 2008
     84//       G4double diffResult = value - oldresult;
     85//       G4double relativeDiff = 1e-11;
     86// Comparison of the two values based on a max allowable relative difference
     87//       if ( std::fabs(diffResult) > relativeDiff*std::fabs(oldresult) )
     88//        {
     89// Abort comparison when at least one of two results is infinite
     90//           if ((!std::isinf(oldresult)) && (!std::isinf(value)))
     91//            {
     92//              G4cout << "G4LogLogInterpolation> Old Interpolated Value is:" << oldresult << G4endl;
     93//              G4cout << "G4LogLogInterpolation> New Interpolated Value is:" << value << G4endl << G4endl;
     94//              G4cerr << "G4LogLogInterpolation> Error in Interpolation:" << G4endl;
     95//              G4cerr << "The difference between new and old interpolated value is:" << diffResult << G4endl << G4endl;
     96//            }
     97//        }
     98        }
     99      else value = 0.;
    72100    }
    73101  else
     
    75103      value = data[nBins];
    76104    }
    77 
    78105  return value;
    79106}
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LowEnergyBremsstrahlung.cc

    r819 r961  
    2525//
    2626// $Id: G4LowEnergyBremsstrahlung.cc,v 1.71 2006/06/29 19:40:13 gunter Exp $
    27 // GEANT4 tag $Name: $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// --------------------------------------------------------------
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LowEnergyCompton.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4LowEnergyCompton.cc,v 1.41 2006/06/29 19:40:15 gunter Exp $
    27 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     26// $Id: G4LowEnergyCompton.cc,v 1.47 2008/12/18 13:01:28 gunter Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// Author: A. Forti
     
    6565#include "G4VRangeTest.hh"
    6666#include "G4RangeTest.hh"
     67#include "G4RangeNoTest.hh"
    6768#include "G4MaterialCutsCouple.hh"
    6869
     
    9091  meanFreePathTable = 0;
    9192
    92   rangeTest = new G4RangeTest;
     93  rangeTest = new G4RangeNoTest;
     94
     95  // For Doppler broadening
     96  shellData.SetOccupancyData();
    9397
    9498   if (verboseLevel > 0)
     
    119123  delete meanFreePathTable;
    120124  meanFreePathTable = crossSectionHandler->BuildMeanFreePathForMaterials();
     125
     126  // For Doppler broadening
     127  G4String file = "/doppler/shell-doppler";
     128  shellData.LoadData(file);
    121129}
    122130
     
    154162  G4double e0m = photonEnergy0 / electron_mass_c2 ;
    155163  G4ParticleMomentum photonDirection0 = incidentPhoton->GetMomentumDirection();
    156 
    157   // Select randomly one element in the current material
    158   const G4MaterialCutsCouple* couple = aTrack.GetMaterialCutsCouple();
    159   G4int Z = crossSectionHandler->SelectRandomAtom(couple,photonEnergy0);
    160 
    161164  G4double epsilon0 = 1. / (1. + 2. * e0m);
    162165  G4double epsilon0Sq = epsilon0 * epsilon0;
    163166  G4double alpha1 = -std::log(epsilon0);
    164167  G4double alpha2 = 0.5 * (1. - epsilon0Sq);
    165 
    166168  G4double wlPhoton = h_Planck*c_light/photonEnergy0;
     169
     170  // Select randomly one element in the current material
     171  const G4MaterialCutsCouple* couple = aTrack.GetMaterialCutsCouple();
     172  G4int Z = crossSectionHandler->SelectRandomAtom(couple,photonEnergy0);
    167173
    168174  // Sample the energy of the scattered photon
     
    196202  G4double sinTheta = std::sqrt (sinT2);
    197203  G4double phi = twopi * G4UniformRand() ;
    198   G4double dirx = sinTheta * std::cos(phi);
    199   G4double diry = sinTheta * std::sin(phi);
    200   G4double dirz = cosTheta ;
     204  G4double dirX = sinTheta * std::cos(phi);
     205  G4double dirY = sinTheta * std::sin(phi);
     206  G4double dirZ = cosTheta ;
     207
     208  // Doppler broadening -  Method based on:
     209  // Y. Namito, S. Ban and H. Hirayama,
     210  // "Implementation of the Doppler Broadening of a Compton-Scattered Photon Into the EGS4 Code"
     211  // NIM A 349, pp. 489-494, 1994
     212 
     213  // Maximum number of sampling iterations
     214  G4int maxDopplerIterations = 1000;
     215  G4double bindingE = 0.;
     216  G4double photonEoriginal = epsilon * photonEnergy0;
     217  G4double photonE = -1.;
     218  G4int iteration = 0;
     219  G4double eMax = photonEnergy0;
     220  do
     221    {
     222      iteration++;
     223      // Select shell based on shell occupancy
     224      G4int shell = shellData.SelectRandomShell(Z);
     225      bindingE = shellData.BindingEnergy(Z,shell);
     226     
     227      eMax = photonEnergy0 - bindingE;
     228     
     229      // Randomly sample bound electron momentum (memento: the data set is in Atomic Units)
     230      G4double pSample = profileData.RandomSelectMomentum(Z,shell);
     231      // Rescale from atomic units
     232      G4double pDoppler = pSample * fine_structure_const;
     233      G4double pDoppler2 = pDoppler * pDoppler;
     234      G4double var2 = 1. + oneCosT * e0m;
     235      G4double var3 = var2*var2 - pDoppler2;
     236      G4double var4 = var2 - pDoppler2 * cosTheta;
     237      G4double var = var4*var4 - var3 + pDoppler2 * var3;
     238      if (var > 0.)
     239        {
     240          G4double varSqrt = std::sqrt(var);       
     241          G4double scale = photonEnergy0 / var3; 
     242          // Random select either root
     243          if (G4UniformRand() < 0.5) photonE = (var4 - varSqrt) * scale;               
     244          else photonE = (var4 + varSqrt) * scale;
     245        }
     246      else
     247        {
     248          photonE = -1.;
     249        }
     250   } while ( iteration <= maxDopplerIterations &&
     251             (photonE < 0. || photonE > eMax || photonE < eMax*G4UniformRand()) );
     252 
     253  // End of recalculation of photon energy with Doppler broadening
     254  // Revert to original if maximum number of iterations threshold has been reached
     255  if (iteration >= maxDopplerIterations)
     256    {
     257      photonE = photonEoriginal;
     258      bindingE = 0.;
     259    }
    201260
    202261  // Update G4VParticleChange for the scattered photon
    203262
    204   G4ThreeVector photonDirection1(dirx,diry,dirz);
     263  G4ThreeVector photonDirection1(dirX,dirY,dirZ);
    205264  photonDirection1.rotateUz(photonDirection0);
    206   aParticleChange.ProposeMomentumDirection(photonDirection1) ;
    207   G4double photonEnergy1 = epsilon * photonEnergy0;
     265  aParticleChange.ProposeMomentumDirection(photonDirection1);
     266 
     267  G4double photonEnergy1 = photonE;
     268  //G4cout << "--> PHOTONENERGY1 = " << photonE/keV << G4endl;
    208269
    209270  if (photonEnergy1 > 0.)
     
    218279
    219280  // Kinematics of the scattered electron
    220   G4double eKineticEnergy = photonEnergy0 - photonEnergy1;
     281  G4double eKineticEnergy = photonEnergy0 - photonEnergy1 - bindingE;
     282  G4double eTotalEnergy = eKineticEnergy + electron_mass_c2;
     283
     284  G4double electronE = photonEnergy0 * (1. - epsilon) + electron_mass_c2;
     285  G4double electronP2 = electronE*electronE - electron_mass_c2*electron_mass_c2;
     286  G4double sinThetaE = -1.;
     287  G4double cosThetaE = 0.;
     288  if (electronP2 > 0.)
     289    {
     290      cosThetaE = (eTotalEnergy + photonEnergy1 )* (1. - epsilon) / std::sqrt(electronP2);
     291      sinThetaE = -1. * std::sqrt(1. - cosThetaE * cosThetaE);
     292    }
     293 
     294  G4double eDirX = sinThetaE * std::cos(phi);
     295  G4double eDirY = sinThetaE * std::sin(phi);
     296  G4double eDirZ = cosThetaE;
    221297
    222298  // Generate the electron only if with large enough range w.r.t. cuts and safety
     
    226302  if (rangeTest->Escape(G4Electron::Electron(),couple,eKineticEnergy,safety))
    227303    {
    228       G4double eMomentum = std::sqrt(eKineticEnergy*(eKineticEnergy+2.*electron_mass_c2));
    229       G4ThreeVector eDirection((photonEnergy0 * photonDirection0 -
    230                                 photonEnergy1 * photonDirection1) * (1./eMomentum));
    231       G4DynamicParticle* electron = new G4DynamicParticle (G4Electron::Electron(),
    232                                                            eDirection,eKineticEnergy) ;
     304      G4ThreeVector eDirection(eDirX,eDirY,eDirZ);
     305      eDirection.rotateUz(photonDirection0);
     306
     307      G4DynamicParticle* electron = new G4DynamicParticle (G4Electron::Electron(),eDirection,eKineticEnergy) ;
    233308      aParticleChange.SetNumberOfSecondaries(1);
    234309      aParticleChange.AddSecondary(electron);
    235       aParticleChange.ProposeLocalEnergyDeposit(0.);
     310      // Binding energy deposited locally
     311      aParticleChange.ProposeLocalEnergyDeposit(bindingE);
    236312    }
    237313  else
    238314    {
    239315      aParticleChange.SetNumberOfSecondaries(0);
    240       aParticleChange.ProposeLocalEnergyDeposit(eKineticEnergy);
     316      aParticleChange.ProposeLocalEnergyDeposit(eKineticEnergy + bindingE);
    241317    }
    242318
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LowEnergyGammaConversion.cc

    r819 r961  
    2727///
    2828// $Id: G4LowEnergyGammaConversion.cc,v 1.36 2006/06/29 19:40:17 gunter Exp $
    29 // GEANT4 tag $Name: $
     29// GEANT4 tag $Name: geant4-09-02-ref-02 $
    3030//
    3131//
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LowEnergyIonisation.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4LowEnergyIonisation.cc,v 1.102 2006/06/29 19:40:19 gunter Exp $
    27 // GEANT4 tag $Name: $
     26// $Id: G4LowEnergyIonisation.cc,v 1.103 2008/05/02 19:23:38 pia Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// --------------------------------------------------------------
     
    663663                  type = aSecondary->GetDefinition();
    664664                  if ( eTot + e <= eLoss &&
    665                      (type == G4Gamma::Gamma() && e>cutForPhotons ) ||
    666                      (type == G4Electron::Electron() && e>cutForElectrons)) {
     665                     ((type == G4Gamma::Gamma() && e>cutForPhotons ) ||
     666                     (type == G4Electron::Electron() && e>cutForElectrons))) {
    667667
    668668                          eTot += e;
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LowEnergyPhotoElectric.cc

    r819 r961  
    2626//
    2727// $Id: G4LowEnergyPhotoElectric.cc,v 1.56 2006/06/29 19:40:23 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Author: A. Forti
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LowEnergyPolarizedCompton.cc

    r819 r961  
    2525//
    2626//
    27 // $Id: G4LowEnergyPolarizedCompton.cc,v 1.22 2006/06/29 19:40:25 gunter Exp $
    28 // GEANT4 tag $Name: $
     27// $Id: G4LowEnergyPolarizedCompton.cc,v 1.25 2008/05/02 19:23:38 pia Exp $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// ------------------------------------------------------------
     
    110110  rangeTest = new G4RangeTest;
    111111
     112  // For Doppler broadening
     113  shellData.SetOccupancyData();
     114
     115
    112116   if (verboseLevel > 0)
    113117     {
     
    139143  delete meanFreePathTable;
    140144  meanFreePathTable = crossSectionHandler->BuildMeanFreePathForMaterials();
     145
     146  // For Doppler broadening
     147  G4String file = "/doppler/shell-doppler";
     148  shellData.LoadData(file);
     149
    141150}
    142151
     
    327336  G4double dirz = cosTheta ;
    328337 
     338
     339  // oneCosT , eom
     340
     341
     342
     343  // Doppler broadening -  Method based on:
     344  // Y. Namito, S. Ban and H. Hirayama,
     345  // "Implementation of the Doppler Broadening of a Compton-Scattered Photon Into the EGS4 Code"
     346  // NIM A 349, pp. 489-494, 1994
     347 
     348  // Maximum number of sampling iterations
     349
     350  G4int maxDopplerIterations = 1000;
     351  G4double bindingE = 0.;
     352  G4double photonEoriginal = epsilon * gammaEnergy0;
     353  G4double photonE = -1.;
     354  G4int iteration = 0;
     355  G4double eMax = gammaEnergy0;
     356
     357  do
     358    {
     359      iteration++;
     360      // Select shell based on shell occupancy
     361      G4int shell = shellData.SelectRandomShell(Z);
     362      bindingE = shellData.BindingEnergy(Z,shell);
     363     
     364      eMax = gammaEnergy0 - bindingE;
     365     
     366      // Randomly sample bound electron momentum (memento: the data set is in Atomic Units)
     367      G4double pSample = profileData.RandomSelectMomentum(Z,shell);
     368      // Rescale from atomic units
     369      G4double pDoppler = pSample * fine_structure_const;
     370      G4double pDoppler2 = pDoppler * pDoppler;
     371      G4double var2 = 1. + onecost * E0_m;
     372      G4double var3 = var2*var2 - pDoppler2;
     373      G4double var4 = var2 - pDoppler2 * cosTheta;
     374      G4double var = var4*var4 - var3 + pDoppler2 * var3;
     375      if (var > 0.)
     376        {
     377          G4double varSqrt = std::sqrt(var);       
     378          G4double scale = gammaEnergy0 / var3; 
     379          // Random select either root
     380          if (G4UniformRand() < 0.5) photonE = (var4 - varSqrt) * scale;               
     381          else photonE = (var4 + varSqrt) * scale;
     382        }
     383      else
     384        {
     385          photonE = -1.;
     386        }
     387   } while ( iteration <= maxDopplerIterations &&
     388             (photonE < 0. || photonE > eMax || photonE < eMax*G4UniformRand()) );
     389 
     390  // End of recalculation of photon energy with Doppler broadening
     391  // Revert to original if maximum number of iterations threshold has been reached
     392  if (iteration >= maxDopplerIterations)
     393    {
     394      photonE = photonEoriginal;
     395      bindingE = 0.;
     396    }
     397
     398  gammaEnergy1 = photonE;
     399 
     400  // G4cout << "--> PHOTONENERGY1 = " << photonE/keV << G4endl;
     401
     402
     403  /// Doppler Broadeing
     404
     405
     406
     407
    329408  //
    330409  // update G4VParticleChange for the scattered photon
    331410  //
    332411
    333   gammaEnergy1 = epsilon*gammaEnergy0;
     412  //  gammaEnergy1 = epsilon*gammaEnergy0;
     413
    334414
    335415  // New polarization
     
    365445  //
    366446
    367   G4double ElecKineEnergy = gammaEnergy0 - gammaEnergy1 ;
     447  G4double ElecKineEnergy = gammaEnergy0 - gammaEnergy1 -bindingE;
     448
    368449
    369450  // Generate the electron only if with large enough range w.r.t. cuts and safety
    370451
    371452  G4double safety = aStep.GetPostStepPoint()->GetSafety();
     453
    372454
    373455  if (rangeTest->Escape(G4Electron::Electron(),couple,ElecKineEnergy,safety))
     
    379461      aParticleChange.SetNumberOfSecondaries(1);
    380462      aParticleChange.AddSecondary(electron);
    381       aParticleChange.ProposeLocalEnergyDeposit(0.);
     463      //      aParticleChange.ProposeLocalEnergyDeposit(0.);
     464      aParticleChange.ProposeLocalEnergyDeposit(bindingE);
    382465    }
    383466  else
    384467    {
    385468      aParticleChange.SetNumberOfSecondaries(0);
    386       aParticleChange.ProposeLocalEnergyDeposit(ElecKineEnergy);
     469      aParticleChange.ProposeLocalEnergyDeposit(ElecKineEnergy+bindingE);
    387470    }
    388471 
     
    492575  //  G4double sinsqrphi = sinPhi*sinPhi;
    493576  G4double normalisation = std::sqrt(1. - cosSqrPhi*sinSqrTh);
    494   
     577 
    495578
    496579  // Determination of Theta
    497580 
    498   G4double thetaProbability;
     581  // ---- MGP ---- Commented out the following 3 lines to avoid compilation
     582  // warnings (unused variables)
     583  // G4double thetaProbability;
    499584  G4double theta;
    500   G4double a, b;
    501   G4double cosTheta;
    502 
     585  // G4double a, b;
     586  // G4double cosTheta;
     587
     588  /*
     589
     590  depaola method
     591 
    503592  do
    504     {
     593  {
    505594      rand1 = G4UniformRand();
    506595      rand2 = G4UniformRand();
     
    515604 
    516605  G4double cosBeta = cosTheta;
     606
     607  */
     608
     609
     610  // Dan Xu method (IEEE TNS, 52, 1160 (2005))
     611
     612  rand1 = G4UniformRand();
     613  rand2 = G4UniformRand();
     614
     615  if (rand1<(epsilon+1.0/epsilon-2)/(2.0*(epsilon+1.0/epsilon)-4.0*sinSqrTh*cosSqrPhi))
     616    {
     617      if (rand2<0.5)
     618        theta = pi/2.0;
     619      else
     620        theta = 3.0*pi/2.0;
     621    }
     622  else
     623    {
     624      if (rand2<0.5)
     625        theta = 0;
     626      else
     627        theta = pi;
     628    }
     629  G4double cosBeta = std::cos(theta);
    517630  G4double sinBeta = std::sqrt(1-cosBeta*cosBeta);
    518631 
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LowEnergyPolarizedRayleigh.cc

    r819 r961  
    2525//
    2626// $Id: G4LowEnergyPolarizedRayleigh.cc,v 1.7 2006/06/29 19:40:27 gunter Exp $
    27 // GEANT4 tag $Name: $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// --------------------------------------------------------------
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LowEnergyRayleigh.cc

    r819 r961  
    2727//
    2828// $Id: G4LowEnergyRayleigh.cc,v 1.37 2006/06/29 19:40:29 gunter Exp $
    29 // GEANT4 tag $Name: $
     29// GEANT4 tag $Name: geant4-09-02-ref-02 $
    3030//
    3131// Author: A. Forti
  • trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeBremsstrahlung.cc

    r819 r961  
    2525//
    2626// $Id: G4PenelopeBremsstrahlung.cc,v 1.18 2006/06/29 19:40:35 gunter Exp $
    27 // GEANT4 tag $Name: $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// --------------------------------------------------------------
  • trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeBremsstrahlungAngular.cc

    r819 r961  
    2525//
    2626// $Id: G4PenelopeBremsstrahlungAngular.cc,v 1.7 2006/06/29 19:40:37 gunter Exp $
    27 // GEANT4 tag $Name: $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// --------------------------------------------------------------
  • trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeBremsstrahlungContinuous.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PenelopeBremsstrahlungContinuous.cc,v 1.9 2006/06/29 19:40:39 gunter Exp $
    27 // GEANT4 tag $Name: $
     26// $Id: G4PenelopeBremsstrahlungContinuous.cc,v 1.11 2008/12/15 09:23:06 pandola Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// --------------------------------------------------------------
     
    4040// 19 Mar 2003  L. Pandola       Bugs fixed
    4141// 17 Mar 2004  L. Pandola       Removed unnecessary calls to std::pow(a,b)
     42// 09 Dec 2008  L. Pandola       Update ReadFile() in a way to make explicit use of the units of
     43//                               measurement. Also some cosmetics to improve readibility.
    4244//----------------------------------------------------------------
    4345
     
    5153#include <sstream>
    5254
    53 G4PenelopeBremsstrahlungContinuous::G4PenelopeBremsstrahlungContinuous (G4int Zed,G4double taglio,G4double e1,
     55G4PenelopeBremsstrahlungContinuous::G4PenelopeBremsstrahlungContinuous (G4int Zed,G4double cut,
     56                                                                        G4double e1,
    5457                                                                        G4double e2,
    5558                                                                        const G4String name)  :
    56   Zmat(Zed),tCut(taglio),MinE(e1),MaxE(e2),partName(name)
     59  Zmat(Zed),tCut(cut),MinE(e1),MaxE(e2),partName(name)
    5760{
    5861  //Construct extended energy table     
     
    7174}
    7275
     76//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    7377
    7478G4PenelopeBremsstrahlungContinuous::~G4PenelopeBremsstrahlungContinuous()
    75 {
    76 }
     79{;}
     80
     81//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    7782
    7883void G4PenelopeBremsstrahlungContinuous::LoadFromFile()
     
    9297 G4String dirFile = pathString + "/penelope/" + name;
    9398 std::ifstream file(dirFile);
    94  std::filebuf* lsdp = file.rdbuf();
    95  if (!(lsdp->is_open()))
     99 if (!file.is_open())
    96100     {
    97101      G4String excep = "G4PenelopeBremsstrahlungContinuous - data file " + name + " not found!";
    98102      G4Exception(excep);
    99103     }
    100  G4double a1;
    101  for (size_t i=0;i<NumberofEPoints;i++){
    102    file >> a1;
    103    Energies[i]=a1;
    104    for (size_t j=0;j<NumberofKPoints;j++){
     104 G4double a1 = -1.;
     105 for (size_t i=0;i<NumberofEPoints;i++)
     106   {
    105107     file >> a1;
    106      ReducedCS[i][j]=a1/millibarn; //coversion present in Penelope source
     108     //1) reads energy in MeV
     109     Energies[i]=a1*MeV;
     110     //2) read 32 cross sections in cm2
     111     for (size_t j=0;j<NumberofKPoints;j++){
     112       file >> a1;
     113       ReducedCS[i][j]=a1*cm2;
     114     }
     115     //3) read the total cross section, in cm2
     116     file >> a1;
     117     TotalCS[i]=a1*cm2;
     118     // Check closing item
     119     file >> a1;
     120     if (a1 != ((G4double) -1))
     121       {
     122         G4String excep = "G4PenelopeBremsstrahlungContinuous - Check the bremms data file "
     123           + name;
     124         G4Exception(excep);
     125       }
    107126   }
    108    file >> a1;
    109    TotalCS[i]=a1/millibarn; //conversion present in Penelope source
    110    file >> a1;
    111    if (a1 != ((G4double) -1)){
    112      G4String excep = "G4PenelopeBremsstrahlungContinuous - Check the bremms data file "+ name;
    113      G4Exception(excep);
    114    }
    115  }
    116 
    117127 file.close();
    118128}
     129
     130//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    119131
    120132void G4PenelopeBremsstrahlungContinuous::PrepareInterpolationTable()
     
    138150   
    139151    delete interpolator;
    140     G4double Fact = (millibarn/cm2)*(Energies[i]+electron_mass_c2)*(1.0/fine_structure_const)/
     152    G4double Fact = (Energies[i]+electron_mass_c2)*(1.0/fine_structure_const)*millibarn/
    141153      (classic_electr_radius*classic_electr_radius*(Energies[i]+2.0*electron_mass_c2));
    142154    G4double Normalization = TotalCS[i]/(Rsum*Fact);
    143     G4double TST = std::abs(Normalization-100.0);
     155    G4double TST = std::abs(Normalization-1.0);
    144156    if (TST > 1.0) {
    145157      G4String excep = "G4PenelopeBremsstrahlungContinuous - Check the bremms data file";
     
    181193  }
    182194 
    183   //Forse questa roba (e Pbcut come membro privato) non serve
    184  //  G4double PDF[NumberofKPoints];
    185  
    186 //   for (i=0;i<NumberofExtendedEGrid;i++){
    187 //     for (j=0;j<NumberofKPoints;j++){
    188 //       PDF[j]=p0[i][j];
    189 //     }
    190 //     G4double Xc=0;
    191 //     if (i<(NumberofExtendedEGrid-1)){
    192 //       Xc=tCut/std::exp(ExtendedLogEnergy[i+1]);
    193 //     }
    194 //     else
    195 //       {
    196 //      Xc=tCut/std::exp(ExtendedLogEnergy[NumberofExtendedEGrid-1]);
    197 //       }
     195  //All this stuff might be useful later on
     196  /*
     197  G4double PDF[NumberofKPoints];
     198 
     199  for (i=0;i<NumberofExtendedEGrid;i++){
     200    for (j=0;j<NumberofKPoints;j++){
     201      PDF[j]=p0[i][j];
     202    }
     203    G4double Xc=0;
     204    if (i<(NumberofExtendedEGrid-1)){
     205      Xc=tCut/std::exp(ExtendedLogEnergy[i+1]);
     206    }
     207    else
     208      {
     209        Xc=tCut/std::exp(ExtendedLogEnergy[NumberofExtendedEGrid-1]);
     210      }
    198211   
    199 //     G4PenelopeInterpolator* interpolator3 = new G4PenelopeInterpolator(pK,PDF,NumberofKPoints);
    200 //     Pbcut[i]=interpolator3->CalculateMomentum(Xc,-1);
    201 //     delete interpolator3;
    202 //   }
    203  
    204 }
     212    G4PenelopeInterpolator* interpolator3 = new G4PenelopeInterpolator(pK,PDF,NumberofKPoints);
     213    Pbcut[i]=interpolator3->CalculateMomentum(Xc,-1);
     214    delete interpolator3;
     215  }
     216  */
     217 
     218}
     219
     220//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    205221                       
    206 G4double G4PenelopeBremsstrahlungContinuous::CalculateStopping(G4double e1)
     222G4double G4PenelopeBremsstrahlungContinuous::CalculateStopping(G4double energy)
    207223  //Stopping power expressed in MeV/mm*2
    208224{
    209   G4double Xel=std::max(std::log(e1),ExtendedLogEnergy[0]);
     225  G4double Xel=std::max(std::log(energy),ExtendedLogEnergy[0]);
    210226  G4double Xe=1.0+(Xel-ExtendedLogEnergy[0])*DLFC;
    211227  G4int Ke = (G4int) Xe;
     
    213229 
    214230  //Global x-section factor
    215   G4double Fact=Zmat*Zmat*(e1+electron_mass_c2)*(e1+electron_mass_c2)/(e1*(e1+2.0*electron_mass_c2))
    216   *(millibarn/cm2);
    217   Fact=Fact*PositronCorrection(e1);
     231  G4double Fact=Zmat*Zmat*(energy+electron_mass_c2)*(energy+electron_mass_c2)/
     232    (energy*(energy+2.0*electron_mass_c2));
     233  Fact *= PositronCorrection(energy);
    218234
    219235  //Moments of the scaled bremss x-section
    220   G4double wcre = tCut/e1;
     236  G4double wcre = tCut/energy;
    221237  G4double pY[NumberofKPoints];
    222238  G4double pK[NumberofKPoints] = {1.0e-12,0.05,0.075,0.1,0.125,0.15,0.2,0.25,
     
    230246  G4PenelopeInterpolator* interpolator1 = new G4PenelopeInterpolator(pK,pY,NumberofKPoints);
    231247  G4double XS1A = interpolator1->CalculateMomentum(wcre,0);
    232   G4double XS2A = interpolator1->CalculateMomentum(wcre,1);
    233   delete interpolator1;
    234248  for (size_t k=0;k<NumberofKPoints;k++){
    235249    pY[k] = p0[std::min(Ke+1,(G4int) NumberofExtendedEGrid-1)][k];
     
    237251  G4PenelopeInterpolator* interpolator2 = new G4PenelopeInterpolator (pK,pY,NumberofKPoints);
    238252  G4double XS1B = interpolator2->CalculateMomentum(wcre,0);
    239   G4double XS2B = interpolator2->CalculateMomentum(wcre,1);
     253 
     254  G4double XS1 = ((1.0-Xek)*XS1A+Xek*XS1B)*Fact*energy; //weighted mean between the energy bin of the grid
     255
     256  //This is the 2nd momentum (straggling cross section). It might be useful later on
     257  /*
     258    G4double XS2A = interpolator1->CalculateMomentum(wcre,1);
     259    G4double XS2 = ((1.0-Xek)*XS2A+Xek*XS2B)*Fact*energy*energy;
     260    G4double XS2B = interpolator2->CalculateMomentum(wcre,1);
     261  */
     262
     263  delete interpolator1;
    240264  delete interpolator2;
    241  
    242   G4double XS1 = ((1.0-Xek)*XS1A+Xek*XS1B)*Fact*e1; //weighted mean between the energy bin of the grid
    243   G4double XS2 = ((1.0-Xek)*XS2A+Xek*XS2B)*Fact*e1*e1; //straggling cross section (2nd momentum);
    244   //Il secondo momento XS2 potrebbe tornare utile in seguito
    245 
    246   //XS1 is given in MeV*cm2, as in Penelope, but it must be converted in MeV*mm2
    247   XS1=XS1*cm2/mm2;
    248   //XS2 is given in MeV2*cm2, as in Penelope, but it must be converted in MeV2*mm2
    249   XS2=XS2*cm2/mm2;
    250 
    251   //Deve includere anche le famose correzioni per tenere conto
    252   //che la sezione d'urto varia sullo step!
    253   //Il valore che tira fuori va nella tabella e non viene piu' modificato
     265
    254266  return XS1;
    255267}
    256268
    257 G4double G4PenelopeBremsstrahlungContinuous::PositronCorrection(G4double en)
     269//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     270
     271G4double G4PenelopeBremsstrahlungContinuous::PositronCorrection(G4double energy)
    258272{
    259273  const G4double Coeff[7]={-1.2359e-01,6.1274e-2,-3.1516e-2,7.7446e-3,-1.0595e-3,
    260274                           7.0568e-5,-1.8080e-6};
    261   G4double T=0;
    262275  G4double correct=0;
    263276  if (partName == "e-") {
     
    265278  }
    266279  else if (partName == "e+"){
    267     T=std::log(1+((1e6*en)/(Zmat*Zmat*electron_mass_c2)));
     280    G4double T=std::log(1+((1e6*energy)/(Zmat*Zmat*electron_mass_c2)));
    268281    for (G4int i=0;i<7;i++){
    269282      correct += Coeff[i]*std::pow(T,i+1);
     
    272285    return correct;
    273286  }
    274   else //ne' elettroni ne' positroni...exception
     287  else //neither electrons nor positrons...exception
    275288    {
    276289      G4String excep = "G4PenelopeBremmstrahlungContinuous: the particle is not e- nor e+!";
  • trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeCompton.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PenelopeCompton.cc,v 1.26 2006/06/29 19:40:41 gunter Exp $
    27 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     26// $Id: G4PenelopeCompton.cc,v 1.33 2008/06/03 15:44:25 pandola Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// Author: Luciano Pandola
     
    4545// 17 Mar 2004 L.Pandola      Removed unnecessary calls to std::pow(a,b)
    4646// 18 Mar 2004 L.Pandola      Use of std::map (code review)
     47// 26 Mar 2008 L.Pandola      Add boolean flag to control atomic de-excitation
     48// 27 Mar 2008 L.Pandola      Re-named some variables to improve readability,
     49//                            and check for strict energy conservation
     50// 03 Jun 2008 L.Pandola      Added further protection against non-conservation
     51//                            of energy: it may happen because ionization energy
     52//                            from de-excitation manager and from Penelope internal
     53//                            database do not match (difference is <10 eV, but may
     54//                            give a e- with negative kinetic energy).
    4755//
    4856// -------------------------------------------------------------------
     
    8694    ZForIntegration(1),
    8795    nBins(200),
    88     cutForLowEnergySecondaryPhotons(250.0*eV)
     96    cutForLowEnergySecondaryPhotons(250.0*eV),
     97    fUseAtomicDeexcitation(true)
    8998{
    9099  if (lowEnergyLimit < intrinsicLowEnergyLimit ||
     
    118127  delete rangeTest;
    119128
    120   for (size_t i1=0;i1<matCrossSections->size();i1++)
    121     {
    122       delete (*matCrossSections)[i1];
     129  for (size_t i=0;i<matCrossSections->size();i++)
     130    {
     131      delete (*matCrossSections)[i];
    123132    }
    124133
     
    140149  G4DataVector energyVector;
    141150  G4double dBin = std::log10(highEnergyLimit/lowEnergyLimit)/nBins;
    142   G4int i;
    143   for (i=0;i<nBins;i++)
     151  for (G4int i=0;i<nBins;i++)
    144152    {
    145153      energyVector.push_back(std::pow(10.,std::log10(lowEnergyLimit)+i*dBin));
     
    150158  G4VDataSetAlgorithm* algo = new G4LogLogInterpolation();
    151159
    152   size_t nOfBins = energyVector.size();
    153   size_t bin=0;
     160  //size_t nOfBins = energyVector.size();
     161  //size_t bin=0;
    154162
    155163  G4DataVector* energies;
     
    158166  matCrossSections = new std::vector<G4VEMDataSet*>;
    159167
    160  
    161   G4int m;
    162   for (m=0; m<nMaterials; m++)
     168  for (G4int m=0; m<nMaterials; m++)
    163169    {
    164170      const G4Material* material= (*materialTable)[m];
     
    169175      G4VEMDataSet* setForMat = new G4CompositeEMDataSet(algo,1.,1.);
    170176
    171       for (i=0; i<nElements; i++) {
     177      for (G4int i=0; i<nElements; i++) {
    172178 
    173179        G4int Z = (G4int) (*elementVector)[i]->GetZ();
     
    178184
    179185
    180         for (bin=0; bin<nOfBins; bin++)
     186        for (size_t bin=0; bin<energyVector.size(); bin++)
    181187          {
    182188            G4double e = energyVector[bin];
     
    200206 
    201207 
    202   for (m=0; m<nMaterials; m++)
     208  for (G4int m=0; m<nMaterials; m++)
    203209    {
    204210      energies = new G4DataVector;
     
    206212      const G4Material* material= (*materialTable)[m];
    207213      material= (*materialTable)[m];
    208       for (bin=0; bin<nOfBins; bin++)
     214      for (size_t bin=0; bin<energyVector.size(); bin++)
    209215        {
    210216          G4double energy = energyVector[bin];
     
    254260  const G4MaterialCutsCouple* couple = aTrack.GetMaterialCutsCouple();
    255261  const G4Material* material = couple->GetMaterial();
     262 
    256263  G4int Z = SelectRandomAtomForCompton(material,photonEnergy0);
    257264  const G4int nmax = 64;
     
    274281  a1 = std::log(ki2);
    275282  a2 = a1+2.0*ki*(1.0+ki)/(ki2*ki2);
     283  //If the incoming photon is above 5 MeV, the quicker approach based on the
     284  //pure Klein-Nishina formula is used
    276285  if (photonEnergy0 > 5*MeV)
    277286    {
     
    305314      }while((epsilon*photonEnergy0-photonEnergy0+ionEnergy) >0);
    306315    }
    307 
    308316  else //photonEnergy0<5 MeV
    309317    {
     
    359367                if (pzomc > 0)
    360368                  {
    361                     rn[i] = 1.0-0.5*std::exp(0.5-(std::sqrt(0.5)+std::sqrt(2.0)*pzomc)*(std::sqrt(0.5)+std::sqrt(2.0)*pzomc));
     369                    rn[i] = 1.0-0.5*std::exp(0.5-(std::sqrt(0.5)+std::sqrt(2.0)*pzomc)*
     370                                             (std::sqrt(0.5)+std::sqrt(2.0)*pzomc));
    362371                  }
    363372                else
    364373                  {
    365                     rn[i] = 0.5*std::exp(0.5-(std::sqrt(0.5)-std::sqrt(2.0)*pzomc)*(std::sqrt(0.5)-std::sqrt(2.0)*pzomc));
     374                    rn[i] = 0.5*std::exp(0.5-(std::sqrt(0.5)-std::sqrt(2.0)*pzomc)*
     375                                         (std::sqrt(0.5)-std::sqrt(2.0)*pzomc));
    366376                  }
    367377                S = S + occupNb*rn[i];
     
    431441    }
    432442 
    433 
    434443  G4double sinTheta = std::sqrt(1-cosTheta*cosTheta);
    435444  G4double phi = twopi * G4UniformRand() ;
     
    456465
    457466
    458   // Kinematics of the scattered electron
    459 
    460  
     467  // Kinematics of the scattered electron   
    461468  G4double diffEnergy = photonEnergy0*(1-epsilon);
    462469  ionEnergy = (*(ionizationEnergy->find(Z)->second))[iosc];
    463   //G4double eKineticEnergy = diffEnergy - ionEnergy;
    464470  G4double Q2 = photonEnergy0*photonEnergy0+photonEnergy1*(photonEnergy1-2.0*photonEnergy0*cosTheta);
    465471  G4double cosThetaE; //scattering angle for the electron
     
    473479    }
    474480  G4double sinThetaE = std::sqrt(1-cosThetaE*cosThetaE);
    475 
    476  
    477  
     481  //initialize here, then check photons created by Atomic-Deexcitation, and the final state e-
     482  G4int nbOfSecondaries = 0;
     483 
     484  std::vector<G4DynamicParticle*>* photonVector=0;
     485
    478486  const G4AtomicTransitionManager* transitionManager = G4AtomicTransitionManager::Instance();
    479487  const G4AtomicShell* shell = transitionManager->Shell(Z,iosc);
    480488  G4double bindingEnergy = shell->BindingEnergy();
    481489  G4int shellId = shell->ShellId();
    482   //G4cout << bindingEnergy/keV << " " << ionEnergy/keV << " keV" << G4endl;
    483   ionEnergy = std::max(bindingEnergy,ionEnergy); //protection against energy non-conservation
    484   G4double eKineticEnergy = diffEnergy - ionEnergy;
    485 
    486   size_t nTotPhotons=0;
    487   G4int nPhotons=0;
    488 
    489   const G4ProductionCutsTable* theCoupleTable=
    490     G4ProductionCutsTable::GetProductionCutsTable();
    491   size_t indx = couple->GetIndex();
    492   G4double cutg = (*(theCoupleTable->GetEnergyCutsVector(0)))[indx];
    493   cutg = std::min(cutForLowEnergySecondaryPhotons,cutg);
    494 
    495   G4double cute = (*(theCoupleTable->GetEnergyCutsVector(1)))[indx];
    496   cute = std::min(cutForLowEnergySecondaryPhotons,cute);
    497  
    498   std::vector<G4DynamicParticle*>* photonVector=0;
    499   G4DynamicParticle* aPhoton;
    500   G4AtomicDeexcitation deexcitationManager;
    501 
    502   if (Z>5 && (ionEnergy > cutg || ionEnergy > cute))
    503     {
    504       photonVector = deexcitationManager.GenerateParticles(Z,shellId);
    505       nTotPhotons = photonVector->size();
    506       for (size_t k=0;k<nTotPhotons;k++){
    507         aPhoton = (*photonVector)[k];
    508         if (aPhoton)
    509           {
    510             G4double itsCut = cutg;
    511             if (aPhoton->GetDefinition() == G4Electron::Electron()) itsCut = cute;
    512             G4double itsEnergy = aPhoton->GetKineticEnergy();
    513             if (itsEnergy > itsCut && itsEnergy <= ionEnergy)
     490  G4double ionEnergyInPenelopeDatabase = ionEnergy;
     491  ionEnergy = std::max(bindingEnergy,ionEnergyInPenelopeDatabase); //protection against energy non-conservation
     492
     493  G4double eKineticEnergy = diffEnergy - ionEnergy; //subtract the excitation energy. If not emitted by fluorescence,
     494  //the ionization energy is deposited as local energy deposition
     495  G4double localEnergyDeposit = ionEnergy;
     496  G4double energyInFluorescence = 0.; //testing purposes only
     497
     498  if (eKineticEnergy < 0)
     499    {
     500      //It means that there was some problem/mismatch between the two databases. Try to make it work
     501      //In this case available Energy (diffEnergy) < ionEnergy
     502      //Full residual energy is deposited locally
     503      localEnergyDeposit = diffEnergy;
     504      eKineticEnergy = 0.0;
     505    }
     506
     507  //the local energy deposit is what remains: part of this may be spent for fluorescence.
     508 
     509  if (fUseAtomicDeexcitation)
     510    {
     511      G4int nPhotons=0;
     512     
     513      const G4ProductionCutsTable* theCoupleTable=
     514        G4ProductionCutsTable::GetProductionCutsTable();
     515      size_t indx = couple->GetIndex();
     516
     517      G4double cutg = (*(theCoupleTable->GetEnergyCutsVector(0)))[indx];
     518      cutg = std::max(cutForLowEnergySecondaryPhotons,cutg);
     519
     520      G4double cute = (*(theCoupleTable->GetEnergyCutsVector(1)))[indx];
     521      cute = std::max(cutForLowEnergySecondaryPhotons,cute);
     522     
     523      G4DynamicParticle* aPhoton;
     524      G4AtomicDeexcitation deexcitationManager;
     525     
     526      if (Z>5 && (localEnergyDeposit > cutg || localEnergyDeposit > cute))
     527        {
     528          photonVector = deexcitationManager.GenerateParticles(Z,shellId);
     529          for (size_t k=0;k<photonVector->size();k++){
     530            aPhoton = (*photonVector)[k];
     531            if (aPhoton)
    514532              {
    515                 nPhotons++;
    516                 ionEnergy -= itsEnergy;
    517               }
    518             else
    519               {
    520                 delete aPhoton;
    521                 (*photonVector)[k]=0;
     533                G4double itsCut = cutg;
     534                if (aPhoton->GetDefinition() == G4Electron::Electron()) itsCut = cute;
     535                G4double itsEnergy = aPhoton->GetKineticEnergy();
     536                if (itsEnergy > itsCut && itsEnergy <= localEnergyDeposit)
     537                  {
     538                    nPhotons++;
     539                    localEnergyDeposit -= itsEnergy;
     540                    energyInFluorescence += itsEnergy;
     541                  }
     542                else
     543                  {
     544                    delete aPhoton;
     545                    (*photonVector)[k]=0;
     546                  }
    522547              }
    523548          }
    524       }
    525     }
    526   G4double energyDeposit =ionEnergy; //il deposito locale e' quello che rimane
    527   G4int nbOfSecondaries=nPhotons;
    528 
     549        }
     550      nbOfSecondaries=nPhotons;
     551    }
     552
     553 
    529554  // Generate the electron only if with large enough range w.r.t. cuts and safety
    530555  G4double safety = aStep.GetPostStepPoint()->GetSafety();
    531556  G4DynamicParticle* electron = 0;
    532   if (rangeTest->Escape(G4Electron::Electron(),couple,eKineticEnergy,safety))
     557  if (rangeTest->Escape(G4Electron::Electron(),couple,eKineticEnergy,safety) &&
     558      eKineticEnergy>cutForLowEnergySecondaryPhotons)
    533559    {
    534560      G4double xEl = sinThetaE * std::cos(phi+pi);
     
    543569  else
    544570    {
    545      
    546       energyDeposit += eKineticEnergy;
     571      localEnergyDeposit += eKineticEnergy;
    547572    }
    548573
    549574  aParticleChange.SetNumberOfSecondaries(nbOfSecondaries);
    550575  if (electron) aParticleChange.AddSecondary(electron);
    551   for (size_t ll=0;ll<nTotPhotons;ll++)
    552     {
    553       aPhoton = (*photonVector)[ll];
    554       if (aPhoton) aParticleChange.AddSecondary(aPhoton);
     576
     577  //This block below is executed only if there is at least one secondary photon produced by
     578  //AtomicDeexcitation
     579  if (photonVector)
     580    {
     581      for (size_t ll=0;ll<photonVector->size();ll++)
     582        {
     583          if ((*photonVector)[ll]) aParticleChange.AddSecondary((*photonVector)[ll]);
     584        }
    555585    }
    556586  delete photonVector;
    557   if (energyDeposit < 0)
     587  if (localEnergyDeposit < 0)
    558588    {
    559589      G4cout << "WARNING-"
    560590             << "G4PenelopeCompton::PostStepDoIt - Negative energy deposit"
    561591             << G4endl;
    562       energyDeposit=0;
    563     }
    564   aParticleChange.ProposeLocalEnergyDeposit(energyDeposit);
    565  
     592      localEnergyDeposit=0.;
     593    }
     594  aParticleChange.ProposeLocalEnergyDeposit(localEnergyDeposit);
     595 
     596
     597  if (verboseLevel > 1)
     598    {
     599      G4cout << "-----------------------------------------------------------" << G4endl;
     600      G4cout << "Energy balance from G4PenelopeCompton" << G4endl;
     601      G4cout << "Incoming photon energy: " << photonEnergy0/keV << " keV" << G4endl;
     602      G4cout << "-----------------------------------------------------------" << G4endl;
     603      G4cout << "Scattered photon: " << photonEnergy1/keV << " keV" << G4endl;
     604      G4double electronEnergy = 0.;
     605      if (electron)
     606        electronEnergy = eKineticEnergy;
     607      G4cout << "Scattered electron " << electronEnergy/keV << " keV" << G4endl;
     608      G4cout << "Fluorescence: " << energyInFluorescence/keV << " keV" << G4endl;
     609      G4cout << "Local energy deposit " << localEnergyDeposit/keV << " keV" << G4endl;
     610      G4cout << "Total final state: " << (photonEnergy1+electronEnergy+energyInFluorescence+localEnergyDeposit)/keV <<
     611        " keV" << G4endl;
     612      G4cout << "-----------------------------------------------------------" << G4endl;
     613    }
    566614
    567615  return G4VDiscreteProcess::PostStepDoIt( aTrack, aStep);
  • trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeIonisation.cc

    r819 r961  
    2525//
    2626// $Id: G4PenelopeIonisation.cc,v 1.19 2006/06/29 19:40:49 gunter Exp $
    27 // GEANT4 tag $Name: $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// --------------------------------------------------------------
  • trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopePhotoElectric.cc

    r819 r961  
    2525//
    2626//
    27 // $Id: G4PenelopePhotoElectric.cc,v 1.12 2006/06/29 19:40:51 gunter Exp $
    28 // GEANT4 tag $Name: $
     27// $Id: G4PenelopePhotoElectric.cc,v 1.13 2009/01/08 09:42:54 pandola Exp $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Author: L. Pandola
     
    3737// 31 May 2005  L. Pandola  Added Sauter formula for the sampling of
    3838//                          the electron direction
     39// 08 Jan 2009  L. Pandola  Check shell index to avoid mismatch between
     40//                          the Penelope cross section database and the
     41//                          G4AtomicTransitionManager database. It suppresses
     42//                          a warning from G4AtomicTransitionManager only.
     43//                          Results are unchanged.
    3944// --------------------------------------------------------------
    4045
     
    146151  // Retrieve the corresponding identifier and binding energy of the selected shell
    147152  const G4AtomicTransitionManager* transitionManager = G4AtomicTransitionManager::Instance();
     153
     154  //The number of shell cross section possibly reported in the Penelope database
     155  //might be different from the number of shells in the G4AtomicTransitionManager
     156  //(namely, Penelope may contain more shell, especially for very light elements).
     157  //In order to avoid a warning message from the G4AtomicTransitionManager, I
     158  //add this protection. Results are anyway changed, because when G4AtomicTransitionManager
     159  //has a shellID>maxID, it sets the shellID to the last valid shell.
     160  size_t numberOfShells = (size_t) transitionManager->NumberOfShells(Z);
     161  if (shellIndex >= numberOfShells)
     162    shellIndex = numberOfShells-1;
     163
    148164  const G4AtomicShell* shell = transitionManager->Shell(Z,shellIndex);
    149165  G4double bindingEnergy = shell->BindingEnergy();
  • trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeRayleigh.cc

    r819 r961  
    2727//
    2828// $Id: G4PenelopeRayleigh.cc,v 1.15 2007/09/03 09:43:14 pandola Exp $
    29 // GEANT4 tag $Name: $
     29// GEANT4 tag $Name: geant4-09-02-ref-02 $
    3030//
    3131// Author: L. Pandola (luciano.pandola@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4RangeTest.cc

    r819 r961  
    2626//
    2727// $Id: G4RangeTest.cc,v 1.8 2006/06/29 19:41:03 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4SemiLogInterpolation.cc

    r819 r961  
    2626//
    2727// $Id: G4SemiLogInterpolation.cc,v 1.6 2006/06/29 19:41:18 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4ShellData.cc

    r819 r961  
    2525//
    2626//
    27 // $Id: G4ShellData.cc,v 1.8 2006/06/29 19:41:21 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     27// $Id: G4ShellData.cc,v 1.10 2008/03/17 13:40:53 pia Exp $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
     
    3838#include "G4ShellData.hh"
    3939#include "G4DataVector.hh"
     40#include "G4SystemOfUnits.hh"
    4041#include <fstream>
    4142#include <sstream>
     43#include <numeric>
     44#include <algorithm>
     45#include <valarray>
     46#include <functional>
     47#include "Randomize.hh"
     48
     49// The following deprecated header is included because <functional> seems not to be found on MGP's laptop
     50//#include "function.h"
    4251
    4352// Constructor
    4453
    45 G4ShellData::G4ShellData(G4int minZ, G4int maxZ)
    46   : zMin(minZ), zMax(maxZ)
    47 { }
     54G4ShellData::G4ShellData(G4int minZ, G4int maxZ, G4bool isOccupancy)
     55  : zMin(minZ), zMax(maxZ), occupancyData(isOccupancy)
     56{  }
    4857
    4958// Destructor
    5059G4ShellData::~G4ShellData()
    5160{
    52   std::map<G4int,G4DataVector*,std::less<G4int> >::iterator pos;
    53 
     61  std::map<G4int,std::vector<G4double>*,std::less<G4int> >::iterator pos;
    5462  for (pos = idMap.begin(); pos != idMap.end(); ++pos)
    5563    {
    56       G4DataVector* dataSet = (*pos).second;
     64      std::vector<G4double>* dataSet = (*pos).second;
    5765      delete dataSet;
    5866    }
    59   for (pos = bindingMap.begin(); pos != bindingMap.end(); ++pos)
    60     {
    61       G4DataVector* dataSet = (*pos).second;
     67
     68  std::map<G4int,G4DataVector*,std::less<G4int> >::iterator pos2;
     69  for (pos2 = bindingMap.begin(); pos2 != bindingMap.end(); ++pos2)
     70    {
     71      G4DataVector* dataSet = (*pos2).second;
    6272      delete dataSet;
     73    }
     74
     75  if (occupancyData)
     76    {
     77      std::map<G4int,std::vector<G4double>*,std::less<G4int> >::iterator pos3;
     78      for (pos3 = occupancyPdfMap.begin(); pos3 != occupancyPdfMap.end(); ++pos3)
     79        {
     80          std::vector<G4double>* dataSet = (*pos3).second;
     81          delete dataSet;
     82        }
    6383    }
    6484}
     
    7898
    7999
    80 const G4DataVector& G4ShellData::ShellIdVector(G4int Z) const
    81 {
    82   std::map<G4int,G4DataVector*,std::less<G4int> >::const_iterator pos;
    83   if (Z < zMin || Z > zMax)
    84     G4Exception("G4ShellData::ShellIdVector - Z outside boundaries");
     100const std::vector<G4double>& G4ShellData::ShellIdVector(G4int Z) const
     101{
     102  std::map<G4int,std::vector<G4double>*,std::less<G4int> >::const_iterator pos;
     103  if (Z < zMin || Z > zMax) G4Exception("G4ShellData::ShellIdVector - Z outside boundaries");
    85104  pos = idMap.find(Z);
    86   G4DataVector* dataSet = (*pos).second;
     105  std::vector<G4double>* dataSet = (*pos).second;
    87106  return *dataSet;
    88107}
    89108
     109
     110const std::vector<G4double>& G4ShellData::ShellVector(G4int Z) const
     111{
     112  std::map<G4int,std::vector<G4double>*,std::less<G4int> >::const_iterator pos;
     113  if (Z < zMin || Z > zMax) G4Exception("G4ShellData::ShellVector - Z outside boundaries");
     114  pos = occupancyPdfMap.find(Z);
     115  std::vector<G4double>* dataSet = (*pos).second;
     116  return *dataSet;
     117}
     118
     119
    90120G4int G4ShellData::ShellId(G4int Z, G4int shellIndex) const
    91121{
     
    94124  if (Z >= zMin && Z <= zMax)
    95125    {
    96       std::map<G4int,G4DataVector*,std::less<G4int> >::const_iterator pos;
     126      std::map<G4int,std::vector<G4double>*,std::less<G4int> >::const_iterator pos;
    97127      pos = idMap.find(Z);
    98128      if (pos!= idMap.end())
    99129        {
    100           G4DataVector dataSet = *((*pos).second);
     130          std::vector<G4double> dataSet = *((*pos).second);
    101131          G4int nData = dataSet.size();
    102132          if (shellIndex >= 0 && shellIndex < nData)
     
    108138  return n;
    109139}
     140
     141
     142G4double G4ShellData::ShellOccupancyProbability(G4int Z, G4int shellIndex) const
     143{
     144  G4double prob = -1.;
     145
     146  if (Z >= zMin && Z <= zMax)
     147    {
     148      std::map<G4int,std::vector<G4double>*,std::less<G4int> >::const_iterator pos;
     149      pos = idMap.find(Z);
     150      if (pos!= idMap.end())
     151        {
     152          std::vector<G4double> dataSet = *((*pos).second);
     153          G4int nData = dataSet.size();
     154          if (shellIndex >= 0 && shellIndex < nData)
     155            {
     156              prob = dataSet[shellIndex];
     157            }
     158        }
     159    }
     160  return prob;
     161}
     162
    110163
    111164
     
    140193             << G4endl;
    141194      G4int nSh = nShells[Z-1];
    142       std::map<G4int,G4DataVector*,std::less<G4int> >::const_iterator posId;
     195      std::map<G4int,std::vector<G4double>*,std::less<G4int> >::const_iterator posId;
    143196      posId = idMap.find(Z);
    144       G4DataVector* ids = (*posId).second;
     197      std::vector<G4double>* ids = (*posId).second;
    145198      std::map<G4int,G4DataVector*,std::less<G4int> >::const_iterator posE;
    146199      posE = bindingMap.find(Z);
     
    149202        {
    150203          G4int id = (G4int) (*ids)[i];
    151           G4double e = (*energies)[i] / MeV;
    152           G4cout << i <<") Shell id: " << id
    153                  << " - Binding energy = "
    154                  << e << " MeV " << G4endl;
     204          G4double e = (*energies)[i] / keV;
     205          G4cout << i << ") ";
     206
     207          if (occupancyData)
     208            {
     209              G4cout << " Occupancy: ";
     210            }
     211          else
     212            {
     213              G4cout << " Shell id: ";
     214            }
     215          G4cout << id << " - Binding energy = "
     216                 << e << " keV ";
     217            if (occupancyData)
     218              {
     219                std::map<G4int,std::vector<G4double>*,std::less<G4int> >::const_iterator posOcc;
     220                posOcc = occupancyPdfMap.find(Z);
     221                std::vector<G4double> probs = *((*posOcc).second);
     222                G4double prob = probs[i];
     223                G4cout << "- Probability = " << prob;
     224              }
     225            G4cout << G4endl;
    155226        }
    156227      G4cout << "-------------------------------------------------"
     
    196267  G4int Z = 1;
    197268  G4DataVector* energies = new G4DataVector;
    198   G4DataVector* ids = new G4DataVector;
     269  std::vector<G4double>* ids = new std::vector<G4double>;
    199270
    200271  do {
     
    211282            nShells.push_back(n);
    212283            // Start of new shell data set
    213             ids = new G4DataVector;
     284            ids = new std::vector<G4double>;
    214285            energies = new G4DataVector;
    215286            Z++;           
     
    246317  } while (a != -2); // end of file
    247318  file.close();   
    248 }
    249 
     319
     320  // For Doppler broadening: the data set contains shell occupancy and binding energy for each shell
     321  // Build additional map with probability for each shell based on its occupancy
     322
     323  if (occupancyData)
     324    {
     325      // Build cumulative from raw shell occupancy
     326
     327      for (G4int Z=zMin; Z <= zMax; Z++)
     328        {
     329          std::vector<G4double> occupancy = ShellIdVector(Z);
     330
     331          std::vector<G4double>* prob = new std::vector<G4double>;
     332          G4double scale = 1. / G4double(Z);
     333
     334          prob->push_back(occupancy[0] * scale);
     335          for (size_t i=1; i<occupancy.size(); i++)
     336            {
     337              prob->push_back(occupancy[i]*scale + (*prob)[i-1]);
     338            }
     339          occupancyPdfMap[Z] = prob;
     340
     341          /*
     342            G4double scale = 1. / G4double(Z);
     343            //      transform((*prob).begin(),(*prob).end(),(*prob).begin(),bind2nd(multiplies<G4double>(),scale));
     344
     345            for (size_t i=0; i<occupancy.size(); i++)
     346            {
     347            (*prob)[i] *= scale;
     348            }
     349          */
     350        }
     351    }
     352}
     353
     354
     355G4int G4ShellData::SelectRandomShell(G4int Z) const
     356{
     357  if (Z < zMin || Z > zMax) G4Exception("G4ShellData::RandomSelect - Z outside boundaries");
     358
     359  G4int shellIndex = 0;   
     360  std::vector<G4double> prob = ShellVector(Z);
     361  G4double random = G4UniformRand();
     362
     363  // std::vector<G4double>::const_iterator pos;
     364  // pos = lower_bound(prob.begin(),prob.end(),random);
     365
     366  // Binary search the shell with probability less or equal random
     367
     368  G4int nShells = NumberOfShells(Z);
     369  G4int upperBound = nShells;
     370
     371  while (shellIndex <= upperBound)
     372    {
     373      G4int midShell = (shellIndex + upperBound) / 2;
     374      if ( random < prob[midShell] )
     375        upperBound = midShell - 1;
     376      else
     377        shellIndex = midShell + 1;
     378    } 
     379  if (shellIndex >= nShells) shellIndex = nShells - 1;
     380
     381  return shellIndex;
     382}
  • trunk/source/processes/electromagnetic/lowenergy/src/G4ShellEMDataSet.cc

    r819 r961  
    2525//
    2626//
    27 // $Id: G4ShellEMDataSet.cc,v 1.15 2007/10/15 08:36:35 pia Exp $
    28 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     27// $Id: G4ShellEMDataSet.cc,v 1.16 2008/03/10 15:07:41 pia Exp $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
     
    3232// History:
    3333// -----------
    34 // 1 Aug 2001   MGP        Created
     34//  1 Aug 2001   MGP        Created
    3535// 09.10.01   V.Ivanchenko Add case z=0
     36//  9 Mar 2008   MGP        Cleaned up unreadable code modified by former developer
     37//                          (Further clean-up needed)
    3638//
    3739// -------------------------------------------------------------------
     
    4446
    4547
    46 G4ShellEMDataSet::G4ShellEMDataSet(G4int argZ, G4VDataSetAlgorithm* argAlgorithm,
    47                                    G4double argUnitEnergies,
    48                                    G4double argUnitData)
     48G4ShellEMDataSet::G4ShellEMDataSet(G4int zeta, G4VDataSetAlgorithm* algo,
     49                                   G4double eUnit,
     50                                   G4double dataUnit)
    4951  :
    50   z(argZ),
    51   algorithm(argAlgorithm),
    52   unitEnergies(argUnitEnergies),
    53   unitData(argUnitData)
    54 {
    55   if (algorithm == 0)
    56     G4Exception("G4ShellEMDataSet::G4ShellEMDataSet - interpolation == 0");
     52  z(zeta),
     53  algorithm(algo),
     54  unitEnergies(eUnit),
     55  unitData(dataUnit)
     56{
     57  if (algorithm == 0) G4Exception("G4ShellEMDataSet::G4ShellEMDataSet - interpolation == 0");
    5758}
    5859
     
    6162{
    6263  CleanUpComponents();
    63  
    64   if (algorithm)
    65     delete algorithm;
    66 }
    67 
    68 
    69 G4double G4ShellEMDataSet::FindValue(G4double argEnergy, G4int /* argComponentId */) const
     64  if (algorithm) delete algorithm;
     65}
     66
     67
     68G4double G4ShellEMDataSet::FindValue(G4double energy, G4int /* componentId */) const
    7069{
    7170  // Returns the sum over the shells corresponding to e
     
    7574  std::vector<G4VEMDataSet *>::const_iterator end(components.end());
    7675
    77   while (i!=end)
    78     {
    79       value+=(*i)->FindValue(argEnergy);
     76  while (i != end)
     77    {
     78      value += (*i)->FindValue(energy);
    8079      i++;
    8180    }
     
    8786void G4ShellEMDataSet::PrintData(void) const
    8887{
    89   const size_t n(NumberOfComponents());
     88  const size_t n = NumberOfComponents();
    9089
    9190  G4cout << "The data set has " << n << " components" << G4endl;
    9291  G4cout << G4endl;
    9392 
    94   size_t i(0);
    95  
    96   while (i<n)
     93  size_t i = 0;
     94 
     95  while (i < n)
    9796    {
    9897      G4cout << "--- Component " << i << " ---" << G4endl;
     
    103102
    104103
    105 void G4ShellEMDataSet :: SetEnergiesData(G4DataVector* argEnergies,
    106                                          G4DataVector* argData,
    107                                          G4int argComponentId)
    108 {
    109   G4VEMDataSet * component(components[argComponentId]);
     104void G4ShellEMDataSet::SetEnergiesData(G4DataVector* energies,
     105                                       G4DataVector* data,
     106                                       G4int componentId)
     107{
     108  G4VEMDataSet* component = components[componentId];
    110109 
    111110  if (component)
    112111    {
    113       component->SetEnergiesData(argEnergies, argData, 0);
     112      component->SetEnergiesData(energies, data, 0);
    114113      return;
    115114    }
    116115
    117116  std::ostringstream message;
    118   message << "G4ShellEMDataSet::SetEnergiesData - component " << argComponentId << " not found";
     117  message << "G4ShellEMDataSet::SetEnergiesData - component " << componentId << " not found";
    119118 
    120119  G4Exception(message.str().c_str());
     
    122121
    123122
    124 G4bool G4ShellEMDataSet::LoadData(const G4String& argFileName)
     123G4bool G4ShellEMDataSet::LoadData(const G4String& file)
    125124{
    126125  CleanUpComponents();
    127126
    128   G4String fullFileName(FullFileName(argFileName));
     127  G4String fullFileName = FullFileName(file);
    129128  std::ifstream in(fullFileName);
    130129
     
    132131    {
    133132      G4String message("G4ShellEMDataSet::LoadData - data file \"");
    134       message+=fullFileName;
    135       message+="\" not found";
     133      message += fullFileName;
     134      message += "\" not found";
    136135      G4Exception(message);
    137136    }
    138137
    139   G4DataVector* argEnergies(0);
    140   G4DataVector* argData(0);
    141 
    142   G4double a;
    143   G4int shellIndex(0);
    144   bool energyColumn(true);
     138  G4DataVector* energies = 0;
     139  G4DataVector* data = 0;
     140
     141  G4double a = 0.;
     142  G4int shellIndex = 0;
     143  bool energyColumn = true;
    145144
    146145  do
     
    150149      if (a == -1)
    151150        {
    152           if (energyColumn && argEnergies!=0)
     151          if (energyColumn && energies!=0)
    153152            {
    154               AddComponent(new G4EMDataSet(shellIndex, argEnergies, argData, algorithm->Clone(), unitEnergies, unitData));
    155               argEnergies=0;
    156               argData=0;
     153              AddComponent(new G4EMDataSet(shellIndex, energies, data, algorithm->Clone(), unitEnergies, unitData));
     154              energies = 0;
     155              data = 0;
    157156            }
    158157   
    159           energyColumn=(!energyColumn);
     158          energyColumn = (!energyColumn);
    160159        }
    161       else if (a!=-2)
     160      else if (a != -2)
    162161        {
    163           if (argEnergies==0)
     162          if (energies == 0)
    164163            {
    165               argEnergies=new G4DataVector;
    166               argData=new G4DataVector;
     164              energies = new G4DataVector;
     165              data = new G4DataVector;
    167166            }
    168167 
    169168          if (energyColumn)
    170             argEnergies->push_back(a*unitEnergies);
     169            energies->push_back(a * unitEnergies);
    171170          else
    172             argData->push_back(a*unitData);
    173 
    174           energyColumn=(!energyColumn);
     171            data->push_back(a * unitData);
     172
     173          energyColumn = (!energyColumn);
    175174        }
    176175    }
     
    181180
    182181
    183 G4bool G4ShellEMDataSet::SaveData(const G4String& argFileName) const
    184 {
    185   G4String fullFileName(FullFileName(argFileName));
     182G4bool G4ShellEMDataSet::SaveData(const G4String& file) const
     183{
     184  G4String fullFileName = FullFileName(file);
    186185  std::ofstream out(fullFileName);
    187186
     
    189188    {
    190189      G4String message("G4EMDataSet::SaveData - cannot open \"");
    191       message+=fullFileName;
    192       message+="\"";
     190      message += fullFileName;
     191      message += "\"";
    193192      G4Exception(message);
    194193    }
    195194 
    196   const size_t n(NumberOfComponents());
    197   size_t k(0);
    198  
    199   while (k<n)
    200     {
    201       const G4VEMDataSet * component=GetComponent(k);
     195  const size_t n = NumberOfComponents();
     196  size_t k = 0;
     197 
     198  while (k < n)
     199    {
     200      const G4VEMDataSet* component = GetComponent(k);
    202201 
    203202      if (component)
    204203        {
    205           const G4DataVector & energies(component->GetEnergies(0));
    206           const G4DataVector & data(component->GetData(0));
    207  
    208           G4DataVector::const_iterator i(energies.begin());
    209           G4DataVector::const_iterator endI(energies.end());
    210           G4DataVector::const_iterator j(data.begin());
    211  
    212           while (i!=endI)
     204          const G4DataVector& energies = component->GetEnergies(0);
     205          const G4DataVector& data = component->GetData(0);
     206 
     207          G4DataVector::const_iterator i = energies.begin();
     208          G4DataVector::const_iterator endI = energies.end();
     209          G4DataVector::const_iterator j = data.begin();
     210 
     211          while (i != endI)
    213212            {
    214213              out.precision(10);
     
    253252
    254253
    255 
    256 
    257 
    258254void G4ShellEMDataSet::CleanUpComponents(void)
    259255{
    260256  while (!components.empty())
    261257    {
    262       if (components.back())
    263         delete components.back();
    264 
     258      if (components.back()) delete components.back();
    265259      components.pop_back();
    266260    }
     
    268262
    269263
    270 
    271 
    272 
    273 G4String G4ShellEMDataSet::FullFileName(const G4String & argFileName) const
     264G4String G4ShellEMDataSet::FullFileName(const G4String& fileName) const
    274265{
    275266  char* path = getenv("G4LEDATA");
     
    279270  std::ostringstream fullFileName;
    280271 
    281   fullFileName << path << '/' << argFileName << z << ".dat";
     272  fullFileName << path << '/' << fileName << z << ".dat";
    282273                     
    283274  return G4String(fullFileName.str().c_str());
  • trunk/source/processes/electromagnetic/lowenergy/src/G4VCrossSectionHandler.cc

    r819 r961  
    2626//
    2727// $Id: G4VCrossSectionHandler.cc,v 1.17 2006/06/29 19:41:42 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4VLowEnergyDiscretePhotonProcess.cc

    r819 r961  
    2525//
    2626// $Id: G4VLowEnergyDiscretePhotonProcess.cc,v 1.5 2006/06/29 19:41:44 gunter Exp $
    27 // GEANT4 tag $Name: $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// --------------------------------------------------------------
  • trunk/source/processes/electromagnetic/lowenergy/src/G4VeLowEnergyLoss.cc

    r819 r961  
    2626//
    2727// $Id: G4VeLowEnergyLoss.cc,v 1.25 2006/06/29 19:41:50 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030//
  • trunk/source/processes/electromagnetic/lowenergy/src/G4WaterExcitationStructure.cc

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

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

    r819 r961  
    2525//
    2626// $Id: G4eBremsstrahlungSpectrum.cc,v 1.15 2006/06/29 19:41:58 gunter Exp $
    27 // GEANT4 tag $Name: $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// -------------------------------------------------------------------
  • trunk/source/processes/electromagnetic/lowenergy/src/G4eCrossSectionExcitationEmfietzoglou.cc

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

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

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eIonisationCrossSectionHandler.cc,v 1.11 2006/06/29 19:42:00 gunter Exp $
    27 // GEANT4 tag $Name: $
     26// $Id: G4eIonisationCrossSectionHandler.cc,v 1.12 2009/01/29 08:13:34 pandola Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// -------------------------------------------------------------------
     
    4242// 19 Jul 2002   VI          Create composite data set for material
    4343// 21 Jan 2003  V.Ivanchenko Cut per region
     44// 28 Jan 2009  L.Pandola    Added public method to make a easier migration of
     45//                           G4LowEnergyIonisation to G4LivermoreIonisationModel
    4446//
    4547// -------------------------------------------------------------------
     
    98100    G4int nElements = material->GetNumberOfElements();
    99101
    100     if(verbose > 0) {
    101       G4cout << "eIonisation CS for " << m << "th material "
    102              << material->GetName()
    103              << "  eEl= " << nElements << G4endl;
    104     }
     102    if(verbose > 0)
     103      {
     104        G4cout << "eIonisation CS for " << m << "th material "
     105               << material->GetName()
     106               << "  eEl= " << nElements << G4endl;
     107      }
    105108
    106109    G4double tcut  = (*energyCuts)[m];
     
    129132            value += cross * p * density;
    130133
    131             if(verbose>0 && m == 0 && e>=1. && e<=0.) {
     134            if(verbose>0 && m == 0 && e>=1. && e<=0.)
     135            {
    132136              G4cout << "G4eIonCrossSH: e(MeV)= " << e/MeV
    133137                     << " n= " << n
     
    139143                     << " Z= " << Z
    140144                     << G4endl;
    141             }
     145              }
    142146
    143147          }
     
    155159}
    156160
    157 
     161G4double G4eIonisationCrossSectionHandler::GetCrossSectionAboveThresholdForElement(G4double energy,
     162                                                                                   G4double cutEnergy,
     163                                                                                   G4int Z)
     164{
     165  G4int nShells = NumberOfComponents(Z);
     166  G4double value = 0.;
     167  if(energy > cutEnergy)
     168    {
     169      for (G4int n=0; n<nShells; n++) {
     170        G4double cross = FindValue(Z, energy, n);
     171        G4double p = theParam->Probability(Z, cutEnergy, energy, energy, n);
     172        value += cross * p;
     173      }
     174    }
     175  return value;
     176}
  • trunk/source/processes/electromagnetic/lowenergy/src/G4eIonisationParameters.cc

    r819 r961  
    2626//
    2727// $Id: G4eIonisationParameters.cc,v 1.23 2006/06/29 19:42:02 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4eIonisationSpectrum.cc

    r819 r961  
    2525//
    2626// $Id: G4eIonisationSpectrum.cc,v 1.25 2006/06/29 19:42:04 gunter Exp $
    27 // GEANT4 tag $Name: $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// -------------------------------------------------------------------
  • trunk/source/processes/electromagnetic/lowenergy/src/G4eLowEnergyLoss.cc

    r819 r961  
    2626//
    2727// $Id: G4eLowEnergyLoss.cc,v 1.35 2006/06/29 19:42:06 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929// 
    3030// -----------------------------------------------------------
  • trunk/source/processes/electromagnetic/lowenergy/src/G4hLowEnergyIonisation.cc

    r819 r961  
    15011501              type = aSecondary->GetDefinition();
    15021502              if ( etot + e <= eLoss &&
    1503                    (type == G4Gamma::Gamma() && e > minGammaEnergy ) ||
    1504                    (type == G4Electron::Electron() && e > minElectronEnergy)) {
     1503                   ( (type == G4Gamma::Gamma() && e > minGammaEnergy ) ||
     1504                   (type == G4Electron::Electron() && e > minElectronEnergy) ) ) {
    15051505
    15061506                     etot += e;
  • trunk/source/processes/electromagnetic/lowenergy/src/G4hLowEnergyLoss.cc

    r819 r961  
    2525//
    2626//
    27 // $Id: G4hLowEnergyLoss.cc,v 1.23 2006/06/29 19:42:23 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     27// $Id: G4hLowEnergyLoss.cc,v 1.28 2009/02/20 10:49:54 sincerti Exp $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// -----------------------------------------------------------
     
    145145G4double G4hLowEnergyLoss::HighestKineticEnergy= 100.*GeV;
    146146G4int    G4hLowEnergyLoss::TotBin = 360;
    147 G4double G4hLowEnergyLoss::RTable,G4hLowEnergyLoss::LOGRTable;
     147G4double G4hLowEnergyLoss::RTable =1.1;
     148G4double G4hLowEnergyLoss::LOGRTable = 1.1;
    148149
    149150//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    772773    theRangeTable = theRangepbarTable ;
    773774  }
    774  
    775775  G4double R2 = RTable*RTable ;
    776776  G4double R1 = RTable+1.;
     
    796796      else
    797797      {
    798         Tim = Ti/RTable ;
     798        // ---- MGP ---- Modified to avoid a floating point exception
     799        // The correction is just a temporary patch, the whole class should be redesigned
     800        // Original: Tim = Ti/RTable  results in 0./0.
     801        if (RTable != 0.)
     802          {
     803            Tim = Ti/RTable ;
     804          }
     805        else
     806          {
     807            Tim = 0.;
     808          }
    799809        Rim = rangeVector->GetValue(Tim,isOut);
    800810      }
     
    806816        Rip = rangeVector->GetValue(Tip,isOut);
    807817      }
    808       Value = (w1*Rip + w2*Ri + w3*Rim)/(Ti*Ti) ;
     818      if (Ti!=0) Value = (w1*Rip + w2*Ri + w3*Rim)/(Ti*Ti); else Value=0;
    809819
    810820      aVector->PutValue(i,Value);
     
    868878      else
    869879      {
    870         Tim = Ti/RTable ;
     880        if (RTable!=0) Tim = Ti/RTable ; else Tim =0;
    871881        Rim = rangeVector->GetValue(Tim,isOut);
    872882      }
     
    878888        Rip = rangeVector->GetValue(Tip,isOut);
    879889      }
    880       Value = (w1*Rip + w2*Ri + w3*Rim)/Ti;
     890      if (Ti!=0) Value = (w1*Rip + w2*Ri + w3*Rim)/Ti; else Value=0;
    881891
    882892      aVector->PutValue(i,Value);
     
    939949      else
    940950      {
    941         Tim = Ti/RTable ;
     951        if (RTable!=0) Tim = Ti/RTable ; else Tim=0;
    942952        Rim = rangeVector->GetValue(Tim,isOut);
    943953      }
     
    10521062{
    10531063  G4double LowEdgeRange,A,B,C,discr,KineticEnergy ;
    1054   G4double Tbin = LowestKineticEnergy/RTable ;
     1064  G4double Tbin = 0;
     1065  if (RTable !=0.) Tbin = LowestKineticEnergy/RTable ;
    10551066  G4double rangebin = 0.0 ;
    10561067  G4int binnumber = -1 ;
  • trunk/source/processes/electromagnetic/lowenergy/src/G4hShellCrossSectionDoubleExp.cc

    r819 r961  
    4141// Empiric Model for shell cross sections in proton ionisation
    4242// -------------------------------------------------------------------
    43 // $Id: G4hShellCrossSectionDoubleExp.cc,v 1.8 2006/06/29 19:42:35 gunter Exp $
    44 // GEANT4 tag $Name: $
     43// $Id: G4hShellCrossSectionDoubleExp.cc,v 1.9 2008/06/26 18:19:10 sincerti Exp $
     44// GEANT4 tag $Name: geant4-09-02-ref-02 $
    4545
    4646#include "globals.hh"
     
    187187 
    188188  std::vector<G4double> kProbability;//(0);
    189   kProbability.push_back(GetCrossSectionDoubleExp(Z,incidentEnergy)/atomTotalCrossSection);
    190   // ---- MGP ---- Next line corrected to kProbability[0] instead of [1], which is not initialized!
    191   kProbability.push_back(1 - kProbability[0]);
     189 
     190 
     191  if (atomTotalCrossSection!=0.) // SI - 26 june 2008
     192 
     193  {
     194    kProbability.push_back(GetCrossSectionDoubleExp(Z,incidentEnergy)/atomTotalCrossSection);
     195    // ---- MGP ---- Next line corrected to kProbability[0] instead of [1], which is not initialized!
     196    kProbability.push_back(1 - kProbability[0]);
     197  }
    192198
    193199  return kProbability;
  • trunk/source/processes/electromagnetic/lowenergy/src/G4hShellCrossSectionDoubleExpData.cc

    r819 r961  
    3434// -------------------------------------------------------------------
    3535// $Id: G4hShellCrossSectionDoubleExpData.cc,v 1.4 2006/06/29 19:42:38 gunter Exp $
    36 // GEANT4 tag $Name: $
     36// GEANT4 tag $Name: geant4-09-02-ref-02 $
    3737
    3838#include "G4hShellCrossSectionDoubleExpData.hh"
  • trunk/source/processes/electromagnetic/lowenergy/src/G4hShellCrossSectionExp.cc

    r819 r961  
    4141// Empiric Model for shell cross sections in proton ionisation
    4242// -------------------------------------------------------------------
    43 // $Id: G4hShellCrossSectionExp.cc,v 1.5 2006/06/29 19:42:40 gunter Exp $
    44 // GEANT4 tag $Name: $
     43// $Id: G4hShellCrossSectionExp.cc,v 1.6 2008/05/02 19:23:38 pia Exp $
     44// GEANT4 tag $Name: geant4-09-02-ref-02 $
    4545
    4646#include "globals.hh"
     
    104104      crossSectionsInBarn = a*(std::pow(b,(1./incidentEnergyInMeV)))*(std::pow(incidentEnergyInMeV,c));
    105105    }         
    106   else if(Z<66 && Z>=26 || Z==17)
     106  else if((Z<66 && Z>=26) || Z==17)
    107107    {
    108108      crossSectionsInBarn = std::exp(a+(b/incidentEnergyInMeV)+(c*std::log(incidentEnergyInMeV)));
  • trunk/source/processes/electromagnetic/lowenergy/src/G4hShellCrossSectionExpData.cc

    r819 r961  
    3434// -------------------------------------------------------------------
    3535// $Id: G4hShellCrossSectionExpData.cc,v 1.3 2006/06/29 19:42:42 gunter Exp $
    36 // GEANT4 tag $Name: $
     36// GEANT4 tag $Name: geant4-09-02-ref-02 $
    3737
    3838#include "G4hShellCrossSectionExpData.hh"
Note: See TracChangeset for help on using the changeset viewer.