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

update processes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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}
Note: See TracChangeset for help on using the changeset viewer.