Ignore:
Timestamp:
May 28, 2009, 4:26:57 PM (15 years ago)
Author:
garnier
Message:

maj sur la beta de geant 4.9.3

Location:
trunk/source/processes/electromagnetic/standard
Files:
59 edited

Legend:

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

    r1007 r1055  
    1 $Id: History,v 1.430 2008/11/24 18:28:09 vnivanch Exp $
     1$Id: History,v 1.452 2009/05/18 12:31:46 vnivanch Exp $
    22-------------------------------------------------------------------
    33
     
    1717     * Reverse chronological order (last date on top), please *
    1818     ----------------------------------------------------------
     19
     2018 May 09:  V.Ivant (emstand-V09-02-12)
     21- G4UrbanMscModel2  - (L.Urban) correction in tail tuning using MuScat data
     22
     2315 May 09:  V.Ivant (emstand-V09-02-11)
     24- G4WaterStopping  - fixed Ar data
     25- G4PairProductionRelModel - (A.Schaelicke) new relativistic model for
     26                              gamma conversion
     27- G4UrbanMscModel2  - (L.Urban) new version of theta0 and tail tuning
     28
     2910 May 09: V.Ivant (emstand-V09-02-10)
     30- G4WentzelVIModel, G4eCoulombScattering, G4CoulombScattering - added relativistic
     31                      factor to Reserford cross section; set default limit on
     32                      kinetic energy of the recoil 100 keV
     33
     3428 April 09: V.Ivant (emstand-V09-02-09)
     35- G4UrbanMscModel2  - (L.Urban) new tuning for the central part and for the
     36                      tail of the angular distribution using the old e-
     37                      scattering data only (Phys. Rev. 84 (1951) 634;
     38                      Phys. Rev. 61 (1942) 254)
     39                    - corrected logic in ComputeTruePathLengthLimit method
     40                      for type=fUseDistanceToBoundary
     41- G4UrbanMscModel   - frozen version of G4UrbanMscModel2 of g4 9.2
     42- G4WentzelVIModel, G4eCoulombScattering  - reduce low-limit from 1 keV to 0.1 keV
     43                      to provide smooth transport cross section table
     44
     4523 April 09: V.Ivant (emstand-V09-02-08)
     46- G4BetheBlochModel - do not use pointer to GenericIon introduced in the
     47                      previous tag due to problem of simple PhysLists without ions
     48
     4920 April 09: V.Ivant (emstand-V09-02-07)
     50- G4BetheBlochModel - fixed and simplified initialisation for ions needed for
     51                      the new G4IonParametrisedLossModel of low-energy package
     52- G4GoudsmitSaundersonMscModel - (O.Kadri) cleanup: discarded no scattering and
     53                      single scattering theta sampling from SampleCosineTheta()
     54                      which means the splitting step into two sub-steps occur
     55                      only for msc regime 
     56
     5712 April 09: V.Ivant (emstand-V09-02-06)
     58- Simplified initialisation of all models
     59- G4UrbanMscModel, G4UrbanMscModel2, G4UrbanMscModel90 - use methods
     60   of G4VMscModel for interface to geometry
     61
     6207 April 09: V.Ivant (emstand-V09-02-05)
     63- G4IonFluctuations - T.Toshito removed extra phenomenological factor
     64                      in fluctuation width
     65- G4HeatedKleinNishinaCompton - V.Grichine added a prototype model for
     66                                plasma
     67
     6821 March 09: V.Ivant (emstand-V09-02-04)
     69- G4UniversalFluctuation - L.Urban introduce modification in width
     70    correction, the dependence of the correction on energy deposition
     71    at previous steps is removed (addresses T2K report)
     72
     7320 March 09: V.Ivant (emstand-V09-02-03)
     74- G4GoudsmitSaundersonMscModel fixed compillation problem
     75
     7612 March 09: V.Ivant (emstand-V09-02-02)
     77- G4GoudsmitSaundersonMscModel fixed compillation problem
     78- G4UniversalFluctuation - add temporary fix for T2K report
     79
     8005 March 09: V.Ivant (emstand-V09-02-01)
     81- New G4GoudsmitSaundersonMscModel is added
     82- G4WentzelVIModel, G4eCoulombScattringModel:
     83    o substitute scaling of low-energy limit by setting 1 keV for
     84      all particles;
     85    o use EGSnrc form of screening parameter (second order correction)
     86
     8720 February 09: V.Ivant (emstand-V09-02-00)
     88- Move all virtual methods from inline to source
     89G4PEEffectModel - substitute ComputeMeanFreePath by CrossSectionPerVolume
     90                  (minor CPU speadup for compound materials)
     91G4PAIModel, G4PAIPhotonModel - remove usage of random numbers at
     92                   initialisation (potential non-reproducibility)
     93G4WentzelVIModel - use generic methods of G4VMscModel to access safety
     94                   and other geometry information
    1995
    209624 November 08: V.Ivant (emstand-V09-01-45)
  • trunk/source/processes/electromagnetic/standard/include/G4BetheBlochModel.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4BetheBlochModel.hh,v 1.16 2008/10/22 16:00:57 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4BetheBlochModel.hh,v 1.20 2009/04/23 17:44:43 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    6464
    6565#include "G4VEmModel.hh"
     66#include "G4NistManager.hh"
    6667
    6768class G4EmCorrections;
    6869class G4ParticleChangeForLoss;
    69 class G4NistManager;
    70 
    7170
    7271class G4BetheBlochModel : public G4VEmModel
     
    8281  virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&);
    8382
    84   G4double MinEnergyCut(const G4ParticleDefinition*,
    85                         const G4MaterialCutsCouple*);
     83  virtual G4double MinEnergyCut(const G4ParticleDefinition*,
     84                                const G4MaterialCutsCouple*);
    8685                       
    8786  virtual G4double ComputeCrossSectionPerElectron(
     
    131130protected:
    132131
    133   G4double MaxSecondaryEnergy(const G4ParticleDefinition*,
    134                               G4double kinEnergy);
     132  virtual G4double MaxSecondaryEnergy(const G4ParticleDefinition*,
     133                                      G4double kinEnergy);
    135134
    136135private:
    137136
    138   void SetParticle(const G4ParticleDefinition* p);
     137  inline void SetupParameters();
     138
     139  inline void SetParticle(const G4ParticleDefinition* p);
     140
     141  inline void SetGenericIon(const G4ParticleDefinition* p);
    139142
    140143  // hide assignment operator
     
    166169//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    167170
    168 inline G4double G4BetheBlochModel::MaxSecondaryEnergy(
    169           const G4ParticleDefinition* pd,
    170                 G4double kinEnergy)
    171 {
    172   if(isIon) SetParticle(pd);
    173   G4double tau  = kinEnergy/mass;
    174   G4double tmax = 2.0*electron_mass_c2*tau*(tau + 2.) /
    175                   (1. + 2.0*(tau + 1.)*ratio + ratio*ratio);
    176   return std::min(tmax,tlimit);
     171inline void G4BetheBlochModel::SetupParameters()
     172{
     173  mass = particle->GetPDGMass();
     174  spin = particle->GetPDGSpin();
     175  G4double q = particle->GetPDGCharge()/eplus;
     176  chargeSquare = q*q;
     177  ratio = electron_mass_c2/mass;
     178  G4double magmom = particle->GetPDGMagneticMoment()*mass/(0.5*eplus*hbar_Planck*c_squared);
     179  magMoment2 = magmom*magmom - 1.0;
     180  formfact = 0.0;
     181  if(particle->GetLeptonNumber() == 0) {
     182    G4double x = 0.8426*GeV;
     183    if(spin == 0.0 && mass < GeV) {x = 0.736*GeV;}
     184    else if(mass > GeV) {
     185      x /= nist->GetZ13(mass/proton_mass_c2);
     186      //        tlimit = 51.2*GeV*A13[iz]*A13[iz];
     187    }
     188    formfact = 2.0*electron_mass_c2/(x*x);
     189    tlimit   = 2.0/formfact;
     190  }
    177191}
    178192
    179193//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    180194
     195inline void G4BetheBlochModel::SetParticle(const G4ParticleDefinition* p)
     196{
     197  if(particle != p) {
     198    particle = p;
     199    if (p->GetPDGCharge()/eplus > 1.5 && p->GetBaryonNumber() > 2) isIon = true;
     200    SetupParameters();
     201  }
     202}
     203
     204//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     205
     206inline void G4BetheBlochModel::SetGenericIon(const G4ParticleDefinition* p)
     207{
     208  if(p && particle != p) {
     209    if(p->GetParticleName() == "GenericIon") isIon = true;
     210  }
     211}
     212
    181213#endif
  • trunk/source/processes/electromagnetic/standard/include/G4BohrFluctuations.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4BohrFluctuations.hh,v 1.3 2007/09/27 13:53:11 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4BohrFluctuations.hh,v 1.4 2009/02/19 19:17:50 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    7979  void InitialiseMe(const G4ParticleDefinition*);
    8080
    81 protected:
    82 
    8381private:
    8482
     
    103101//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    104102
    105 
    106 inline G4double G4BohrFluctuations::Dispersion(
    107                           const G4Material* material,
    108                           const G4DynamicParticle* dp,
    109                                 G4double& tmax,
    110                                 G4double& length)
    111 {
    112   if(!particle) InitialiseMe(dp->GetDefinition());
    113 
    114   G4double electronDensity = material->GetElectronDensity();
    115   kineticEnergy = dp->GetKineticEnergy();
    116   G4double etot = kineticEnergy + particleMass;
    117   beta2 = kineticEnergy*(kineticEnergy + 2.0*particleMass)/(etot*etot);
    118   G4double siga  = (1.0/beta2 - 0.5) * twopi_mc2_rcl2 * tmax * length
    119                  * electronDensity * chargeSquare;
    120 
    121   return siga;
    122 }
    123 
    124 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    125 
    126103#endif
    127104
  • trunk/source/processes/electromagnetic/standard/include/G4BraggIonModel.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4BraggIonModel.hh,v 1.11 2008/10/22 16:00:57 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4BraggIonModel.hh,v 1.12 2009/02/20 12:06:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    7777  virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&);
    7878
    79   G4double MinEnergyCut(const G4ParticleDefinition*,
    80                         const G4MaterialCutsCouple*);
     79  virtual G4double MinEnergyCut(const G4ParticleDefinition*,
     80                                const G4MaterialCutsCouple*);
    8181                       
    8282  virtual G4double ComputeCrossSectionPerElectron(
     
    128128protected:
    129129
    130   G4double MaxSecondaryEnergy(const G4ParticleDefinition*,
    131                               G4double kinEnergy);
     130  virtual G4double MaxSecondaryEnergy(const G4ParticleDefinition*,
     131                                      G4double kinEnergy);
    132132
    133133private:
     
    180180//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    181181
    182 inline G4double G4BraggIonModel::MaxSecondaryEnergy(
    183           const G4ParticleDefinition* pd,
    184                 G4double kinEnergy)
    185 {
    186   if(pd != particle) SetParticle(pd);
    187   G4double tau  = kinEnergy/mass;
    188   G4double tmax = 2.0*electron_mass_c2*tau*(tau + 2.) /
    189                   (1. + 2.0*(tau + 1.)*ratio + ratio*ratio);
    190   return tmax;
    191 }
    192 
    193 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    194 
    195182inline void G4BraggIonModel::SetParticle(const G4ParticleDefinition* p)
    196183{
  • trunk/source/processes/electromagnetic/standard/include/G4BraggModel.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4BraggModel.hh,v 1.12 2008/09/14 17:11:48 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4BraggModel.hh,v 1.13 2009/02/20 12:06:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    8080  virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&);
    8181
    82   G4double MinEnergyCut(const G4ParticleDefinition*,
    83                         const G4MaterialCutsCouple*);
     82  virtual G4double MinEnergyCut(const G4ParticleDefinition*,
     83                                const G4MaterialCutsCouple*);
    8484                       
    8585  virtual G4double ComputeCrossSectionPerElectron(
     
    131131protected:
    132132
    133   G4double MaxSecondaryEnergy(const G4ParticleDefinition*,
    134                               G4double kinEnergy);
     133  virtual G4double MaxSecondaryEnergy(const G4ParticleDefinition*,
     134                                      G4double kinEnergy);
    135135
    136136private:
    137137
    138   void SetParticle(const G4ParticleDefinition* p);
     138  inline void SetParticle(const G4ParticleDefinition* p);
    139139
    140140  G4bool HasMaterial(const G4Material* material);
     
    182182  G4bool   isInitialised;
    183183};
    184 
    185 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    186 
    187 inline G4double G4BraggModel::MaxSecondaryEnergy(
    188                                             const G4ParticleDefinition* pd,
    189                                                   G4double kinEnergy)
    190 {
    191   if(pd != particle) SetParticle(pd);
    192   G4double tau  = kinEnergy/mass;
    193   G4double tmax = 2.0*electron_mass_c2*tau*(tau + 2.) /
    194                   (1. + 2.0*(tau + 1.)*ratio + ratio*ratio);
    195   return tmax;
    196 }
    197184
    198185//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
  • trunk/source/processes/electromagnetic/standard/include/G4ComptonScattering.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4ComptonScattering.hh,v 1.20 2007/05/23 08:47:34 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4ComptonScattering.hh,v 1.21 2009/02/20 12:06:37 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//------------------ G4ComptonScattering physics process -----------------------
     
    8282
    8383  // true for Gamma only. 
    84   G4bool IsApplicable(const G4ParticleDefinition&);
     84  virtual G4bool IsApplicable(const G4ParticleDefinition&);
    8585 
    8686  // Print few lines of informations about the process: validity range,
    8787  virtual void PrintInfo();
    88 
    8988
    9089protected:
     
    9796};
    9897
    99 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    100 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    101 
    102 inline
    103 G4bool G4ComptonScattering::IsApplicable(const G4ParticleDefinition& p)
    104 {
    105   return (&p == G4Gamma::Gamma());
    106 }
    107 
    10898//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    10999 
  • trunk/source/processes/electromagnetic/standard/include/G4CoulombScattering.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4CoulombScattering.hh,v 1.11 2008/06/13 08:19:43 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4CoulombScattering.hh,v 1.13 2009/05/07 18:41:45 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    5959public:
    6060
    61   G4CoulombScattering(const G4String& name = "eCoulombScat");
     61  G4CoulombScattering(const G4String& name = "CoulombScat");
    6262
    6363  virtual ~G4CoulombScattering();
     
    104104//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    105105
    106 inline G4bool G4CoulombScattering::IsApplicable(const G4ParticleDefinition& p)
    107 {
    108   return (p.GetPDGCharge() != 0.0 && !p.IsShortLived());
    109 }
    110 
    111 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    112 
    113106inline void G4CoulombScattering::SetThetaMin(G4double val)
    114107{
  • trunk/source/processes/electromagnetic/standard/include/G4GammaConversion.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4GammaConversion.hh,v 1.22 2007/05/23 08:47:34 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4GammaConversion.hh,v 1.23 2009/02/20 12:06:37 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//
     
    8585
    8686  // true for Gamma only.
    87   G4bool IsApplicable(const G4ParticleDefinition&);
     87  virtual G4bool IsApplicable(const G4ParticleDefinition&);
    8888
    8989  // Print few lines of informations about the process: validity range,
     
    9999};
    100100
    101 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    102 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    103 
    104 inline G4bool G4GammaConversion::IsApplicable(const G4ParticleDefinition& p)
    105 {
    106   return (&p == G4Gamma::Gamma());
    107 }
    108 
    109101//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    110102 
  • trunk/source/processes/electromagnetic/standard/include/G4IonFluctuations.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4IonFluctuations.hh,v 1.8 2008/10/22 16:04:33 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4IonFluctuations.hh,v 1.9 2009/02/19 19:17:50 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    8484
    8585  // Initialisation prestep
    86   inline void SetParticleAndCharge(const G4ParticleDefinition*, G4double q2);
     86  void SetParticleAndCharge(const G4ParticleDefinition*, G4double q2);
    8787
    8888private:
     
    117117//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    118118
    119 inline
    120 void G4IonFluctuations::SetParticleAndCharge(const G4ParticleDefinition* part,
    121                                              G4double q2)
    122 {
    123   if(part != particle) {
    124     particle       = part;
    125     particleMass   = part->GetPDGMass();
    126     charge         = part->GetPDGCharge()/eplus;
    127     chargeSquare   = charge*charge;
    128   }
    129   effChargeSquare  = q2;
    130   uniFluct.SetParticleAndCharge(part, q2);
    131 }
    132 
    133 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    134 
    135119#endif
    136120
  • trunk/source/processes/electromagnetic/standard/include/G4MollerBhabhaModel.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4MollerBhabhaModel.hh,v 1.19 2007/05/22 17:34:36 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4MollerBhabhaModel.hh,v 1.20 2009/02/20 12:06:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    7474  virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&);
    7575
    76   G4double MinEnergyCut(const G4ParticleDefinition*,
    77                         const G4MaterialCutsCouple*);
     76  virtual G4double MinEnergyCut(const G4ParticleDefinition*,
     77                                const G4MaterialCutsCouple*);
    7878                               
    7979  virtual G4double ComputeCrossSectionPerElectron(
     
    109109protected:
    110110
    111   G4double MaxSecondaryEnergy(const G4ParticleDefinition*,
    112                               G4double kinEnergy);
     111  virtual G4double MaxSecondaryEnergy(const G4ParticleDefinition*,
     112                                      G4double kinEnergy);
    113113                             
    114   void SetParticle(const G4ParticleDefinition* p);                           
     114  inline void SetParticle(const G4ParticleDefinition* p);                             
    115115
    116116  const G4ParticleDefinition* particle;
     
    127127  G4MollerBhabhaModel & operator=(const  G4MollerBhabhaModel &right);
    128128  G4MollerBhabhaModel(const  G4MollerBhabhaModel&);
     129
     130  G4bool   isInitialised;
     131
    129132};
    130133
    131134//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    132135
    133 inline G4double G4MollerBhabhaModel::MaxSecondaryEnergy(
    134                                                    const G4ParticleDefinition*,
    135                                                          G4double kinEnergy)
     136inline void G4MollerBhabhaModel::SetParticle(const G4ParticleDefinition* p)
    136137{
    137   G4double tmax = kinEnergy;
    138   if(isElectron) tmax *= 0.5;
    139   return tmax;
     138  particle = p;
     139  if(p != theElectron) isElectron = false;
    140140}
    141141
  • trunk/source/processes/electromagnetic/standard/include/G4PAIModel.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
     26// $Id: G4PAIModel.hh,v 1.22 2009/02/19 19:17:50 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2628//
    2729// -------------------------------------------------------------------
     
    7577  virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&);
    7678
    77   virtual void InitialiseMe(const G4ParticleDefinition*) {};
    78 
    79   virtual G4double ComputeDEDX(const G4MaterialCutsCouple*,
     79  virtual void InitialiseMe(const G4ParticleDefinition*);
     80
     81  virtual G4double ComputeDEDXPerVolume(const G4Material*,
    8082                               const G4ParticleDefinition*,
    8183                               G4double kineticEnergy,
    8284                               G4double cutEnergy);
    8385
    84   virtual G4double CrossSection(const G4MaterialCutsCouple*,
     86  virtual G4double CrossSectionPerVolume(const G4Material*,
    8587                                const G4ParticleDefinition*,
    8688                                G4double kineticEnergy,
     
    118120
    119121  void SetVerboseLevel(G4int verbose){fVerbose=verbose;};
    120 
    121 
    122122
    123123protected:
     
    192192};
    193193
    194 /////////////////////////////////////////////////////////////////////
    195 
    196 inline G4double G4PAIModel::MaxSecondaryEnergy( const G4ParticleDefinition* p,
    197                                                       G4double kinEnergy)
    198 {
    199   G4double tmax = kinEnergy;
    200   if(p == fElectron) tmax *= 0.5;
    201   else if(p != fPositron) {
    202     G4double mass = p->GetPDGMass();
    203     G4double ratio= electron_mass_c2/mass;
    204     G4double gamma= kinEnergy/mass + 1.0;
    205     tmax = 2.0*electron_mass_c2*(gamma*gamma - 1.) /
    206                   (1. + 2.0*gamma*ratio + ratio*ratio);
    207   }
    208   return tmax;
    209 }
    210 
    211 ///////////////////////////////////////////////////////////////
    212 
    213 inline  void G4PAIModel::DefineForRegion(const G4Region* r)
    214 {
    215   fPAIRegionVector.push_back(r);
    216 }
    217 
    218194#endif
    219195
  • trunk/source/processes/electromagnetic/standard/include/G4PAIPhotonModel.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
     26// $Id: G4PAIPhotonModel.hh,v 1.12 2009/02/19 19:17:50 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2628//
    2729// -------------------------------------------------------------------
     
    7476  virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&);
    7577 
    76   virtual void InitialiseMe(const G4ParticleDefinition*) {};
    77 
    78   virtual G4double ComputeDEDX(const G4MaterialCutsCouple*,
    79                                const G4ParticleDefinition*,
    80                                G4double kineticEnergy,
    81                                G4double cutEnergy);
    82 
    83   virtual G4double CrossSection(const G4MaterialCutsCouple*,
    84                                 const G4ParticleDefinition*,
    85                                 G4double kineticEnergy,
    86                                 G4double cutEnergy,
    87                                 G4double maxEnergy);
     78  virtual void InitialiseMe(const G4ParticleDefinition*);
     79
     80  virtual G4double ComputeDEDXPerVolume(const G4Material*,
     81                                        const G4ParticleDefinition*,
     82                                        G4double kineticEnergy,
     83                                        G4double cutEnergy);
     84
     85  virtual G4double CrossSectionPerVolume(const G4Material*,
     86                                         const G4ParticleDefinition*,
     87                                         G4double kineticEnergy,
     88                                         G4double cutEnergy,
     89                                         G4double maxEnergy);
    8890
    8991  virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*,
     
    122124                             G4double position, G4int iTransfer );
    123125
    124 
    125 
    126126protected:
    127127
    128128  G4double MaxSecondaryEnergy(const G4ParticleDefinition*,
    129                                     G4double kinEnergy);
     129                              G4double kinEnergy);
    130130
    131131private:
     
    145145  G4int                fVerbose;
    146146  G4PhysicsLogVector*  fProtonEnergyVector ;
    147 
    148 
    149147
    150148  // vectors
     
    204202};
    205203
    206 /////////////////////////////////////////////////////////////////////
    207 
    208 inline G4double G4PAIPhotonModel::MaxSecondaryEnergy( const G4ParticleDefinition* p,
    209                                                       G4double kinEnergy)
    210 {
    211   G4double tmax = kinEnergy;
    212   if(p == fElectron) tmax *= 0.5;
    213   else if(p != fPositron) {
    214     G4double mass = p->GetPDGMass();
    215     G4double ratio= electron_mass_c2/mass;
    216     G4double gamma= kinEnergy/mass + 1.0;
    217     tmax = 2.0*electron_mass_c2*(gamma*gamma - 1.) /
    218                   (1. + 2.0*gamma*ratio + ratio*ratio);
    219   }
    220   return tmax;
    221 }
    222 
    223 ///////////////////////////////////////////////////////////////
    224 
    225 inline  void G4PAIPhotonModel::DefineForRegion(const G4Region* r)
    226 {
    227   fPAIRegionVector.push_back(r);
    228 }
    229 
    230204#endif
    231205
  • trunk/source/processes/electromagnetic/standard/include/G4PEEffectModel.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PEEffectModel.hh,v 1.6 2007/05/22 17:34:36 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4PEEffectModel.hh,v 1.7 2009/02/20 12:06:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    4141//
    4242// 06.02.2006 : added ComputeMeanFreePath()  (mma)
     43// 20.02.2009 : move virtual inline to .cc, substitute
     44//              ComputeMeanFreePath() by CrossSectionPerVolume (VI)
    4345//
    4446// Class Description:
     
    7072  virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&);
    7173
    72   G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
    73                                       G4double kinEnergy,
    74                                       G4double Z,
    75                                       G4double A,
    76                                       G4double, G4double);
     74  virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
     75                                              G4double kinEnergy,
     76                                              G4double Z,
     77                                              G4double A,
     78                                              G4double, G4double);
    7779                                     
    78   G4double ComputeMeanFreePath( const G4ParticleDefinition*,
    79                                       G4double kinEnergy,
    80                                 const G4Material* material,     
    81                                       G4double, G4double);
     80  virtual G4double CrossSectionPerVolume(const G4Material*,
     81                                         const G4ParticleDefinition*,
     82                                         G4double kineticEnergy,
     83                                         G4double cutEnergy,
     84                                         G4double maxEnergy);
    8285
    8386  virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*,
     
    100103};
    101104
    102 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
    103 
    104 inline G4double G4PEEffectModel::ComputeCrossSectionPerAtom(
    105                                        const G4ParticleDefinition*,
    106                                              G4double energy,
    107                                              G4double Z, G4double,
    108                                              G4double, G4double)
    109 {
    110  G4double* SandiaCof = G4SandiaTable::GetSandiaCofPerAtom((G4int)Z, energy);
    111 
    112  G4double energy2 = energy*energy, energy3 = energy*energy2,
    113           energy4 = energy2*energy2;
    114 
    115  return SandiaCof[0]/energy  + SandiaCof[1]/energy2 +
    116         SandiaCof[2]/energy3 + SandiaCof[3]/energy4;
    117 }
    118 
    119 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    120 
    121 inline G4double G4PEEffectModel::ComputeMeanFreePath(
    122                                        const G4ParticleDefinition*,
    123                                              G4double energy,
    124                                        const G4Material* material,
    125                                              G4double, G4double)
    126 {
    127  G4double* SandiaCof = material->GetSandiaTable()
    128                                 ->GetSandiaCofForMaterial(energy);
    129                                
    130  G4double energy2 = energy*energy, energy3 = energy*energy2,
    131           energy4 = energy2*energy2;
    132          
    133  G4double cross = SandiaCof[0]/energy  + SandiaCof[1]/energy2 +
    134                   SandiaCof[2]/energy3 + SandiaCof[3]/energy4;
    135  
    136  G4double mfp = DBL_MAX;
    137  if (cross > 0.) mfp = 1./cross;
    138  return mfp;
    139 }
    140 
    141105//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    142106
  • trunk/source/processes/electromagnetic/standard/include/G4PhotoElectricEffect.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4PhotoElectricEffect.hh,v 1.24 2007/05/23 08:47:34 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4PhotoElectricEffect.hh,v 1.25 2009/02/20 12:06:37 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//
     
    9191
    9292  // true for Gamma only.
    93   G4bool IsApplicable(const G4ParticleDefinition&);
     93  virtual G4bool IsApplicable(const G4ParticleDefinition&);
    9494
    9595  // Print few lines of informations about the process: validity range,
    96   void PrintInfo();
     96  virtual void PrintInfo();
    9797
    9898protected:
    9999
    100   void InitialiseProcess(const G4ParticleDefinition*);
     100  virtual void InitialiseProcess(const G4ParticleDefinition*);
    101101
    102102private:
     
    105105};
    106106
    107 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    108 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    109 
    110 inline
    111 G4bool G4PhotoElectricEffect::IsApplicable(const G4ParticleDefinition& p)
    112 {
    113   return (&p == G4Gamma::Gamma());
    114 }
    115 
    116107//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    117108
  • trunk/source/processes/electromagnetic/standard/include/G4UniversalFluctuation.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4UniversalFluctuation.hh,v 1.6 2008/10/22 16:04:33 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4UniversalFluctuation.hh,v 1.10 2009/03/19 14:15:17 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    7070  virtual ~G4UniversalFluctuation();
    7171
    72   G4double SampleFluctuations(const G4Material*,
    73                           const G4DynamicParticle*,
    74                                 G4double&,
    75                                 G4double&,
    76                                 G4double&);
     72  virtual G4double SampleFluctuations(const G4Material*,
     73                                      const G4DynamicParticle*,
     74                                      G4double&,
     75                                      G4double&,
     76                                      G4double&);
    7777
    78   G4double Dispersion(    const G4Material*,
    79                           const G4DynamicParticle*,
    80                                 G4double&,
    81                                 G4double&);
     78  virtual G4double Dispersion(    const G4Material*,
     79                                  const G4DynamicParticle*,
     80                                  G4double&,
     81                                  G4double&);
    8282
    83   void InitialiseMe(const G4ParticleDefinition*);
     83  virtual void InitialiseMe(const G4ParticleDefinition*);
    8484
    8585  // Initialisation prestep
    86   inline void SetParticleAndCharge(const G4ParticleDefinition*, G4double q2);
    87 
    88 protected:
     86  virtual void SetParticleAndCharge(const G4ParticleDefinition*, G4double q2);
    8987
    9088private:
     
    113111  G4double e0;
    114112
    115   G4double facwidth;
    116   G4double oldloss;
    117   G4double samestep;
    118113  G4double e1,e2;
    119114
     
    126121};
    127122
    128 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    129 
    130 inline void
    131 G4UniversalFluctuation::SetParticleAndCharge(const G4ParticleDefinition* part,
    132                                              G4double q2)
    133 {
    134   if(part != particle) {
    135     particle       = part;
    136     particleMass   = part->GetPDGMass();
    137   }
    138   chargeSquare = q2;
    139 }
    140 
    141123//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    142124
  • trunk/source/processes/electromagnetic/standard/include/G4UrbanMscModel.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4UrbanMscModel.hh,v 1.33 2008/03/10 10:39:21 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4UrbanMscModel.hh,v 1.35 2009/04/29 13:30:22 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    3737// Author:        Laszlo Urban
    3838//
    39 // Creation date: 01.03.2001
     39// Creation date: 06.03.2008
    4040//
    4141// Modifications:
    4242//
    43 // 27-03-03 Move model part from G4MultipleScattering (V.Ivanchenko)
    44 // 27-03-03 Rename (V.Ivanchenko)
    45 //
    46 // 05-08-03 angle distribution has been modified (L.Urban)
    47 // 26-11-03 new data member currentRange (L.Urban)
    48 // 01-03-04 changes in data members + signature changed in SampleCosineTheta
    49 // 11-03-04 changes in data members (L.Urban)
    50 // 23-04-04 changes in data members and in signature of SampleCosineTheta
    51 //          (L.Urban)
    52 // 17-08-04 name of data member facxsi changed to factail (L.Urban)
    53 // 08-04-05 Major optimisation of internal interfaces (V.Ivantchenko)
    54 // 15-04-05 optimize internal interface - add SampleSecondaries method (V.Ivanchenko)
    55 // 11-08-05 computation of lateral correlation added (L.Urban)
    56 // 02-10-05 nuclear size correction computation removed, the correction
    57 //          included in the (theoretical) tabulated values (L.Urban)
    58 // 16-02-06 data members b and xsi have been removed (L.Urban)
    59 // 17-02-06 Save table of transport cross sections not mfp (V.Ivanchenko)
    60 // 07-03-06 Create G4UrbanMscModel and move there step limit calculation (V.Ivanchenko)
    61 // 10-05-06 SetMscStepLimitation at initialisation (V.Ivantchenko)
    62 // 11-05-06 name of data member safety changed to presafety, some new data
    63 //          members added (frscaling1,frscaling2,tlimitminfix,nstepmax)
    64 //         (L.Urban)
    65 // 13-10-06 data member factail removed, data member tkinlimit changed
    66 //          to lambdalimit,
    67 //          new data members tgeom,tnow,skin,skindepth,Zeff,geomlimit
    68 //          G4double GeomLimit(const G4Track& track) changed to
    69 //              void GeomLimit(const G4Track& track) (L.Urban)
    70 // 20-10-06 parameter theta0 now computed in the (public)
    71 //          function ComputeTheta0,
    72 //          single scattering modified allowing not small
    73 //          angles as well (L.Urban)
    74 // 31-01-07 code cleaning (L.Urban)
    75 // 06-02-07 Move SetMscStepLimitation method into the source (VI)
    76 // 15-02-07 new data member : smallstep (L.Urban)
    77 // 10-04-07 remove navigator, smallstep, tnow (V.Ivanchenko)
    78 //
     43// 28-04-09  move G4UrbanMscModel2 from the g49.2 to G4UrbanMscModel.
     44//           now it is frozen (V.Ivanchenk0)
    7945//
    8046// Class Description:
     
    11177
    11278  void Initialise(const G4ParticleDefinition*, const G4DataVector&);
    113                                          
     79
    11480  G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition* particle,
    11581                                      G4double KineticEnergy,
     
    11985                                      G4double emax=DBL_MAX);
    12086
    121   void SampleSecondaries(std::vector<G4DynamicParticle*>*,
    122                          const G4MaterialCutsCouple*,
    123                          const G4DynamicParticle*,
    124                          G4double,
    125                          G4double);
    126 
    12787  void SampleScattering(const G4DynamicParticle*,
    12888                        G4double safety);
     
    141101private:
    142102
     103  G4double SimpleScattering(G4double xmeanth, G4double x2meanth);
     104
    143105  G4double SampleCosineTheta(G4double trueStepLength, G4double KineticEnergy);
    144106
     
    147109  G4double LatCorrelation();
    148110
    149   void GeomLimit(const G4Track& track);
    150 
    151111  inline G4double GetLambda(G4double kinEnergy);
    152112
    153113  inline void SetParticle(const G4ParticleDefinition*);
     114
     115  inline void UpdateCache();
    154116
    155117  //  hide assignment operator
     
    160122  G4ParticleChangeForMSC*     fParticleChange;
    161123
    162   G4SafetyHelper*             safetyHelper;
    163124  G4PhysicsTable*             theLambdaTable;
    164125  const G4MaterialCutsCouple* couple;
     
    166127
    167128  G4double mass;
    168   G4double charge;
    169 
    170   G4double masslimite,masslimitmu;
     129  G4double charge,ChargeSquare;
     130  G4double masslimite,lambdalimit,fr;
    171131
    172132  G4double taubig;
     
    174134  G4double taulim;
    175135  G4double currentTau;
    176   G4double frscaling1,frscaling2;
    177136  G4double tlimit;
    178137  G4double tlimitmin;
    179138  G4double tlimitminfix;
    180 
    181   G4double nstepmax;
     139  G4double tgeom;
     140
    182141  G4double geombig;
    183142  G4double geommin;
     
    198157  G4double currentKinEnergy;
    199158  G4double currentRange;
     159  G4double rangeinit;
    200160  G4double currentRadLength;
    201161
    202   G4double Zeff;
     162  G4double theta0max,rellossmax;
     163  G4double third;
    203164
    204165  G4int    currentMaterialIndex;
     166
     167  G4double y;
     168  G4double Zold;
     169  G4double Zeff,Z2,Z23,lnZ;
     170  G4double coeffth1,coeffth2;
     171  G4double coeffc1,coeffc2;
     172  G4double scr1ini,scr2ini,scr1,scr2;
    205173
    206174  G4bool   isInitialized;
    207175  G4bool   inside;
    208176  G4bool   insideskin;
    209 
    210177};
    211178
     179//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    212180//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    213181
     
    236204    mass = p->GetPDGMass();
    237205    charge = p->GetPDGCharge()/eplus;
     206    ChargeSquare = charge*charge;
    238207  }
    239208}
     
    241210//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    242211
     212inline
     213void G4UrbanMscModel::UpdateCache()                                   
     214{
     215    lnZ = std::log(Zeff);
     216    coeffth1 = 0.885+lnZ*(0.104-0.0170*lnZ);
     217    coeffth2 = 0.028+lnZ*(0.012-0.00125*lnZ);
     218    coeffc1  = 2.134-lnZ*(0.1045-0.00602*lnZ);
     219    coeffc2  = 0.001126-lnZ*(0.0001089+0.0000247*lnZ);
     220    Z2 = Zeff*Zeff;
     221    Z23 = std::exp(2.*lnZ/3.);
     222    scr1     = scr1ini*Z23;
     223    scr2     = scr2ini*Z2*ChargeSquare;
     224  //  lastMaterial = couple->GetMaterial();
     225    Zold = Zeff;
     226}
     227
    243228#endif
    244229
  • trunk/source/processes/electromagnetic/standard/include/G4UrbanMscModel2.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4UrbanMscModel2.hh,v 1.11 2008/12/18 13:01:34 gunter Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4UrbanMscModel2.hh,v 1.17 2009/05/15 09:26:42 urban Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    4040//
    4141// Modifications:
    42 //
     42// 23.04.2009 L.Urban updated parameterization in UpdateCache method
    4343//
    4444//
     
    8484                                      G4double emax=DBL_MAX);
    8585
    86   void SampleSecondaries(std::vector<G4DynamicParticle*>*,
    87                          const G4MaterialCutsCouple*,
    88                          const G4DynamicParticle*,
    89                          G4double,
    90                          G4double);
    91 
    9286  void SampleScattering(const G4DynamicParticle*,
    9387                        G4double safety);
     
    114108  G4double LatCorrelation();
    115109
    116   void GeomLimit(const G4Track& track);
    117 
    118110  inline G4double GetLambda(G4double kinEnergy);
    119111
     
    129121  G4ParticleChangeForMSC*     fParticleChange;
    130122
    131   G4SafetyHelper*             safetyHelper;
    132123  G4PhysicsTable*             theLambdaTable;
    133124  const G4MaterialCutsCouple* couple;
    134125  G4LossTableManager*         theManager;
    135 
    136126
    137127  G4double mass;
     
    223213{
    224214    lnZ = std::log(Zeff);
    225     coeffth1 = 0.885+lnZ*(0.104-0.0170*lnZ);
    226     coeffth2 = 0.028+lnZ*(0.012-0.00125*lnZ);
    227     coeffc1  = 2.134-lnZ*(0.1045-0.00602*lnZ);
    228     coeffc2  = 0.001126-lnZ*(0.0001089+0.0000247*lnZ);
     215    //new correction in theta0 formula
     216    coeffth1 = (1.-8.7780e-2/Zeff)*(0.87+0.03*lnZ);                   
     217    coeffth2 = (4.0780e-2+1.7315e-4*Zeff)*(0.87+0.03*lnZ);             
     218    // tail parameters
     219    G4double lnZ1 = std::log(Zeff+1.);
     220    coeffc1  = 2.943-0.197*lnZ1;                 
     221    coeffc2  = 0.0987-0.0143*lnZ1;                             
     222    // for single scattering
    229223    Z2 = Zeff*Zeff;
    230224    Z23 = std::exp(2.*lnZ/3.);
    231225    scr1     = scr1ini*Z23;
    232226    scr2     = scr2ini*Z2*ChargeSquare;
    233   //  lastMaterial = couple->GetMaterial();
     227                                             
    234228    Zold = Zeff;
    235229}
  • trunk/source/processes/electromagnetic/standard/include/G4UrbanMscModel90.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4UrbanMscModel90.hh,v 1.4 2008/10/29 14:15:30 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4UrbanMscModel90.hh,v 1.5 2009/04/10 16:34:56 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    110110
    111111  G4double LatCorrelation();
    112 
    113   void GeomLimit(const G4Track& track);
    114112
    115113  inline G4double GetLambda(G4double kinEnergy);
  • trunk/source/processes/electromagnetic/standard/include/G4WentzelVIModel.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4WentzelVIModel.hh,v 1.7 2008/08/04 08:49:09 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4WentzelVIModel.hh,v 1.17 2009/05/10 16:09:29 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    6666class G4LossTableManager;
    6767class G4ParticleChangeForMSC;
    68 class G4SafetyHelper;
    6968class G4ParticleDefinition;
    7069
     
    8079  virtual ~G4WentzelVIModel();
    8180
    82   void Initialise(const G4ParticleDefinition*, const G4DataVector&);
    83 
    84   G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
    85                                       G4double KineticEnergy,
    86                                       G4double AtomicNumber,
    87                                       G4double AtomicWeight=0.,
    88                                       G4double cut = DBL_MAX,
    89                                       G4double emax= DBL_MAX);
    90 
    91   void SampleScattering(const G4DynamicParticle*, G4double safety);
    92 
    93   void SampleSecondaries(std::vector<G4DynamicParticle*>*,
    94                          const G4MaterialCutsCouple*,
    95                          const G4DynamicParticle*,
    96                          G4double,
    97                          G4double);
    98 
    99   G4double ComputeTruePathLengthLimit(const G4Track& track,
    100                                       G4PhysicsTable* theLambdaTable,
    101                                       G4double currentMinimalStep);
    102 
    103   G4double ComputeGeomPathLength(G4double truePathLength);
    104 
    105   G4double ComputeTrueStepLength(G4double geomStepLength);
     81  virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&);
     82
     83  virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
     84                                              G4double KineticEnergy,
     85                                              G4double AtomicNumber,
     86                                              G4double AtomicWeight=0.,
     87                                              G4double cut = DBL_MAX,
     88                                              G4double emax= DBL_MAX);
     89
     90  virtual void SampleScattering(const G4DynamicParticle*, G4double safety);
     91
     92  virtual G4double ComputeTruePathLengthLimit(const G4Track& track,
     93                                              G4PhysicsTable* theLambdaTable,
     94                                              G4double currentMinimalStep);
     95
     96  virtual G4double ComputeGeomPathLength(G4double truePathLength);
     97
     98  virtual G4double ComputeTrueStepLength(G4double geomStepLength);
    10699
    107100private:
    108101
    109   G4double ComputeTransportXSectionPerVolume();
     102  G4double ComputeTransportXSectionPerAtom();
    110103
    111104  G4double ComputeXSectionPerVolume();
     
    133126  G4ParticleChangeForMSC*   fParticleChange;
    134127
    135   G4SafetyHelper*           safetyHelper;
    136128  G4PhysicsTable*           theLambdaTable;
    137129  G4PhysicsTable*           theLambda2Table;
     
    173165  // single scattering parameters
    174166  G4double coeff;
    175   G4double constn;
    176167  G4double cosThetaMin;
    177168  G4double cosThetaMax;
     
    182173  G4double q2Limit;
    183174  G4double alpha2;
    184   G4double a0;
    185175
    186176  // projectile
     
    193183  G4double mom2;
    194184  G4double invbeta2;
     185  G4double kinFactor;
    195186  G4double etag;
    196187  G4double lowEnergyLimit;
     
    198189  // target
    199190  G4double targetZ;
     191  G4double targetMass;
    200192  G4double screenZ;
    201193  G4double formfactA;
    202   G4double FF[100];
     194  G4int    iz;
     195
     196  static G4double ScreenRSquare[100];
     197  static G4double FormFactor[100];
    203198
    204199  // flags
     
    240235//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    241236
    242 inline
    243 void G4WentzelVIModel::SetupParticle(const G4ParticleDefinition* p)
     237inline void G4WentzelVIModel::SetupParticle(const G4ParticleDefinition* p)
    244238{
    245239  // Initialise mass and charge
     
    251245    chargeSquare = q*q;
    252246    tkin = 0.0;
    253     lowEnergyLimit = keV*mass/electron_mass_c2;
    254247  }
    255248}
     
    264257    invbeta2 = 1.0 +  mass*mass/mom2;
    265258    cosTetMaxNuc = cosThetaMax;
    266     if(ekin <= 10.*cut && mass < MeV) {
     259    if(mass < MeV && ekin <= 10.*cut) {
    267260      cosTetMaxNuc = ekin*(cosThetaMax + 1.0)/(10.*cut) - 1.0;
    268261    }
     
    278271    etag    = e;
    279272    targetZ = Z;
    280     G4int iz= G4int(Z);
     273    iz = G4int(Z);
    281274    if(iz > 99) iz = 99;
    282     G4double x = fNistManager->GetZ13(iz);
    283     screenZ = a0*x*x/mom2;
    284     if(iz > 1) screenZ *=(1.13 + 3.76*invbeta2*Z*Z*chargeSquare*alpha2);
    285     //    screenZ = a0*x*x*(1.13 + 3.76*Z*Z*chargeSquare*alpha2)/mom2;
    286     // A.V. Butkevich et al., NIM A 488 (2002) 282
    287     formfactA = FF[iz];
    288     if(formfactA == 0.0) {
    289       x = fNistManager->GetA27(iz);
    290       formfactA = constn*x*x;
    291       FF[iz] = formfactA;
     275    targetMass = fNistManager->GetAtomicMassAmu(iz)*amu_c2;
     276    G4double m12  = mass*mass;
     277    G4double x    = 1.0 + mass/targetMass;
     278    kinFactor  = coeff*targetZ*chargeSquare*(1.0 +  m12/mom2)/mom2;
     279    screenZ = ScreenRSquare[iz]/mom2;
     280    if(iz > 1) {
     281      screenZ *=(1.13 + 3.76*Z*Z*alpha2);
     282      kinFactor /= (x*x);
    292283    }
    293     formfactA *= mom2;
     284    //if(iz > 1) screenZ *=(1.13 + std::min(0.5,3.76*Z*Z*invbeta2*alpha2));
     285    formfactA = FormFactor[iz]*mom2;
    294286    cosTetMaxNuc2 = cosTetMaxNuc;
    295     /*
    296     G4double ee = 10.*eV*Z;
    297     if(1 == iz) ee *= 2.0;
    298     G4double z = std::min(cosTetMaxElec, 1.0 - std::max(ecut,ee)*amu_c2
    299                           *fNistManager->GetAtomicMassAmu(iz)/mom2);
    300     cosTetMaxElec2 = std::max(cosTetMaxNuc2, z);
    301     */
    302287    cosTetMaxElec2 = cosTetMaxElec;
    303288  }
  • trunk/source/processes/electromagnetic/standard/include/G4eBremsstrahlung.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eBremsstrahlung.hh,v 1.36 2007/05/23 08:47:34 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4eBremsstrahlung.hh,v 1.37 2009/02/20 12:06:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    8989  virtual ~G4eBremsstrahlung();
    9090
    91   G4bool IsApplicable(const G4ParticleDefinition& p);
     91  virtual G4bool IsApplicable(const G4ParticleDefinition& p);
    9292
    9393  // Print out of the class parameters
     
    111111
    112112//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    113 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    114 
    115 inline G4bool G4eBremsstrahlung::IsApplicable(const G4ParticleDefinition& p)
    116 {
    117   return (&p == G4Electron::Electron() || &p == G4Positron::Positron());
    118 }
    119 
    120 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    121113
    122114#endif
  • trunk/source/processes/electromagnetic/standard/include/G4eBremsstrahlungModel.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eBremsstrahlungModel.hh,v 1.25 2008/11/13 19:28:58 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4eBremsstrahlungModel.hh,v 1.26 2009/02/20 12:06:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    7575  virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&);
    7676
    77   G4double MinEnergyCut(const G4ParticleDefinition*,
    78                         const G4MaterialCutsCouple*);
     77  virtual G4double MinEnergyCut(const G4ParticleDefinition*,
     78                                const G4MaterialCutsCouple*);
    7979
    8080  virtual G4double ComputeDEDXPerVolume(const G4Material*,
     
    102102
    103103protected:
    104 
    105   inline G4double MaxSecondaryEnergy(const G4ParticleDefinition*,
    106                                      G4double kineticEnergy);
    107104
    108105  const G4Element* SelectRandomAtom(const G4MaterialCutsCouple* couple);
     
    191188//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    192189
    193 inline
    194 G4double G4eBremsstrahlungModel::MaxSecondaryEnergy(
    195                                  const G4ParticleDefinition*,
    196                                        G4double kineticEnergy)
    197 {
    198   return kineticEnergy;
    199 }
    200 
    201 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    202 
    203190#endif
  • trunk/source/processes/electromagnetic/standard/include/G4eBremsstrahlungRelModel.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eBremsstrahlungRelModel.hh,v 1.10 2008/11/14 09:25:19 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4eBremsstrahlungRelModel.hh,v 1.11 2009/02/20 12:06:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    7171  virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&);
    7272
    73   G4double MinEnergyCut(const G4ParticleDefinition*,
    74                         const G4MaterialCutsCouple*);
     73  virtual G4double MinEnergyCut(const G4ParticleDefinition*,
     74                                const G4MaterialCutsCouple*);
    7575
    7676  virtual G4double ComputeDEDXPerVolume(const G4Material*,
     
    9797  inline G4double LPMconstant() const;
    9898
    99 protected:
    100 
    101   inline G4double MaxSecondaryEnergy(const G4ParticleDefinition*,
    102                                      G4double kineticEnergy);
    103 
    10499private:
    105100
     
    207202//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    208203
    209 inline G4double
    210 G4eBremsstrahlungRelModel::MaxSecondaryEnergy(const G4ParticleDefinition*,
    211                                               G4double kineticEnergy)
    212 {
    213   return kineticEnergy;
    214 }
    215 
    216 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    217 
    218204
    219205inline G4double G4eBremsstrahlungRelModel::Phi1(G4double gg, G4double)
  • trunk/source/processes/electromagnetic/standard/include/G4eCoulombScatteringModel.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eCoulombScatteringModel.hh,v 1.36 2008/08/04 08:49:09 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4eCoulombScatteringModel.hh,v 1.43 2009/05/10 16:09:29 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    6565#include "G4VEmModel.hh"
    6666#include "G4PhysicsTable.hh"
     67#include "globals.hh"
    6768#include "G4NistManager.hh"
    68 #include "globals.hh"
    6969
    7070class G4ParticleChangeForGamma;
     
    137137
    138138  G4double                  coeff;
    139   G4double                  constn;
    140139  G4double                  cosThetaMin;
    141140  G4double                  cosThetaMax;
     
    160159  G4double                  mom2;
    161160  G4double                  invbeta2;
     161  G4double                  kinFactor;
    162162  G4double                  etag;
    163163  G4double                  lowEnergyLimit;
     
    165165  // target
    166166  G4double                  targetZ;
     167  G4double                  targetMass;
    167168  G4double                  screenZ;
    168169  G4double                  formfactA;
    169170  G4int                     idxelm;
     171  G4int                     iz;
    170172
    171173private:
    172174
    173   G4double                  a0;
    174175  G4double                  alpha2;
    175176  G4double                  faclim;
    176   G4double                  FF[100];
     177
     178  static G4double ScreenRSquare[100];
     179  static G4double FormFactor[100];
    177180
    178181  G4bool                    isInitialised;             
     
    204207    chargeSquare = q*q;
    205208    tkin = 0.0;
    206     lowEnergyLimit = keV*mass/electron_mass_c2;
    207209  }
    208210}
     
    219221    cosTetMinNuc = cosThetaMin;
    220222    cosTetMaxNuc = cosThetaMax;
    221     if(ekin <= 10.*cut && mass < MeV && cosThetaMin < 1.0) {
     223    if(mass < MeV && cosThetaMin < 1.0 && ekin <= 10.*cut) {
    222224      cosTetMinNuc = ekin*(cosThetaMin + 1.0)/(10.*cut) - 1.0;
    223225    }
     
    233235    etag    = e;
    234236    targetZ = Z;
    235     G4int iz= G4int(Z);
     237    iz= G4int(Z);
    236238    if(iz > 99) iz = 99;
    237     G4double x = fNistManager->GetZ13(iz);
    238     screenZ = a0*x*x/mom2;
    239     if(iz > 1) screenZ *=(1.13 + 3.76*invbeta2*Z*Z*chargeSquare*alpha2);
    240     //screenZ = a0*x*x*(1.13 + 3.76*Z*Z*chargeSquare*alpha2)/mom2;
    241     // A.V. Butkevich et al., NIM A 488 (2002) 282
    242     formfactA = FF[iz];
    243     if(formfactA == 0.0) {
    244       x = fNistManager->GetA27(iz);
    245       formfactA = constn*x*x;
    246       FF[iz] = formfactA;
     239    targetMass   = fNistManager->GetAtomicMassAmu(iz)*amu_c2;
     240    G4double m12 = mass*mass;
     241    G4double x   = 1.0 + mass/targetMass;
     242    kinFactor    = (1.0 +  m12/mom2)/mom2;
     243
     244    screenZ = ScreenRSquare[iz]/mom2;
     245    if(iz > 1) {
     246      screenZ *=(1.13 + 3.76*Z*Z*alpha2);
     247      kinFactor /= (x*x);
    247248    }
    248     formfactA *= mom2;
     249    // if(iz > 1) screenZ *=(1.13 + std::min(0.5,3.76*Z*Z*invbeta2*alpha2));
     250    formfactA = FormFactor[iz]*mom2;
    249251    cosTetMaxNuc2 = cosTetMaxNuc;
    250     if(particle == theProton && 1 == iz && cosTetMaxNuc2 < 0.0) {
     252    if(1 == iz && particle == theProton && cosTetMaxNuc2 < 0.0) {
    251253      cosTetMaxNuc2 = 0.0;
    252254    }
    253     /*
    254     G4double ee = 10.*eV*Z;
    255     if(1 == iz) ee *= 2.0;
    256     G4double z = std::min(cosTetMaxElec, 1.0 - std::max(ecut,ee)*amu_c2
    257                           *fNistManager->GetAtomicMassAmu(iz)/mom2);
    258     cosTetMaxElec2 = std::max(cosTetMaxNuc2, z);
    259     */
    260255    cosTetMaxElec2 = cosTetMaxElec;
    261256  }
  • trunk/source/processes/electromagnetic/standard/include/G4eIonisation.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eIonisation.hh,v 1.35 2007/05/23 08:47:34 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4eIonisation.hh,v 1.36 2009/02/20 12:06:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    8888  virtual ~G4eIonisation();
    8989
    90   G4bool IsApplicable(const G4ParticleDefinition& p);
     90  virtual G4bool IsApplicable(const G4ParticleDefinition& p);
    9191
    9292  // Print out of the class parameters
     
    9898                                           const G4ParticleDefinition*);
    9999
    100   G4double MinPrimaryEnergy(const G4ParticleDefinition*,
    101                             const G4Material*, G4double cut);
     100  virtual G4double MinPrimaryEnergy(const G4ParticleDefinition*,
     101                                    const G4Material*, G4double cut);
    102102
    103103private:
     
    114114};
    115115
    116 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    117 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    118 
    119 inline G4double G4eIonisation::MinPrimaryEnergy(const G4ParticleDefinition*,
    120                                                 const G4Material*,
    121                                                 G4double cut)
    122 {
    123   G4double x = cut;
    124   if(isElectron) x += cut;
    125   return x;
    126 }
    127 
    128 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    129 
    130 inline G4bool G4eIonisation::IsApplicable(const G4ParticleDefinition& p)
    131 {
    132   return (&p == G4Electron::Electron() || &p == G4Positron::Positron());
    133 }
    134 
    135116//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    136117
  • trunk/source/processes/electromagnetic/standard/include/G4eplusAnnihilation.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eplusAnnihilation.hh,v 1.23 2007/05/23 08:47:34 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4eplusAnnihilation.hh,v 1.24 2009/02/20 12:06:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    7373  virtual ~G4eplusAnnihilation();
    7474
    75   G4bool IsApplicable(const G4ParticleDefinition& p);
     75  virtual G4bool IsApplicable(const G4ParticleDefinition& p);
    7676
    7777  virtual G4VParticleChange* AtRestDoIt(
     
    7979                             const G4Step& stepData);
    8080
    81   G4double AtRestGetPhysicalInteractionLength(
     81  virtual G4double AtRestGetPhysicalInteractionLength(
    8282                             const G4Track& track,
    8383                             G4ForceCondition* condition
     
    9696};
    9797
    98 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    99 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    100 
    101 inline G4bool G4eplusAnnihilation::IsApplicable(const G4ParticleDefinition& p)
    102 {
    103   return (&p == G4Positron::Positron());
    104 }
    105 
    106 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    107 
    108 inline
    109 G4double G4eplusAnnihilation::AtRestGetPhysicalInteractionLength(
    110                               const G4Track&, G4ForceCondition* condition)
    111 {
    112   *condition = NotForced;
    113   return 0.0;
    114 }
    115 
    11698//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    11799
  • trunk/source/processes/electromagnetic/standard/include/G4hIonisation.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4hIonisation.hh,v 1.41 2008/09/14 17:11:48 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4hIonisation.hh,v 1.42 2009/02/20 12:06:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    9393  virtual ~G4hIonisation();
    9494
    95   G4bool IsApplicable(const G4ParticleDefinition& p);
     95  virtual G4bool IsApplicable(const G4ParticleDefinition& p);
    9696
    97   G4double MinPrimaryEnergy(const G4ParticleDefinition* p,
    98                             const G4Material*, G4double cut);
     97  virtual G4double MinPrimaryEnergy(const G4ParticleDefinition* p,
     98                                    const G4Material*, G4double cut);
    9999
    100100  // Print out of the class parameters
     
    123123
    124124//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    125 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    126 
    127 inline G4bool G4hIonisation::IsApplicable(const G4ParticleDefinition& p)
    128 {
    129   return (p.GetPDGCharge() != 0.0 && p.GetPDGMass() > 10.0*MeV &&
    130          !p.IsShortLived());
    131 }
    132 
    133 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    134 
    135 inline G4double G4hIonisation::MinPrimaryEnergy(const G4ParticleDefinition*,
    136                                                 const G4Material*,
    137                                                 G4double cut)
    138 {
    139   G4double x = 0.5*cut/electron_mass_c2;
    140   G4double g = x*ratio + std::sqrt((1. + x)*(1. + x*ratio*ratio));
    141   return mass*(g - 1.0);
    142 }
    143 
    144 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    145125
    146126inline void G4hIonisation::ActivateNuclearStopping(G4bool val)
  • trunk/source/processes/electromagnetic/standard/include/G4ionIonisation.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4ionIonisation.hh,v 1.56 2008/09/14 17:11:48 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4ionIonisation.hh,v 1.57 2009/02/20 12:06:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    8585  virtual ~G4ionIonisation();
    8686
    87   inline G4bool IsApplicable(const G4ParticleDefinition& p);
     87  virtual G4bool IsApplicable(const G4ParticleDefinition& p);
    8888
    8989  // Print out of the class parameters
     
    102102                                           const G4ParticleDefinition*);
    103103
    104   inline G4double MinPrimaryEnergy(const G4ParticleDefinition* p,
     104  virtual G4double MinPrimaryEnergy(const G4ParticleDefinition* p,
    105105                                   const G4Material*, G4double cut);
    106106
     
    127127
    128128//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    129 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    130 
    131 inline G4bool G4ionIonisation::IsApplicable(const G4ParticleDefinition& p)
    132 {
    133   return (p.GetPDGCharge() != 0.0 && !p.IsShortLived() &&
    134           p.GetParticleType() == "nucleus");
    135 }
    136 
    137 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    138 
    139 inline G4double G4ionIonisation::MinPrimaryEnergy(
    140           const G4ParticleDefinition* p, const G4Material*, G4double cut)
    141 {
    142   return
    143     p->GetPDGMass()*(std::sqrt(1. + 0.5*cut/CLHEP::electron_mass_c2) - 1.0);
    144 }
    145 
    146129//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    147130
  • trunk/source/processes/electromagnetic/standard/src/G4BetheBlochModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4BetheBlochModel.cc,v 1.24 2008/10/22 16:00:57 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4BetheBlochModel.cc,v 1.31 2009/04/24 14:24:00 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    6565#include "G4EmCorrections.hh"
    6666#include "G4ParticleChangeForLoss.hh"
    67 #include "G4NistManager.hh"
    6867
    6968//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    8382{
    8483  fParticleChange = 0;
    85   if(p) SetParticle(p);
     84  if(p) {
     85    SetGenericIon(p);
     86    SetParticle(p);
     87  }
    8688  theElectron = G4Electron::Electron();
    8789  corr = G4LossTableManager::Instance()->EmCorrections(); 
     
    108110                                   const G4DataVector&)
    109111{
    110   if (!particle) SetParticle(p);
     112  SetGenericIon(p);
     113  SetParticle(p);
     114
     115  //G4cout << "G4BetheBlochModel::Initialise for " << p->GetParticleName()
     116  //     << "  isIon= " << isIon
     117  //     << G4endl;
    111118
    112119  corrFactor = chargeSquare;
     120  // always false before the run
     121  SetDeexcitationFlag(false);
    113122
    114123  if(!isInitialised) {
    115124    isInitialised = true;
    116 
    117     if(!fParticleChange) {
    118       if (pParticleChange) {
    119         fParticleChange = reinterpret_cast<G4ParticleChangeForLoss*>
    120           (pParticleChange);
    121       } else {
    122         fParticleChange = new G4ParticleChangeForLoss();
    123       }
    124     }
    125   }
    126 }
    127 
    128 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    129 
    130 void G4BetheBlochModel::SetParticle(const G4ParticleDefinition* p)
    131 {
    132   if(particle != p) {
    133     particle = p;
    134     G4String pname = particle->GetParticleName();
    135     if (particle->GetParticleType() == "nucleus" &&
    136         pname != "deuteron" && pname != "triton") {
    137       isIon = true;
    138     }
    139    
    140     mass = particle->GetPDGMass();
    141     spin = particle->GetPDGSpin();
    142     G4double q = particle->GetPDGCharge()/eplus;
    143     chargeSquare = q*q;
    144     ratio = electron_mass_c2/mass;
    145     G4double magmom = particle->GetPDGMagneticMoment()
    146       *mass/(0.5*eplus*hbar_Planck*c_squared);
    147     magMoment2 = magmom*magmom - 1.0;
    148     formfact = 0.0;
    149     if(particle->GetLeptonNumber() == 0) {
    150       G4double x = 0.8426*GeV;
    151       if(spin == 0.0 && mass < GeV) {x = 0.736*GeV;}
    152       else if(mass > GeV) {
    153         x /= nist->GetZ13(mass/proton_mass_c2);
    154         //      tlimit = 51.2*GeV*A13[iz]*A13[iz];
    155       }
    156       formfact = 2.0*electron_mass_c2/(x*x);
    157       tlimit   = 2.0/formfact;
    158     }
     125    fParticleChange = GetParticleChangeForLoss();
    159126  }
    160127}
     
    415382  G4double cost = deltaKinEnergy * (totEnergy + electron_mass_c2) /
    416383                                   (deltaMomentum * totMomentum);
     384  /*
    417385  if(cost > 1.0) {
    418386    G4cout << "### G4BetheBlochModel WARNING: cost= "
     
    429397    cost = 1.0;
    430398  }
     399  */
    431400  G4double sint = sqrt((1.0 - cost)*(1.0 + cost));
    432401
     
    440409  // create G4DynamicParticle object for delta ray
    441410  G4DynamicParticle* delta = new G4DynamicParticle(theElectron,
    442                                                  deltaDirection,deltaKinEnergy);
     411                                                   deltaDirection,deltaKinEnergy);
    443412
    444413  vdp->push_back(delta);
     
    453422}
    454423
    455 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     424//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     425
     426G4double G4BetheBlochModel::MaxSecondaryEnergy(const G4ParticleDefinition* pd,
     427                                               G4double kinEnergy)
     428{
     429  // here particle type is checked for any method
     430  SetParticle(pd);
     431  G4double tau  = kinEnergy/mass;
     432  G4double tmax = 2.0*electron_mass_c2*tau*(tau + 2.) /
     433                  (1. + 2.0*(tau + 1.)*ratio + ratio*ratio);
     434  return std::min(tmax,tlimit);
     435}
     436
     437//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
  • trunk/source/processes/electromagnetic/standard/src/G4BetheHeitlerModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4BetheHeitlerModel.cc,v 1.12 2008/10/15 15:54:57 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4BetheHeitlerModel.cc,v 1.13 2009/04/09 18:41:18 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    9494                                     const G4DataVector&)
    9595{
    96   if(!fParticleChange) {
    97     if(pParticleChange) {
    98       fParticleChange = reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange);
    99     } else {
    100       fParticleChange = new G4ParticleChangeForGamma();
    101     }
    102   }
     96  if(!fParticleChange) fParticleChange = GetParticleChangeForGamma();
    10397
    10498  if(theCrossSectionTable) {
  • trunk/source/processes/electromagnetic/standard/src/G4BohrFluctuations.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4BohrFluctuations.cc,v 1.6 2007/09/27 14:02:41 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4BohrFluctuations.cc,v 1.7 2009/02/19 19:17:50 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    137137//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    138138
     139G4double G4BohrFluctuations::Dispersion(const G4Material* material,
     140                                        const G4DynamicParticle* dp,
     141                                        G4double& tmax,
     142                                        G4double& length)
     143{
     144  if(!particle) InitialiseMe(dp->GetDefinition());
    139145
     146  G4double electronDensity = material->GetElectronDensity();
     147  kineticEnergy = dp->GetKineticEnergy();
     148  G4double etot = kineticEnergy + particleMass;
     149  beta2 = kineticEnergy*(kineticEnergy + 2.0*particleMass)/(etot*etot);
     150  G4double siga  = (1.0/beta2 - 0.5) * twopi_mc2_rcl2 * tmax * length
     151                 * electronDensity * chargeSquare;
     152
     153  return siga;
     154}
     155
     156//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     157
     158
  • trunk/source/processes/electromagnetic/standard/src/G4BraggIonModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4BraggIonModel.cc,v 1.22 2008/10/22 16:00:57 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4BraggIonModel.cc,v 1.24 2009/04/09 18:41:18 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    114114  corrFactor = chargeSquare;
    115115
     116  // always false before the run
     117  SetDeexcitationFlag(false);
     118
    116119  if(!isInitialised) {
    117120    isInitialised = true;
     
    123126    corr = G4LossTableManager::Instance()->EmCorrections();
    124127
    125     if(!fParticleChange) {
    126       if(pParticleChange) {
    127         fParticleChange =
    128           reinterpret_cast<G4ParticleChangeForLoss*>(pParticleChange);
    129       } else {
    130         fParticleChange = new G4ParticleChangeForLoss();
    131       }
    132     }
     128    fParticleChange = GetParticleChangeForLoss();
    133129  }
    134130}
     
    352348  fParticleChange->SetProposedKineticEnergy(kineticEnergy);
    353349  fParticleChange->SetProposedMomentumDirection(finalP);
     350}
     351
     352//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     353
     354G4double G4BraggIonModel::MaxSecondaryEnergy(const G4ParticleDefinition* pd,
     355                                             G4double kinEnergy)
     356{
     357  if(pd != particle) SetParticle(pd);
     358  G4double tau  = kinEnergy/mass;
     359  G4double tmax = 2.0*electron_mass_c2*tau*(tau + 2.) /
     360                  (1. + 2.0*(tau + 1.)*ratio + ratio*ratio);
     361  return tmax;
    354362}
    355363
  • trunk/source/processes/electromagnetic/standard/src/G4BraggModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4BraggModel.cc,v 1.20 2008/10/22 16:01:46 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4BraggModel.cc,v 1.22 2009/04/09 18:41:18 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    112112  if(p != particle) SetParticle(p);
    113113
     114  // always false before the run
     115  SetDeexcitationFlag(false);
     116
    114117  if(!isInitialised) {
    115118    isInitialised = true;
     
    121124    corr = G4LossTableManager::Instance()->EmCorrections();
    122125
    123     if(pParticleChange) {
    124       fParticleChange =
    125         reinterpret_cast<G4ParticleChangeForLoss*>(pParticleChange);
    126     } else {
    127       fParticleChange = new G4ParticleChangeForLoss();
    128     }
     126    fParticleChange = GetParticleChangeForLoss();
    129127  }
    130128}
     
    337335
    338336  vdp->push_back(delta);
     337}
     338
     339//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     340
     341G4double G4BraggModel::MaxSecondaryEnergy(const G4ParticleDefinition* pd,
     342                                          G4double kinEnergy)
     343{
     344  if(pd != particle) SetParticle(pd);
     345  G4double tau  = kinEnergy/mass;
     346  G4double tmax = 2.0*electron_mass_c2*tau*(tau + 2.) /
     347                  (1. + 2.0*(tau + 1.)*ratio + ratio*ratio);
     348  return tmax;
    339349}
    340350
  • trunk/source/processes/electromagnetic/standard/src/G4ComptonScattering.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4ComptonScattering.cc,v 1.30 2008/10/15 17:53:44 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4ComptonScattering.cc,v 1.31 2009/02/20 12:06:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929//
     
    8484//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    8585
     86G4bool G4ComptonScattering::IsApplicable(const G4ParticleDefinition& p)
     87{
     88  return (&p == G4Gamma::Gamma());
     89}
     90
     91//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     92
    8693void G4ComptonScattering::InitialiseProcess(const G4ParticleDefinition*)
    8794{
  • trunk/source/processes/electromagnetic/standard/src/G4CoulombScattering.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4CoulombScattering.cc,v 1.19 2008/10/15 17:53:44 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4CoulombScattering.cc,v 1.20 2009/02/20 12:06:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    7979G4CoulombScattering::~G4CoulombScattering()
    8080{}
     81
     82//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     83
     84G4bool G4CoulombScattering::IsApplicable(const G4ParticleDefinition& p)
     85{
     86  return (p.GetPDGCharge() != 0.0 && !p.IsShortLived());
     87}
    8188
    8289//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
  • trunk/source/processes/electromagnetic/standard/src/G4CoulombScatteringModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4CoulombScatteringModel.cc,v 1.37 2008/07/31 13:11:34 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4CoulombScatteringModel.cc,v 1.39 2009/05/10 16:09:29 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    9393
    9494  // CM system
    95   G4int iz      = G4int(Z);
     95  iz            = G4int(Z);
    9696  G4double m2   = fNistManager->GetAtomicMassAmu(iz)*amu_c2;
    9797  G4double etot = tkin + mass;
     
    137137
    138138  G4double Z  = currentElement->GetZ();
    139   G4int iz    = G4int(Z);
     139  iz          = G4int(Z);
    140140  G4int ia    = SelectIsotopeNumber(currentElement);
    141141  G4double m2 = theParticleTable->GetIonTable()->GetNucleusMass(iz, ia);
     
    182182  // recoil
    183183  G4double erec = kinEnergy - ekin;
    184   G4double th =
    185     std::min(recoilThreshold,
    186              Z*currentElement->GetIonisation()->GetMeanExcitationEnergy());
    187184
    188   if(erec > th) {
     185  if(erec > recoilThreshold) {
    189186    G4ParticleDefinition* ion = theParticleTable->FindIon(iz, ia, 0, iz);
    190187    G4double plab = sqrt(ekin*(ekin + 2.0*mass));
  • trunk/source/processes/electromagnetic/standard/src/G4GammaConversion.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4GammaConversion.cc,v 1.30 2008/10/15 17:53:44 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4GammaConversion.cc,v 1.31 2009/02/20 12:06:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929//
     
    9090//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    9191
     92G4bool G4GammaConversion::IsApplicable(const G4ParticleDefinition& p)
     93{
     94  return (&p == G4Gamma::Gamma());
     95}
     96
     97//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     98
    9299void G4GammaConversion::InitialiseProcess(const G4ParticleDefinition*)
    93100{
  • trunk/source/processes/electromagnetic/standard/src/G4IonFluctuations.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4IonFluctuations.cc,v 1.24 2008/10/22 16:25:21 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4IonFluctuations.cc,v 1.26 2009/03/31 13:24:40 toshito Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    190190
    191191  // heavy ion correction
    192   G4double f1 = 1.065e-4*chargeSquare;
    193   if(beta2 > theBohrBeta2)  f1/= beta2;
    194   else                      f1/= theBohrBeta2;
    195   if(f1 > 2.5) f1 = 2.5;
    196   fac *= (1.0 + f1);
     192//  G4double f1 = 1.065e-4*chargeSquare;
     193//  if(beta2 > theBohrBeta2)  f1/= beta2;
     194//  else                      f1/= theBohrBeta2;
     195//  if(f1 > 2.5) f1 = 2.5;
     196//  fac *= (1.0 + f1);
    197197
    198198  // taking into account the cut
    199   if(fac > 1.0) {
    200     siga *= (1.0 + (fac - 1.0)*2.0*electron_mass_c2*beta2/(tmax*(1.0 - beta2)));
    201   }
     199  G4double fac_cut = 1.0 + (fac - 1.0)*2.0*electron_mass_c2*beta2/(tmax*(1.0 - beta2));
     200  if(fac_cut > 0.01 && fac > 0.01) {
     201    siga *= fac_cut;
     202  }
     203
    202204  //G4cout << "siga(keV)= " << sqrt(siga)/keV << " fac= " << fac
    203205  //     << "  f1= " << f1 << G4endl;
     
    420422
    421423//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     424
     425void G4IonFluctuations::SetParticleAndCharge(const G4ParticleDefinition* part,
     426                                             G4double q2)
     427{
     428  if(part != particle) {
     429    particle       = part;
     430    particleMass   = part->GetPDGMass();
     431    charge         = part->GetPDGCharge()/eplus;
     432    chargeSquare   = charge*charge;
     433  }
     434  effChargeSquare  = q2;
     435  uniFluct.SetParticleAndCharge(part, q2);
     436}
     437
     438//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
  • trunk/source/processes/electromagnetic/standard/src/G4KleinNishinaCompton.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4KleinNishinaCompton.cc,v 1.9 2007/05/22 17:34:36 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4KleinNishinaCompton.cc,v 1.10 2009/05/15 17:12:33 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    7979                                       const G4DataVector&)
    8080{
    81   if(pParticleChange)
    82     fParticleChange = reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange);
    83   else
    84     fParticleChange = new G4ParticleChangeForGamma();
     81  fParticleChange = GetParticleChangeForGamma();
    8582}
    8683
  • trunk/source/processes/electromagnetic/standard/src/G4MollerBhabhaModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4MollerBhabhaModel.cc,v 1.30 2007/05/22 17:34:36 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4MollerBhabhaModel.cc,v 1.34 2009/04/24 17:15:46 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    7474                                         const G4String& nam)
    7575  : G4VEmModel(nam),
    76   particle(0),
    77   isElectron(true),
    78   twoln10(2.0*log(10.0)),
    79   lowLimit(0.2*keV)
     76    particle(0),
     77    isElectron(true),
     78    twoln10(2.0*log(10.0)),
     79    lowLimit(0.2*keV),
     80    isInitialised(false)
    8081{
    8182  theElectron = G4Electron::Electron();
     
    8788G4MollerBhabhaModel::~G4MollerBhabhaModel()
    8889{}
    89 
    90 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    91 
    92 void G4MollerBhabhaModel::SetParticle(const G4ParticleDefinition* p)
    93 {
    94   particle = p;
    95   if(p != theElectron) isElectron = false;
    96 }
    9790
    9891//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    108101//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    109102
     103G4double G4MollerBhabhaModel::MaxSecondaryEnergy(const G4ParticleDefinition*,
     104                                                 G4double kinEnergy)
     105{
     106  G4double tmax = kinEnergy;
     107  if(isElectron) tmax *= 0.5;
     108  return tmax;
     109}
     110
     111//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     112
    110113void G4MollerBhabhaModel::Initialise(const G4ParticleDefinition* p,
    111114                                     const G4DataVector&)
    112115{
    113116  if(!particle) SetParticle(p);
    114   if(pParticleChange)
    115     fParticleChange = reinterpret_cast<G4ParticleChangeForLoss*>
    116                                                      (pParticleChange);
    117   else
    118     fParticleChange = new G4ParticleChangeForLoss();
     117  SetDeexcitationFlag(false);
     118
     119  if(isInitialised) return;
     120
     121  isInitialised = true;
     122  fParticleChange = GetParticleChangeForLoss();
    119123}
    120124
     
    289293                                            G4double maxEnergy)
    290294{
    291   G4double tmax = std::min(maxEnergy, MaxSecondaryKinEnergy(dp));
     295  G4double kineticEnergy = dp->GetKineticEnergy();
     296  G4double tmax = kineticEnergy;
     297  if(isElectron) tmax *= 0.5;
     298  if(maxEnergy < tmax) tmax = maxEnergy;
    292299  if(tmin >= tmax) return;
    293300
    294   G4double kineticEnergy = dp->GetKineticEnergy();
    295301  G4double energy = kineticEnergy + electron_mass_c2;
    296302  G4double totalMomentum = sqrt(kineticEnergy*(energy + electron_mass_c2));
     
    339345    G4double b3  = b4 + y122;
    340346
    341     y     = xmax*xmax;
    342     grej  = -xmin*b1;
    343     grej += y*b2;
    344     grej -= xmin*xmin*xmin*b3;
    345     grej += y*y*b4;
    346     grej *= beta2;
    347     grej += 1.0;
     347    y    = xmax*xmax;
     348    grej = 1.0 + (y*y*b4 - xmin*xmin*xmin*b3 + y*b2 - xmin*b1)*beta2;
    348349    do {
    349       q  = G4UniformRand();
    350       x  = xmin*xmax/(xmin*(1.0 - q) + xmax*q);
    351       z  = -x*b1;
    352       y  = x*x;
    353       z += y*b2;
    354       y *= x;
    355       z -= y*b3;
    356       y *= x;
    357       z += y*b4;
    358       z *= beta2;
    359       z += 1.0;
     350      q = G4UniformRand();
     351      x = xmin*xmax/(xmin*(1.0 - q) + xmax*q);
     352      y = x*x;
     353      z = 1.0 + (y*y*b4 - x*y*b3 + y*b2 - x*b1)*beta2;
    360354      /*
    361355      if(z > grej) {
     
    396390  // create G4DynamicParticle object for delta ray
    397391  G4DynamicParticle* delta = new G4DynamicParticle(theElectron,
    398                                                  deltaDirection,deltaKinEnergy);
     392                                                   deltaDirection,deltaKinEnergy);
    399393  vdp->push_back(delta);
    400394}
  • trunk/source/processes/electromagnetic/standard/src/G4MscModel71.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4MscModel71.cc,v 1.6 2008/03/13 17:20:07 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4MscModel71.cc,v 1.7 2009/04/09 18:41:18 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    140140
    141141  if(pParticleChange)
    142     fParticleChange = reinterpret_cast<G4ParticleChangeForMSC*>(pParticleChange);
     142    fParticleChange = static_cast<G4ParticleChangeForMSC*>(pParticleChange);
    143143  else
    144144    fParticleChange = new G4ParticleChangeForMSC();
  • trunk/source/processes/electromagnetic/standard/src/G4PAIModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
     26// $Id: G4PAIModel.cc,v 1.47 2009/04/09 18:41:18 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     28//
     29// -------------------------------------------------------------------
     30//
     31// GEANT4 Class
    2632// File name:     G4PAIModel.cc
    2733//
     
    153159                                                 fTotBin);
    154160
    155   if(pParticleChange)
    156     fParticleChange = reinterpret_cast<G4ParticleChangeForLoss*>(pParticleChange);
    157   else
    158     fParticleChange = new G4ParticleChangeForLoss();
     161  fParticleChange = GetParticleChangeForLoss();
    159162
    160163  // Prepare initialization
     
    177180      fCutCouple = theCoupleTable->GetMaterialCutsCouple( fMaterial,
    178181                                          curReg->GetProductionCuts() );
     182      //G4cout << "Reg <" <<curReg->GetName() << ">  mat <"
     183      //             << fMaterial->GetName() << ">  fCouple= "
     184      //             << fCutCouple<<G4endl;
    179185      if( fCutCouple ) {
    180186        fMaterialCutsCoupleVector.push_back(fCutCouple);
     
    197203  }
    198204}
     205
     206//////////////////////////////////////////////////////////////////
     207
     208void G4PAIModel::InitialiseMe(const G4ParticleDefinition*)
     209{}
    199210
    200211//////////////////////////////////////////////////////////////////
     
    393404  {
    394405    //  if ( x1 == x2  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
    395     if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
     406    //    if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
     407    if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*0.5 ;
    396408    else             dNdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ;     
    397409  }
     
    435447  {
    436448    //  if ( x1 == x2  ) dEdxCut = y1 + (y2 - y1)*G4UniformRand() ;
    437     if ( std::abs(x1-x2) <= eV  ) dEdxCut = y1 + (y2 - y1)*G4UniformRand() ;
     449    //    if ( std::abs(x1-x2) <= eV  ) dEdxCut = y1 + (y2 - y1)*G4UniformRand() ;
     450    if ( std::abs(x1-x2) <= eV  ) dEdxCut = y1 + (y2 - y1)*0.5 ;
    438451    else             dEdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ;     
    439452  }
     
    444457//////////////////////////////////////////////////////////////////////////////
    445458
    446 G4double G4PAIModel::ComputeDEDX(const G4MaterialCutsCouple* matCC,
    447                                  const G4ParticleDefinition* p,
    448                                        G4double kineticEnergy,
    449                                        G4double cutEnergy)
     459G4double G4PAIModel::ComputeDEDXPerVolume(const G4Material*,
     460                                          const G4ParticleDefinition* p,
     461                                          G4double kineticEnergy,
     462                                          G4double cutEnergy)
    450463{
    451464  G4int iTkin,iPlace;
    452465  size_t jMat;
     466 
     467  //G4double cut = std::min(MaxSecondaryEnergy(p, kineticEnergy), cutEnergy);
     468  G4double cut = cutEnergy;
     469
    453470  G4double massRatio  = fMass/p->GetPDGMass();
    454471  G4double scaledTkin = kineticEnergy*massRatio;
    455472  G4double charge     = p->GetPDGCharge();
    456   G4double charge2    = charge*charge, dEdx;
     473  G4double charge2    = charge*charge;
     474  const G4MaterialCutsCouple* matCC = CurrentCouple();
    457475
    458476  for( jMat = 0 ;jMat < fMaterialCutsCoupleVector.size() ; ++jMat )
     
    470488  iPlace = iTkin - 1;
    471489  if(iPlace < 0) iPlace = 0;
    472   dEdx = charge2*( (*fdEdxVector)(iPlace) - GetdEdxCut(iPlace,cutEnergy) ) ; 
    473 
     490  G4double dEdx = charge2*( (*fdEdxVector)(iPlace) - GetdEdxCut(iPlace,cut) );
    474491  if( dEdx < 0.) dEdx = 0.;
    475492  return dEdx;
     
    478495/////////////////////////////////////////////////////////////////////////
    479496
    480 G4double G4PAIModel::CrossSection( const G4MaterialCutsCouple* matCC,
    481                                    const G4ParticleDefinition* p,
    482                                          G4double kineticEnergy,
    483                                          G4double cutEnergy,
    484                                          G4double maxEnergy  )
     497G4double G4PAIModel::CrossSectionPerVolume( const G4Material*,
     498                                            const G4ParticleDefinition* p,
     499                                            G4double kineticEnergy,
     500                                            G4double cutEnergy,
     501                                            G4double maxEnergy  )
    485502{
    486503  G4int iTkin,iPlace;
    487504  size_t jMat;
    488   G4double tmax = min(MaxSecondaryEnergy(p, kineticEnergy), maxEnergy);
     505  G4double tmax = std::min(MaxSecondaryEnergy(p, kineticEnergy), maxEnergy);
     506  if(tmax <= cutEnergy) return 0.0;
    489507  G4double massRatio  = fMass/p->GetPDGMass();
    490508  G4double scaledTkin = kineticEnergy*massRatio;
    491509  G4double charge     = p->GetPDGCharge();
    492510  G4double charge2    = charge*charge, cross, cross1, cross2;
     511  const G4MaterialCutsCouple* matCC = CurrentCouple();
    493512
    494513  for( jMat = 0 ;jMat < fMaterialCutsCoupleVector.size() ; ++jMat )
     
    935954}
    936955
     956/////////////////////////////////////////////////////////////////////
     957
     958G4double G4PAIModel::MaxSecondaryEnergy( const G4ParticleDefinition* p,
     959                                         G4double kinEnergy)
     960{
     961  G4double tmax = kinEnergy;
     962  if(p == fElectron) tmax *= 0.5;
     963  else if(p != fPositron) {
     964    G4double mass = p->GetPDGMass();
     965    G4double ratio= electron_mass_c2/mass;
     966    G4double gamma= kinEnergy/mass + 1.0;
     967    tmax = 2.0*electron_mass_c2*(gamma*gamma - 1.) /
     968                  (1. + 2.0*gamma*ratio + ratio*ratio);
     969  }
     970  return tmax;
     971}
     972
     973///////////////////////////////////////////////////////////////
     974
     975void G4PAIModel::DefineForRegion(const G4Region* r)
     976{
     977  fPAIRegionVector.push_back(r);
     978}
    937979
    938980//
  • trunk/source/processes/electromagnetic/standard/src/G4PAIPhotonModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
     26// $Id: G4PAIPhotonModel.cc,v 1.22 2009/04/09 18:41:18 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     28//
     29// -------------------------------------------------------------------
     30//
     31// GEANT4 Class
    2632// File name:     G4PAIPhotonModel.cc
    2733//
     
    160166  if(!fParticle) SetParticle(p);
    161167
    162   if(pParticleChange)
    163     fParticleChange = reinterpret_cast<G4ParticleChangeForLoss*>(pParticleChange);
    164   else
    165     fParticleChange = new G4ParticleChangeForLoss();
     168  fParticleChange = GetParticleChangeForLoss();
    166169
    167170  const G4ProductionCutsTable* theCoupleTable =
     
    214217  }
    215218}
     219
     220//////////////////////////////////////////////////////////////////
     221
     222void G4PAIPhotonModel::InitialiseMe(const G4ParticleDefinition*)
     223{}
    216224
    217225//////////////////////////////////////////////////////////////////
     
    487495  {
    488496    //  if ( x1 == x2  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
    489     if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
     497    //    if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
     498    if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*0.5 ;
    490499    else             dNdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ;     
    491500  }
     
    530539  {
    531540    //  if ( x1 == x2  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
    532     if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
     541    //    if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
     542    if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*0.5 ;
    533543    else             dNdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ;     
    534544  }
     
    574584  {
    575585    //  if ( x1 == x2  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
    576     if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
     586    //    if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
     587    if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*0.5 ;
    577588    else             dNdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ;     
    578589  }
     
    617628  {
    618629    //  if ( x1 == x2  ) dEdxCut = y1 + (y2 - y1)*G4UniformRand() ;
    619     if ( std::abs(x1-x2) <= eV  ) dEdxCut = y1 + (y2 - y1)*G4UniformRand() ;
     630    //    if ( std::abs(x1-x2) <= eV  ) dEdxCut = y1 + (y2 - y1)*G4UniformRand() ;
     631    if ( std::abs(x1-x2) <= eV  ) dEdxCut = y1 + (y2 - y1)*0.5 ;
    620632    else             dEdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ;     
    621633  }
     
    626638//////////////////////////////////////////////////////////////////////////////
    627639
    628 G4double G4PAIPhotonModel::ComputeDEDX(const G4MaterialCutsCouple* matCC,
    629                                  const G4ParticleDefinition* p,
    630                                        G4double kineticEnergy,
    631                                        G4double cutEnergy)
     640G4double G4PAIPhotonModel::ComputeDEDXPerVolume(const G4Material*,
     641                                                const G4ParticleDefinition* p,
     642                                                G4double kineticEnergy,
     643                                                G4double cutEnergy)
    632644{
    633645  G4int iTkin,iPlace;
    634646  size_t jMat;
     647
     648  //G4double cut = std::min(MaxSecondaryEnergy(p, kineticEnergy), cutEnergy);
     649  G4double cut = cutEnergy;
     650
    635651  G4double particleMass = p->GetPDGMass();
    636652  G4double scaledTkin   = kineticEnergy*proton_mass_c2/particleMass;
     
    638654  G4double charge2      = charge*charge;
    639655  G4double dEdx         = 0.;
     656  const G4MaterialCutsCouple* matCC = CurrentCouple();
    640657
    641658  for( jMat = 0 ;jMat < fMaterialCutsCoupleVector.size() ; ++jMat )
     
    653670  iPlace = iTkin - 1;
    654671  if(iPlace < 0) iPlace = 0;
    655   dEdx = charge2*( (*fdEdxVector)(iPlace) - GetdEdxCut(iPlace,cutEnergy) ) ; 
     672  dEdx = charge2*( (*fdEdxVector)(iPlace) - GetdEdxCut(iPlace,cut) ) ; 
    656673
    657674  if( dEdx < 0.) dEdx = 0.;
     
    661678/////////////////////////////////////////////////////////////////////////
    662679
    663 G4double G4PAIPhotonModel::CrossSection( const G4MaterialCutsCouple* matCC,
    664                                    const G4ParticleDefinition* p,
    665                                          G4double kineticEnergy,
    666                                          G4double cutEnergy,
    667                                          G4double maxEnergy  )
     680G4double G4PAIPhotonModel::CrossSectionPerVolume( const G4Material*,
     681                                                  const G4ParticleDefinition* p,
     682                                                  G4double kineticEnergy,
     683                                                  G4double cutEnergy,
     684                                                  G4double maxEnergy  )
    668685{
    669686  G4int iTkin,iPlace;
    670687  size_t jMat, jMatCC;
    671   G4double tmax = min(MaxSecondaryEnergy(p, kineticEnergy), maxEnergy);
     688  G4double tmax = std::min(MaxSecondaryEnergy(p, kineticEnergy), maxEnergy);
     689  if(cutEnergy >= tmax) return 0.0;
    672690  G4double particleMass = p->GetPDGMass();
    673691  G4double scaledTkin   = kineticEnergy*proton_mass_c2/particleMass;
     
    675693  G4double charge2      = charge*charge, cross, cross1, cross2;
    676694  G4double photon1, photon2, plasmon1, plasmon2;
     695
     696  const G4MaterialCutsCouple* matCC = CurrentCouple();
    677697
    678698  const G4ProductionCutsTable* theCoupleTable=
     
    12251245}
    12261246
     1247/////////////////////////////////////////////////////////////////////
     1248
     1249G4double G4PAIPhotonModel::MaxSecondaryEnergy( const G4ParticleDefinition* p,
     1250                                                      G4double kinEnergy)
     1251{
     1252  G4double tmax = kinEnergy;
     1253  if(p == fElectron) tmax *= 0.5;
     1254  else if(p != fPositron) {
     1255    G4double mass = p->GetPDGMass();
     1256    G4double ratio= electron_mass_c2/mass;
     1257    G4double gamma= kinEnergy/mass + 1.0;
     1258    tmax = 2.0*electron_mass_c2*(gamma*gamma - 1.) /
     1259                  (1. + 2.0*gamma*ratio + ratio*ratio);
     1260  }
     1261  return tmax;
     1262}
     1263
     1264///////////////////////////////////////////////////////////////
     1265
     1266void G4PAIPhotonModel::DefineForRegion(const G4Region* r)
     1267{
     1268  fPAIRegionVector.push_back(r);
     1269}
     1270
    12271271
    12281272//
  • trunk/source/processes/electromagnetic/standard/src/G4PEEffectModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PEEffectModel.cc,v 1.6 2007/05/22 17:34:36 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4PEEffectModel.cc,v 1.8 2009/04/09 18:41:18 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    4141//
    4242// 04.12.05 : SetProposedKineticEnergy(0.) for the killed photon (mma)
     43// 20.02.09 : Added initialisation of deexcitation flag and method
     44//            CrossSectionPerVolume instead of mfp (V.Ivanchenko)
    4345//
    4446// Class Description:
     
    6668  theGamma    = G4Gamma::Gamma();
    6769  theElectron = G4Electron::Electron();
     70  fminimalEnergy = 1.0*eV;
    6871}
    6972
     
    7174
    7275G4PEEffectModel::~G4PEEffectModel()
    73 {
    74 }
     76{}
    7577
    7678//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    7981                                 const G4DataVector&)
    8082{
    81  if (isInitialized) return;
    82  if (pParticleChange)
    83    fParticleChange =
    84                   reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange);
    85   else
    86    fParticleChange = new G4ParticleChangeForGamma();
    87 
    88  fminimalEnergy = 1.0*eV;
     83  // always false before the run
     84  SetDeexcitationFlag(false);
     85
     86  if (isInitialized) return;
     87  fParticleChange = GetParticleChangeForGamma();
     88  isInitialized = true;
     89}
     90
     91//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
     92
     93G4double G4PEEffectModel::ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
     94                                                     G4double energy,
     95                                                     G4double Z, G4double,
     96                                                     G4double, G4double)
     97{
     98  G4double* SandiaCof = G4SandiaTable::GetSandiaCofPerAtom((G4int)Z, energy);
     99
     100  G4double energy2 = energy*energy;
     101  G4double energy3 = energy*energy2;
     102  G4double energy4 = energy2*energy2;
     103
     104  return SandiaCof[0]/energy  + SandiaCof[1]/energy2 +
     105    SandiaCof[2]/energy3 + SandiaCof[3]/energy4;
     106}
     107
     108//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     109
     110G4double G4PEEffectModel::CrossSectionPerVolume(const G4Material* material,
     111                                                const G4ParticleDefinition*,
     112                                                G4double energy,
     113                                                G4double, G4double)
     114{
     115  G4double* SandiaCof =
     116    material->GetSandiaTable()->GetSandiaCofForMaterial(energy);
     117                               
     118  G4double energy2 = energy*energy;
     119  G4double energy3 = energy*energy2;
     120  G4double energy4 = energy2*energy2;
     121         
     122  return SandiaCof[0]/energy  + SandiaCof[1]/energy2 +
     123    SandiaCof[2]/energy3 + SandiaCof[3]/energy4;
    89124}
    90125
  • trunk/source/processes/electromagnetic/standard/src/G4PhotoElectricEffect.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PhotoElectricEffect.cc,v 1.41 2008/10/16 14:12:32 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4PhotoElectricEffect.cc,v 1.42 2009/02/20 12:06:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929//
     
    8989{}
    9090
     91//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     92
     93G4bool G4PhotoElectricEffect::IsApplicable(const G4ParticleDefinition& p)
     94{
     95  return (&p == G4Gamma::Gamma());
     96}
     97
    9198//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    9299
  • trunk/source/processes/electromagnetic/standard/src/G4UniversalFluctuation.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4UniversalFluctuation.cc,v 1.16 2008/10/22 16:04:33 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4UniversalFluctuation.cc,v 1.22 2009/03/20 18:11:23 urban Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    5757// 03-04-07 correction to get better width of eloss distr.(L.Urban)
    5858// 13-07-07 add protection for very small step or low-density material (VI)
    59 //         
     59// 19-03-09 new width correction (does not depend on previous steps) (L.Urban)         
     60// 20-03-09 modification in the width correction (L.Urban)
     61//
    6062
    6163//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    8486{
    8587  lastMaterial = 0;
    86   facwidth     = 1.000/keV;
    87   oldloss = 0.;
    88   samestep = 0.;
    8988}
    9089
     
    120119  //
    121120  if (meanLoss < minLoss)
    122   {
    123     oldloss = meanLoss;
    124121    return meanLoss;
    125   }
    126122
    127123  if(!particle) InitialiseMe(dp->GetDefinition());
     
    179175    e0 = material->GetIonisation()->GetEnergy0fluct();
    180176    lastMaterial = material;
     177 
     178    // modification of some model parameters
     179    // (this part should go to materials later)
     180    G4double p = 1.40;
     181    f2Fluct *= p;
     182    f1Fluct = 1.-f2Fluct;
     183    G4double q = 1.00;
     184    e2Fluct *= q;
     185    e2LogFluct = log(e2Fluct);
     186    e1LogFluct = (ipotLogFluct-f2Fluct*e2LogFluct)/f1Fluct;
     187    e1Fluct = exp(e1LogFluct);
    181188  }
    182189
     
    185192
    186193  G4double a1 = 0. , a2 = 0., a3 = 0. ;
    187 
    188   // correction to get better width even using stepmax
    189   if(abs(meanLoss- oldloss) < 1.*eV)
    190     samestep += 1;
    191   else
    192     samestep = 1.;
    193   oldloss = meanLoss;
    194   G4double width = 1.+samestep*facwidth*meanLoss;
    195   if(width > 4.50) width = 4.50;
    196   e1 = width*e1Fluct;
    197   e2 = width*e2Fluct;
    198194
    199195  // cut and material dependent rate
     
    206202      rate = 0.03+0.23*log(log(tmax/ipotFluct));
    207203      G4double C = meanLoss*(1.-rate)/(w2-ipotLogFluct);
    208       a1 = C*f1Fluct*(w2-e1LogFluct)/e1;
    209       a2 = C*f2Fluct*(w2-e2LogFluct)/e2;
     204      a1 = C*f1Fluct*(w2-e1LogFluct)/e1Fluct;
     205      a2 = C*f2Fluct*(w2-e2LogFluct)/e2Fluct;
     206      // correction in order to get better FWHM values
     207      // ( scale parameters a1 and e1)
     208      G4double width = 1.;
     209      if(meanLoss > 10.*e1Fluct)
     210      {
     211        width = 3.1623/sqrt(meanLoss/e1Fluct);
     212        if(width < a2/a1)
     213        width = a2/a1;
     214      }
     215      a1 *= width;
     216      e1 = e1Fluct/width;
     217      e2 = e2Fluct;
    210218    }
    211219  }
     
    305313}
    306314
    307 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     315//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     316
     317void
     318G4UniversalFluctuation::SetParticleAndCharge(const G4ParticleDefinition* part,
     319                                             G4double q2)
     320{
     321  if(part != particle) {
     322    particle       = part;
     323    particleMass   = part->GetPDGMass();
     324  }
     325  chargeSquare = q2;
     326}
     327
     328//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
  • trunk/source/processes/electromagnetic/standard/src/G4UrbanMscModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4UrbanMscModel.cc,v 1.86 2008/10/29 14:15:30 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26//
     27// $Id: G4UrbanMscModel.cc,v 1.90 2009/04/29 13:30:22 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2829//
    2930// -------------------------------------------------------------------
     
    3637// Author:      Laszlo Urban
    3738//
    38 // Creation date: 03.03.2001
     39// Creation date: 06.03.2008
    3940//
    4041// Modifications:
    4142//
    42 // 27-03-03 Move model part from G4MultipleScattering80 (V.Ivanchenko)
    43 // 23-05-03 important change in angle distribution for muons/hadrons
    44 //          the central part now is similar to the Highland parametrization +
    45 //          minor correction in angle sampling algorithm (for all particles)
    46 //          (L.Urban)
    47 // 30-05-03 misprint in SampleCosineTheta corrected(L.Urban)
    48 // 27-03-03 Rename (V.Ivanchenko)
    49 // 05-08-03 angle distribution has been modified (L.Urban)
    50 // 06-11-03 precision problems solved for high energy (PeV) particles
    51 //          change in the tail of the angular distribution
    52 //          highKinEnergy is set to 100 PeV (L.Urban)
    53 //
    54 // 10-11-03 highKinEnergy is set back to 100 TeV, some tail tuning +
    55 //          cleaning (L.Urban)
    56 // 26-11-03 correction in TrueStepLength :
    57 //          trueLength <= currentRange (L.Urban)
    58 // 01-03-04 signature changed in SampleCosineTheta,
    59 //          energy dependence calculations has been simplified,
    60 // 11-03-04 corrections in GeomPathLength,TrueStepLength,
    61 //          SampleCosineTheta
    62 // 23-04-04 true -> geom and geom -> true transformation has been
    63 //          rewritten, changes in the angular distribution (L.Urban)
    64 // 19-07-04 correction in SampleCosineTheta in order to avoid
    65 //          num. precision problems at high energy/small step(L.Urban)
    66 // 17-08-04 changes in the angle distribution (slightly modified
    67 //          Highland formula for the width of the central part,
    68 //          changes in the numerical values of some other parameters)
    69 //          ---> approximately step independent distribution (L.Urban)
    70 // 21-09-04 change in the tail of the angular distribution (L.Urban)
    71 //
    72 // 03-11-04 precision problem for very high energy ions and small stepsize
    73 //          solved in SampleCosineTheta (L.Urban).
    74 // 15-04-05 optimize internal interface
    75 //          add SampleSecondaries method (V.Ivanchenko)
    76 // 11-08-05 computation of lateral correlation added (L.Urban)
    77 // 02-10-05 nuclear size correction computation removed, the correction
    78 //          included in the (theoretical) tabulated values (L.Urban)
    79 // 17-01-06 computation of tail changed in SampleCosineTheta (l.Urban)
    80 // 16-02-06 code cleaning + revised 'z' sampling (L.Urban)
    81 // 17-02-06 Save table of transport cross sections not mfp (V.Ivanchenko)
    82 // 07-03-06 Create G4UrbanMscModel and move there step limit
    83 //           calculation (V.Ivanchenko)
    84 // 23-03-06 Bugfix in SampleCosineTheta method (L.Urban)
    85 // 10-05-06 SetMscStepLimitation at initialisation (V.Ivantchenko)
    86 // 11-05-06 name of data member safety changed to presafety, some new data
    87 //          members added (frscaling1,frscaling2,tlimitminfix,nstepmax)
    88 //          changes in ComputeTruePathLengthLimit,SampleCosineTheta (L.Urban)
    89 // 17-05-06 parameters of theta0 in SampleCosineTheta changed
    90 //          c_highland  13.6*MeV ---> 13.26*MeV,
    91 //          corr_highland  0.555 ---> 0.54,
    92 //          value of data member geommin changed (5 nm -> 1 nm) (L.Urban)
    93 // 13-10-06 data member factail removed, data member tkinlimit changed
    94 //          to lambdalimit,
    95 //          new data members tgeom,tnow,skin,skindepth,Zeff,geomlimit
    96 //          G4double GeomLimit(const G4Track& track) changed to
    97 //              void GeomLimit(const G4Track& track)
    98 //        - important changes in ComputeTruePathLengthLimit:
    99 //          possibility to have very small step(s) with single scattering
    100 //          before boundary crossing (with skin > 0)
    101 //        - changes in SampleCosineTheta :
    102 //          single scattering if step <= stepmin, parameter theta0
    103 //          slightly modified, tail modified (L.Urban)
    104 // 20-10-06 parameter theta0 now computed in the (public)
    105 //          function ComputeTheta0,
    106 //          single scattering modified allowing not small
    107 //          angles as well (L.Urban)
    108 // 23-10-06 correction in SampleSecondaries, now safety update
    109 //          computed in a simpler/faster way (L.Urban)
    110 // 06-11-06 corrections in ComputeTruePathLengthLimit, results are
    111 //          more stable in calorimeters (L.Urban)
    112 // 07-11-06 fix in GeomPathLength and SampleCosineTheta (L.Urban)
    113 // 15-11-06 bugfix in SampleCosineTheta (L.Urban)
    114 // 20-11-06 bugfix in single scattering part of SampleCosineTheta,
    115 //          single scattering just before boundary crossing now (L.Urban)
    116 // 04-12-06 fix in ComputeTruePathLengthLimit (L.Urban)
    117 // 17-01-07 remove LocatePoint from GeomLimit method (V.Ivanchenko)
    118 // 19-01-07 fix of true < geom problem (L.Urban)
    119 // 25-01-07 add protections from NaN vaues and for zero geometry step (VI)
    120 // 31-01-07 correction in SampleCosineTheta: screening parameter
    121 //          corrected in single/plural scattering +
    122 //          code cleaning (L.Urban)
    123 // 01-02-07 restore logic inside ComputeTrueStepLength (V.Ivanchenko)
    124 // 06-02-07 Move SetMscStepLimitation method into the source, add there
    125 //          reinitialisation of some private members, add protection inside
    126 //          SampleDisplacement(VI)
    127 // 07-02-07 fix single scattering for heavy particles, now skin=1 can be used
    128 //          for heavy particles as well (L.Urban)
    129 // 08-02-07 randomization of tlimit removed (L.Urban)
    130 // 11-02-07 modified stepping algorithm for skin=0
    131 // 15-02-07 new data member: smallstep, small steps with single scattering
    132 //          before + after boundary for skin > 1
    133 // 23-02-07 use tPathLength inside ComputeStep instead of geombig
    134 // 24-02-07 step reduction before boundary for 'small' geomlimit only
    135 // 03-03-07 single scattering around boundaries only (L.Urban)
    136 // 07-03-07 bugfix in ComputeTruePathLengthLimit (for skin > 0.) (L.Urban)
    137 // 10-04-07 optimize logic of ComputeTruePathLengthLimit, remove
    138 //          unused members, use unique G4SafetyHelper (V.Ivanchenko)
    139 // 01-05-07 optimization for skin > 0 (L.Urban)
    140 // 05-07-07 modified model functions in SampleCosineTheta (L.Urban)
    141 // 06-07-07 theta0 is not the same for e-/e+ as for heavy particles (L.Urban)
    142 // 02-08-07 compare safety not with 0. but with tlimitminfix (V.Ivanchenko)
    143 // 09-08-07 tail of angular distribution has been modified (L.Urban)
    144 // 22-10-07 - corr. in ComputeGeomPathLength in order to get better low
    145 //          energy behaviour for heavy particles,
    146 //          - theta0 is slightly modified,
    147 //          - some old inconsistency/bug is cured in SampleCosineTheta,
    148 //          now 0 <= prob <= 1 in any case (L.Urban)
    149 // 26-10-07 different correction parameters for e/mu/hadrons in ComputeTheta0
    150 // 30-11-07 fix in ComputeTheta0 (L.Urban)
    151 //
     43// 06-03-2008 starting point : G4UrbanMscModel2 = G4UrbanMscModel 9.1 ref 02
     44//
     45// 13-03-08  Bug in SampleScattering (which caused lateral asymmetry) fixed
     46//           (L.Urban)
     47//
     48// 14-03-08  Simplification of step limitation in ComputeTruePathLengthLimit,
     49//           + tlimitmin is the same for UseDistancetoBoundary and
     50//           UseSafety (L.Urban)           
     51//
     52// 16-03-08  Reorganization of SampleCosineTheta + new method SimpleScattering
     53//           SimpleScattering is used if the relative energy loss is too big
     54//           or theta0 is too big (see data members rellossmax, theta0max)
     55//           (L.Urban)         
     56//
     57// 17-03-08  tuning of the correction factor in ComputeTheta0 (L.Urban)
     58//
     59// 19-03-08  exponent c of the 'tail' model function is not equal to 2 any more,
     60//           value of c has been extracted from some e- scattering data (L.Urban)
     61//
     62// 24-03-08  Step limitation in ComputeTruePathLengthLimit has been
     63//           simplified further + some data members have been removed (L.Urban)
     64//
     65// 24-07-08  central part of scattering angle (theta0) has been tuned
     66//           tail of the scattering angle distribution has been tuned
     67//           using some e- and proton scattering data
     68//
     69// 05-08-08  bugfix in ComputeTruePathLengthLimit (L.Urban)
     70//
     71// 09-10-08  theta0 and tail have been retuned using some e-,mu,proton
     72//           scattering data (L.Urban)
     73//           + single scattering without path length correction for
     74//           small steps (t < tlimitmin, for UseDistanceToBoundary only)
     75//
     76// 15-10-08  Moliere-Bethe screening in the single scattering part(L.Urban)         
     77//
     78// 17-10-08  stepping similar to that in model (9.1) for UseSafety case
     79//           for e+/e- in order to speed up the code for calorimeters
     80//
     81// 23-10-08  bugfix in the screeningparameter of the single scattering part,
     82//           some technical change in order to speed up the code (UpdateCache)
     83//
     84// 27-10-08  bugfix in ComputeTruePathLengthLimit (affects UseDistanceToBoundary
     85//           stepping type only) (L.Urban)         
     86//
     87// 28-04-09  move G4UrbanMscModel2 from the g49.2 to G4UrbanMscModel.
     88//           now it is frozen (V.Ivanchenk0)
    15289
    15390// Class Description:
     
    15794
    15895// -------------------------------------------------------------------
     96// In its present form the model can be  used for simulation
     97//   of the e-/e+, muon and charged hadron multiple scattering
    15998//
    16099
     
    166105#include "Randomize.hh"
    167106#include "G4Electron.hh"
    168 
    169107#include "G4LossTableManager.hh"
    170108#include "G4ParticleChangeForMSC.hh"
    171 #include "G4TransportationManager.hh"
    172 #include "G4SafetyHelper.hh"
    173109
    174110#include "G4Poisson.hh"
     111#include "globals.hh"
    175112
    176113//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    182119    isInitialized(false)
    183120{
    184   masslimite  = 0.6*MeV;
    185   masslimitmu = 110.*MeV;
    186 
     121  masslimite    = 0.6*MeV;
     122  lambdalimit   = 1.*mm;
     123  fr            = 0.02;
     124  facsafety     = 0.3;
    187125  taubig        = 8.0;
    188126  tausmall      = 1.e-16;
     
    193131  smallstep     = 1.e10;
    194132  currentRange  = 0. ;
    195   frscaling2    = 0.25;
    196   frscaling1    = 1.-frscaling2;
     133  rangeinit     = 0.;
    197134  tlimit        = 1.e10*mm;
    198135  tlimitmin     = 10.*tlimitminfix;           
    199   nstepmax      = 25.;
     136  tgeom         = 1.e50*mm;
    200137  geombig       = 1.e50*mm;
    201138  geommin       = 1.e-3*mm;
    202139  geomlimit     = geombig;
    203140  presafety     = 0.*mm;
     141                         
     142  y             = 0.;
     143
     144  Zold          = 0.;
    204145  Zeff          = 1.;
     146  Z2            = 1.;               
     147  Z23           = 1.;                   
     148  lnZ           = 0.;
     149  coeffth1      = 0.;
     150  coeffth2      = 0.;
     151  coeffc1       = 0.;
     152  coeffc2       = 0.;
     153  scr1ini       = fine_structure_const*fine_structure_const*
     154                  electron_mass_c2*electron_mass_c2/(0.885*0.885*4.*pi);
     155  scr2ini       = 3.76*fine_structure_const*fine_structure_const;
     156  scr1          = 0.;
     157  scr2          = 0.;
     158
     159  theta0max     = pi/6.;
     160  rellossmax    = 0.50;
     161  third         = 1./3.;
    205162  particle      = 0;
    206163  theManager    = G4LossTableManager::Instance();
     
    218175
    219176void G4UrbanMscModel::Initialise(const G4ParticleDefinition* p,
    220                                  const G4DataVector&)
     177                                  const G4DataVector&)
    221178{
    222179  skindepth = skin*stepmin;
    223180  if(isInitialized) return;
    224 
    225181  // set values of some data members
    226182  SetParticle(p);
    227183
    228   if (pParticleChange)
    229    fParticleChange = reinterpret_cast<G4ParticleChangeForMSC*>(pParticleChange);
    230   else
    231    fParticleChange = new G4ParticleChangeForMSC();
    232 
    233   safetyHelper = G4TransportationManager::GetTransportationManager()
    234     ->GetSafetyHelper();
    235   safetyHelper->InitialiseHelper();
     184  fParticleChange = GetParticleChangeForMSC();
     185  InitialiseSafetyHelper();
    236186
    237187  isInitialized = true;
     
    385335  if(mass > electron_mass_c2)
    386336  {
    387     G4double TAU = KineticEnergy/mass ;
    388     G4double c = mass*TAU*(TAU+2.)/(electron_mass_c2*(TAU+1.)) ;
    389     G4double w = c-2. ;
    390     G4double tau = 0.5*(w+sqrt(w*w+4.*c)) ;
    391     eKineticEnergy = electron_mass_c2*tau ;
    392   }
    393 
    394   G4double ChargeSquare = charge*charge;
     337     G4double TAU = KineticEnergy/mass ;
     338     G4double c = mass*TAU*(TAU+2.)/(electron_mass_c2*(TAU+1.)) ;
     339     G4double w = c-2. ;
     340     G4double tau = 0.5*(w+sqrt(w*w+4.*c)) ;
     341     eKineticEnergy = electron_mass_c2*tau ;
     342  }
    395343
    396344  G4double eTotalEnergy = eKineticEnergy + electron_mass_c2 ;
     
    490438{
    491439  tPathLength = currentMinimalStep;
    492   const G4DynamicParticle* dp = track.GetDynamicParticle();
    493440  G4StepPoint* sp = track.GetStep()->GetPreStepPoint();
    494441  G4StepStatus stepStatus = sp->GetStepStatus();
     442
     443  const G4DynamicParticle* dp = track.GetDynamicParticle();
    495444
    496445  if(stepStatus == fUndefined) {
     
    516465  presafety = sp->GetSafety();
    517466
    518   //  G4cout << "G4UrbanMscModel::ComputeTruePathLengthLimit tPathLength= "
    519   //     <<tPathLength<<" safety= " << presafety
    520   //     << " range= " <<currentRange<<G4endl;
     467  //    G4cout << "G4UrbanMscModel::ComputeTruePathLengthLimit tPathLength= "
     468  //       <<tPathLength<<" safety= " << presafety
     469  //       << " range= " <<currentRange<<G4endl;
    521470
    522471  // far from geometry boundary
     
    532481    {
    533482      //compute geomlimit and presafety
    534       GeomLimit(track);
    535 
    536       // is far from boundary
    537       if(currentRange <= presafety)
     483      G4double geomlimit = ComputeGeomLimit(track, presafety, currentRange);
     484
     485      // is it far from boundary ?
     486      if(currentRange < presafety)
    538487        {
    539488          inside = true;
     
    546495      if((stepStatus == fGeomBoundary) || (stepStatus == fUndefined))
    547496        {
     497          rangeinit = currentRange;
    548498          if(stepStatus == fUndefined) smallstep = 1.e10;
    549499          else  smallstep = 1.;
    550500
    551           // facrange scaling in lambda
    552           // not so strong step restriction above lambdalimit
    553           G4double facr = facrange;
    554           if(lambda0 > lambdalimit)
    555             facr *= frscaling1+frscaling2*lambda0/lambdalimit;
    556 
    557           // constraint from the physics
    558           if (currentRange > lambda0) tlimit = facr*currentRange;
    559           else                        tlimit = facr*lambda0;
    560 
    561           if(tlimit > currentRange) tlimit = currentRange;
    562 
    563           //define stepmin here (it depends on lambda!)
    564           //rough estimation of lambda_elastic/lambda_transport
    565           G4double rat = currentKinEnergy/MeV ;
    566           rat = 1.e-3/(rat*(10.+rat)) ;
    567           //stepmin ~ lambda_elastic
    568           stepmin = rat*lambda0;
    569           skindepth = skin*stepmin;
    570 
    571           //define tlimitmin
    572           tlimitmin = 10.*stepmin;
    573           if(tlimitmin < tlimitminfix) tlimitmin = tlimitminfix;
    574 
    575           //lower limit for tlimit
    576           if(tlimit < tlimitmin) tlimit = tlimitmin;
    577 
    578           // constraint from the geometry (if tlimit above is too big)
    579           G4double tgeom = geombig;
    580 
     501          // constraint from the geometry
    581502          if((geomlimit < geombig) && (geomlimit > geommin))
    582503            {
     
    585506              else
    586507                tgeom = 2.*geomlimit/facgeom;
    587 
    588               if(tlimit > tgeom) tlimit = tgeom;
    589508            }
    590         }
    591 
    592       //if track starts far from boundaries increase tlimit!
    593       if(tlimit < facsafety*presafety) tlimit = facsafety*presafety ;
     509            else
     510              tgeom = geombig;
     511
     512          //define stepmin here (it depends on lambda!)
     513          //rough estimation of lambda_elastic/lambda_transport
     514          G4double rat = currentKinEnergy/MeV ;
     515          rat = 1.e-3/(rat*(10.+rat)) ;
     516          //stepmin ~ lambda_elastic
     517          stepmin = rat*lambda0;
     518          skindepth = skin*stepmin;
     519
     520          //define tlimitmin
     521          tlimitmin = 10.*stepmin;
     522          if(tlimitmin < tlimitminfix) tlimitmin = tlimitminfix;
     523
     524        }
     525
     526      //step limit
     527      tlimit = facrange*rangeinit;             
     528      if(tlimit < facsafety*presafety)
     529        tlimit = facsafety*presafety;
     530
     531      //lower limit for tlimit
     532      if(tlimit < tlimitmin) tlimit = tlimitmin;
     533
     534      if(tlimit > tgeom) tlimit = tgeom;
    594535
    595536      //  G4cout << "tgeom= " << tgeom << " geomlimit= " << geomlimit 
     
    597538
    598539      // shortcut
    599       if((tPathLength < tlimit) && (tPathLength < presafety))
     540      if((tPathLength < tlimit) && (tPathLength < presafety) &&
     541         (smallstep >= skin) && (tPathLength < geomlimit-0.999*skindepth))
    600542        return tPathLength;   
    601 
    602       G4double tnow = tlimit;
    603       // optimization ...
    604       if(geomlimit < geombig) tnow = max(tlimit,facsafety*geomlimit);
    605543
    606544      // step reduction near to boundary
    607545      if(smallstep < skin)
    608546        {
    609           tnow = stepmin;
     547          tlimit = stepmin;
    610548          insideskin = true;
    611549        }
     
    614552          if(geomlimit > skindepth)
    615553            {
    616               if(tnow > geomlimit-0.999*skindepth)
    617                 tnow = geomlimit-0.999*skindepth;
     554              if(tlimit > geomlimit-0.999*skindepth)
     555                tlimit = geomlimit-0.999*skindepth;
    618556            }
    619557          else
    620558            {
    621559              insideskin = true;
    622               if(tnow > stepmin) tnow = stepmin;
     560              if(tlimit > stepmin) tlimit = stepmin;
    623561            }
    624562        }
    625563
    626       if(tnow < stepmin) tnow = stepmin;
    627 
    628       if(tPathLength > tnow) tPathLength = tnow ;
     564      if(tlimit < stepmin) tlimit = stepmin;
     565
     566      if(tPathLength > tlimit) tPathLength = tlimit  ;
     567
    629568    }
    630569    // for 'normal' simulation with or without magnetic field
     
    635574      // i.e. when it is needed for optimization purposes
    636575      if((stepStatus != fGeomBoundary) && (presafety < tlimitminfix))
    637         presafety = safetyHelper->ComputeSafety(sp->GetPosition());
     576        presafety = ComputeSafety(sp->GetPosition(),tPathLength);
    638577
    639578      // is far from boundary
     
    645584
    646585      if((stepStatus == fGeomBoundary) || (stepStatus == fUndefined))
    647         {
    648           // facrange scaling in lambda
    649           // not so strong step restriction above lambdalimit
    650           G4double facr = facrange;
    651           if(lambda0 > lambdalimit)
    652             facr *= frscaling1+frscaling2*lambda0/lambdalimit;
    653 
    654           // constraint from the physics
    655           if (currentRange > lambda0) tlimit = facr*currentRange;
    656           else                        tlimit = facr*lambda0;
    657 
    658           //lower limit for tlimit
    659           tlimitmin = std::max(tlimitminfix,lambda0/nstepmax);
    660           if(tlimit < tlimitmin) tlimit = tlimitmin;
    661         }
    662 
    663       //if track starts far from boundaries increase tlimit!
    664       if(tlimit < facsafety*presafety) tlimit = facsafety*presafety ;
     586      {
     587        rangeinit = currentRange;
     588        fr = facrange;
     589        // 9.1 like stepping for e+/e- only (not for muons,hadrons)
     590        if(mass < masslimite)
     591        {
     592          if(lambda0 > currentRange)
     593            rangeinit = lambda0;
     594          if(lambda0 > lambdalimit)
     595            fr *= 0.75+0.25*lambda0/lambdalimit;
     596        }
     597
     598        //lower limit for tlimit
     599        G4double rat = currentKinEnergy/MeV ;
     600        rat = 1.e-3/(rat*(10.+rat)) ;
     601        tlimitmin = 10.*lambda0*rat;
     602        if(tlimitmin < tlimitminfix) tlimitmin = tlimitminfix;
     603      }
     604      //step limit
     605      tlimit = fr*rangeinit;               
     606
     607      if(tlimit < facsafety*presafety)
     608        tlimit = facsafety*presafety;
     609
     610      //lower limit for tlimit
     611      if(tlimit < tlimitmin) tlimit = tlimitmin;
    665612
    666613      if(tPathLength > tlimit) tPathLength = tlimit;
     
    679626        }
    680627    }
    681   //  G4cout << "tPathLength= " << tPathLength << "  geomlimit= " << geomlimit
     628  // G4cout << "tPathLength= " << tPathLength << "  geomlimit= " << geomlimit
    682629  //     << " currentMinimalStep= " << currentMinimalStep << G4endl;
    683 
    684630  return tPathLength ;
    685 }
    686 
    687 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    688 
    689 void G4UrbanMscModel::GeomLimit(const G4Track&  track)
    690 {
    691   geomlimit = geombig;
    692 
    693   // no geomlimit for the World volume
    694   if((track.GetVolume() != 0) &&
    695      (track.GetVolume() != safetyHelper->GetWorldVolume())) 
    696   {
    697     G4double cstep = currentRange;
    698 
    699     geomlimit = safetyHelper->CheckNextStep(
    700                   track.GetStep()->GetPreStepPoint()->GetPosition(),
    701                   track.GetMomentumDirection(),
    702                   cstep,
    703                   presafety);
    704     //    G4cout << "!!!G4UrbanMscModel::GeomLimit presafety= " << presafety
    705     //     << " limit= " << geomlimit << G4endl;
    706   } 
    707631}
    708632
     
    761685  if(samplez)
    762686  {
    763     const G4double  ztmax = 0.99, onethird = 1./3. ;
     687    const G4double  ztmax = 0.99 ;
    764688    G4double zt = zmean/tPathLength ;
    765689
     
    767691    {
    768692      G4double u,cz1;
    769       if(zt >= onethird)
     693      if(zt >= third)
    770694      {
    771695        G4double cz = 0.5*(3.*zt-1.)/(1.-zt) ;
     
    835759                         KineticEnergy*(KineticEnergy+2.*mass)/
    836760                      ((currentKinEnergy+mass)*(KineticEnergy+mass)));
    837   G4double y = trueStepLength/currentRadLength;
     761  y = trueStepLength/currentRadLength;
    838762  G4double theta0 = c_highland*std::abs(charge)*sqrt(y)/betacp;
    839763  y = log(y);
    840   if(mass < masslimite)                 
    841     theta0 *= (1.+0.051*y);
    842   else if(mass < masslimitmu)
    843     theta0 *= (1.+0.044*y);
    844   else
    845     theta0 *= (1.+0.038*y);
    846    
     764  // correction factor from e-/proton scattering data
     765  G4double corr = coeffth1+coeffth2*y;               
     766  if(y < -6.5) corr -= 0.011*(6.5+y);
     767  theta0 *= corr ;                                               
     768
    847769  return theta0;
    848770}
     
    854776{
    855777  G4double kineticEnergy = dynParticle->GetKineticEnergy();
     778
    856779  if((kineticEnergy <= 0.0) || (tPathLength <= tlimitminfix) ||
    857      (tPathLength/tausmall < lambda0) ) return;
     780     (tPathLength/tausmall < lambda0)) return;
    858781
    859782  G4double cth  = SampleCosineTheta(tPathLength,kineticEnergy);
     783
    860784  // protection against 'bad' cth values
    861   if(abs(cth) > 1.) return;
     785  if(std::abs(cth) > 1.) return;
    862786
    863787  G4double sth  = sqrt((1.0 - cth)*(1.0 + cth));
     
    874798
    875799    G4double r = SampleDisplacement();
    876 /*
     800    /*
    877801    G4cout << "G4UrbanMscModel::SampleSecondaries: e(MeV)= " << kineticEnergy
    878802           << " sinTheta= " << sth << " r(mm)= " << r
     
    880804           << " geomStep(mm)= " << zPathLength
    881805           << G4endl;
    882 */
     806    */
    883807    if(r > 0.)
    884808      {
     
    889813        // compute it from the lateral correlation
    890814        G4double Phi = 0.;
    891         if(std::abs(r*sth) < latcorr) {
     815        if(std::abs(r*sth) < latcorr)
    892816          Phi  = twopi*G4UniformRand();
    893         } else {
     817        else
     818        {
    894819          G4double psi = std::acos(latcorr/(r*sth));
    895           if(G4UniformRand() < 0.5) Phi = phi+psi;
    896           else                      Phi = phi-psi;
    897         }
     820          if(G4UniformRand() < 0.5)
     821            Phi = phi+psi;
     822          else
     823            Phi = phi-psi;
     824        }
    898825
    899826        dirx = std::cos(Phi);
     
    903830        latDirection.rotateUz(oldDirection);
    904831
    905         G4ThreeVector Position = *(fParticleChange->GetProposedPosition());
    906         G4double fac = 1.;
    907         if(r >  safety) {
    908           //  ******* so safety is computed at boundary too ************
    909           G4double newsafety = safetyHelper->ComputeSafety(Position);
    910           if(r > newsafety)
    911             fac = newsafety/r ;
    912         } 
    913 
    914         if(fac > 0.)
    915         {
    916           // compute new endpoint of the Step
    917           G4ThreeVector newPosition = Position+fac*r*latDirection;
    918 
    919           // definitely not on boundary
    920           if(1. == fac) {
    921             safetyHelper->ReLocateWithinVolume(newPosition);
    922            
    923           } else {
    924             // check safety after displacement
    925             G4double postsafety = safetyHelper->ComputeSafety(newPosition);
    926 
    927             // displacement to boundary
    928             // if(postsafety < tlimitminfix) {
    929             if(postsafety <= 0.0) {
    930               safetyHelper->Locate(newPosition, newDirection);
    931 
    932             // not on the boundary
    933             } else {
    934               safetyHelper->ReLocateWithinVolume(newPosition);
    935             }
    936           }
    937           fParticleChange->ProposePosition(newPosition);
    938         }
    939      }
     832        ComputeDisplacement(fParticleChange, latDirection, r, safety);
     833      }
    940834  }
    941835}
     
    951845  Zeff = couple->GetMaterial()->GetTotNbOfElectPerVolume()/
    952846         couple->GetMaterial()->GetTotNbOfAtomsPerVolume() ;
     847
     848  if(Zold != Zeff) 
     849    UpdateCache();
    953850
    954851  if(insideskin)
     
    960857    if(n > 0)
    961858    {
    962       G4double tm = KineticEnergy/electron_mass_c2;
    963       // ascr - screening parameter
    964       G4double ascr = exp(log(Zeff)/3.)/(137.*sqrt(tm*(tm+2.)));
    965       G4double ascr1 = 1.+0.5*ascr*ascr;
     859      //screening (Moliere-Bethe)
     860      G4double mom2 = KineticEnergy*(2.*mass+KineticEnergy);
     861      G4double beta2 = mom2/((KineticEnergy+mass)*(KineticEnergy+mass));
     862      G4double ascr = scr1/mom2;
     863      ascr *= 1.13+scr2/beta2;
     864      G4double ascr1 = 1.+2.*ascr;
    966865      G4double bp1=ascr1+1.;
    967866      G4double bm1=ascr1-1.;
     867
    968868      // single scattering from screened Rutherford x-section
    969869      G4double ct,st,phi;
     
    1001901    else if (tau >= tausmall)
    1002902    {
    1003       G4double b=2.,bp1=3.,bm1=1.;
    1004       G4double prob = 0. ;
     903      G4double xsi = 3.0; 
     904      G4double x0 = 1.;
    1005905      G4double a = 1., ea = 0., eaa = 1.;
     906      G4double b=2.,b1=3.,bx=1.,eb1=3.,ebx=1.;
     907      G4double prob = 1. , qprob = 1. ;
    1006908      G4double xmean1 = 1., xmean2 = 0.;
    1007                                                      
     909      G4double xmeanth = exp(-tau);
     910      G4double x2meanth = (1.+2.*exp(-2.5*tau))/3.;
     911
     912      G4double relloss = 1.-KineticEnergy/currentKinEnergy;
     913      if(relloss > rellossmax)
     914        return SimpleScattering(xmeanth,x2meanth);
     915
    1008916      G4double theta0 = ComputeTheta0(trueStepLength,KineticEnergy);
    1009917
    1010       // protexction for very small angles
     918      // protection for very small angles
    1011919      if(theta0 < tausmall) return cth;
    1012 
     920   
     921      if(theta0 > theta0max)
     922        return SimpleScattering(xmeanth,x2meanth);
    1013923      G4double sth = sin(0.5*theta0);
    1014924      a = 0.25/(sth*sth);
    1015925
    1016       ea = exp(-2.*a);
    1017       eaa = 1.-ea ;
    1018       xmean1 = (1.+ea)/eaa-1./a;
    1019 
    1020       G4double xmeanth = exp(-tau);
    1021       b = 1./xmeanth ;                               
    1022       bp1 = b+1.;
    1023       bm1 = b-1.;
    1024       // protection
    1025       if(bm1 > 0.)
    1026         xmean2 = b-0.5*bp1*bm1*log(bp1/bm1);
    1027       else
     926      ea = exp(-xsi);
     927      eaa = 1.-ea ;
     928      xmean1 = 1.-(1.-(1.+xsi)*ea)/(a*eaa);
     929      x0 = 1.-xsi/a;
     930
     931      if(xmean1 <= 0.999*xmeanth)
     932        return SimpleScattering(xmeanth,x2meanth);
     933
     934      // from MUSCAT H,Be,Fe data
     935      G4double c = coeffc1;                         
     936      if(y > -13.5)
     937        c += coeffc2*exp(3.*log(y+13.5));
     938
     939      if(abs(c-3.) < 0.001)  c = 3.001;     
     940      if(abs(c-2.) < 0.001)  c = 2.001;     
     941
     942      G4double c1 = c-1.;
     943
     944      //from continuity of derivatives
     945      b = 1.+(c-xsi)/a;
     946
     947      b1 = b+1.;
     948      bx = c/a;
     949      eb1 = exp(c1*log(b1));
     950      ebx = exp(c1*log(bx));
     951
     952      xmean2 = (x0*eb1+ebx-(eb1*bx-b1*ebx)/(c-2.))/(eb1-ebx);
     953     
     954      G4double f1x0 = a*ea/eaa;
     955      G4double f2x0 = c1*eb1/(bx*(eb1-ebx));
     956      prob = f2x0/(f1x0+f2x0);
     957
     958      qprob = xmeanth/(prob*xmean1+(1.-prob)*xmean2);
     959
     960      // sampling of costheta
     961      if(G4UniformRand() < qprob)
    1028962      {
    1029         b = 1.+tau;
    1030         bp1 = 2.+tau;
    1031         bm1 = tau;
    1032         xmean2 = 1.+tau*(1.-log(2./tau));
    1033       }
    1034 
    1035       if((xmean1 >= xmeanth) && (xmean2 <= xmeanth))
    1036       {
    1037         //normal case
    1038         prob = (xmeanth-xmean2)/(xmean1-xmean2);
     963        if(G4UniformRand() < prob)
     964          cth = 1.+log(ea+G4UniformRand()*eaa)/a ;
     965        else
     966          cth = b-b1*bx/exp(log(ebx+(eb1-ebx)*G4UniformRand())/c1) ;
    1039967      }
    1040968      else
    1041       {
    1042         // x1 < xth ( x2 < xth automatically if b = 1/xth)
    1043         // correct a (xmean1)
    1044         if((xmeanth-xmean1)/xmeanth < 1.e-5)
    1045         {   
    1046           // xmean1 is small probably due to precision problems
    1047           xmean1 = 0.50*(1.+xmeanth);
    1048           prob = (xmeanth-xmean2)/(xmean1-xmean2);
    1049         }
    1050         else
    1051         {
    1052           //  correct a in order to have x1=xth
    1053           G4int i=0, imax=10;
    1054           do
    1055           {
    1056             a = 1./(1.-xmeanth+2.*ea/eaa);
    1057             ea = exp(-2.*a);
    1058             eaa = 1.-ea;
    1059             xmean1 = (1.+ea)/eaa-1./a;
    1060             i += 1;
    1061           } while ((std::abs((xmeanth-xmean1)/xmeanth) > 0.05) && (i < imax));
    1062           prob = 1.;         
    1063         }
    1064       }
    1065 
    1066       // sampling of costheta
    1067       if (G4UniformRand() < prob)
    1068          cth = 1.+log(ea+G4UniformRand()*eaa)/a ;
    1069       else
    1070          cth = b-bp1*bm1/(bm1+2.*G4UniformRand()) ;
     969        cth = -1.+2.*G4UniformRand();
    1071970    }
    1072971  } 
    1073972  return cth ;
     973}
     974
     975//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     976
     977G4double G4UrbanMscModel::SimpleScattering(G4double xmeanth,G4double x2meanth)
     978{
     979  // 'large angle scattering'
     980  // 2 model functions with correct xmean and x2mean
     981  G4double a = (2.*xmeanth+9.*x2meanth-3.)/(2.*xmeanth-3.*x2meanth+1.);
     982  G4double prob = (a+2.)*xmeanth/a;
     983
     984  // sampling
     985  G4double cth = 1.;
     986  if(G4UniformRand() < prob)
     987    cth = -1.+2.*exp(log(G4UniformRand())/(a+1.));
     988  else
     989    cth = -1.+2.*G4UniformRand();
     990  return cth;
    1074991}
    1075992
     
    11371054
    11381055//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    1139 
    1140 void G4UrbanMscModel::SampleSecondaries(std::vector<G4DynamicParticle*>*,
    1141                                         const G4MaterialCutsCouple*,
    1142                                         const G4DynamicParticle*,
    1143                                         G4double,
    1144                                         G4double)
    1145 {}
    1146 
    1147 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
  • trunk/source/processes/electromagnetic/standard/src/G4UrbanMscModel2.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4UrbanMscModel2.cc,v 1.18 2008/12/18 13:01:36 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4UrbanMscModel2.cc,v 1.26 2009/05/19 06:26:10 urban Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// -------------------------------------------------------------------
     
    104104#include "G4LossTableManager.hh"
    105105#include "G4ParticleChangeForMSC.hh"
    106 #include "G4TransportationManager.hh"
    107 #include "G4SafetyHelper.hh"
    108106
    109107#include "G4Poisson.hh"
     
    181179  SetParticle(p);
    182180
    183   if (pParticleChange)
    184    fParticleChange = reinterpret_cast<G4ParticleChangeForMSC*>(pParticleChange);
    185   else
    186    fParticleChange = new G4ParticleChangeForMSC();
    187 
    188   safetyHelper = G4TransportationManager::GetTransportationManager()
    189     ->GetSafetyHelper();
    190   safetyHelper->InitialiseHelper();
     181  fParticleChange = GetParticleChangeForMSC();
     182  InitialiseSafetyHelper();
    191183
    192184  isInitialized = true;
     
    486478    {
    487479      //compute geomlimit and presafety
    488       GeomLimit(track);
     480      G4double geomlimit = ComputeGeomLimit(track, presafety, currentRange);
    489481
    490482      // is it far from boundary ?
     
    499491
    500492      if((stepStatus == fGeomBoundary) || (stepStatus == fUndefined))
    501         {
     493        {
    502494          rangeinit = currentRange;
    503           if(stepStatus == fUndefined) smallstep = 1.e10;
    504           else  smallstep = 1.;
    505 
    506           // constraint from the geometry
    507           if((geomlimit < geombig) && (geomlimit > geommin))
    508             {
    509               if(stepStatus == fGeomBoundary) 
    510                 tgeom = geomlimit/facgeom;
    511               else
    512                 tgeom = 2.*geomlimit/facgeom;
    513             }
    514             else
    515               tgeom = geombig;
     495          if(stepStatus == fUndefined) smallstep = 1.e10;
     496          else  smallstep = 1.;
    516497
    517498          //define stepmin here (it depends on lambda!)
     
    522503          stepmin = rat*lambda0;
    523504          skindepth = skin*stepmin;
    524 
    525505          //define tlimitmin
    526506          tlimitmin = 10.*stepmin;
    527507          if(tlimitmin < tlimitminfix) tlimitmin = tlimitminfix;
    528508
     509          // constraint from the geometry
     510          if((geomlimit < geombig) && (geomlimit > geommin))
     511            {
     512              // geomlimit is a geometrical step length
     513              // transform it to true path length (estimation)
     514              if((1.-geomlimit/lambda0) > 0.)
     515                geomlimit = -lambda0*log(1.-geomlimit/lambda0)+tlimitmin ;
     516
     517              if(stepStatus == fGeomBoundary)
     518                tgeom = geomlimit/facgeom;
     519              else
     520                tgeom = 2.*geomlimit/facgeom;
     521            }
     522            else
     523              tgeom = geombig;
    529524        }
     525
    530526
    531527      //step limit
     
    579575      // i.e. when it is needed for optimization purposes
    580576      if((stepStatus != fGeomBoundary) && (presafety < tlimitminfix))
    581         presafety = safetyHelper->ComputeSafety(sp->GetPosition());
     577        presafety = ComputeSafety(sp->GetPosition(),tPathLength);
    582578
    583579      // is far from boundary
     
    634630  //     << " currentMinimalStep= " << currentMinimalStep << G4endl;
    635631  return tPathLength ;
    636 }
    637 
    638 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    639 
    640 void G4UrbanMscModel2::GeomLimit(const G4Track&  track)
    641 {
    642   geomlimit = geombig;
    643 
    644   // no geomlimit for the World volume
    645   if((track.GetVolume() != 0) &&
    646      (track.GetVolume() != safetyHelper->GetWorldVolume())) 
    647   {
    648     G4double cstep = currentRange;
    649 
    650     geomlimit = safetyHelper->CheckNextStep(
    651                   track.GetStep()->GetPreStepPoint()->GetPosition(),
    652                   track.GetMomentumDirection(),
    653                   cstep,
    654                   presafety);
    655     /*
    656     G4cout << "!!!G4UrbanMscModel2::GeomLimit presafety= " << presafety
    657            << " r= " << currentRange
    658            << " limit= " << geomlimit << G4endl;
    659     */
    660   } 
    661632}
    662633
     
    792763  G4double theta0 = c_highland*std::abs(charge)*sqrt(y)/betacp;
    793764  y = log(y);
    794   // correction factor from e-/proton scattering data
     765  // correction factor from e- scattering data
    795766  G4double corr = coeffth1+coeffth2*y;               
    796   if(y < -6.5) corr -= 0.011*(6.5+y);
     767
    797768  theta0 *= corr ;                                               
    798769
     
    860831        latDirection.rotateUz(oldDirection);
    861832
    862         G4ThreeVector Position = *(fParticleChange->GetProposedPosition());
    863         G4double fac = 1.;
    864         if(r >  safety) {
    865           //  ******* so safety is computed at boundary too ************
    866           G4double newsafety = safetyHelper->ComputeSafety(Position);
    867           if(r > newsafety)
    868             fac = newsafety/r ;
    869         } 
    870 
    871         if(fac > 0.)
    872         {
    873           // compute new endpoint of the Step
    874           G4ThreeVector newPosition = Position+fac*r*latDirection;
    875 
    876           // definitely not on boundary
    877           if(1. == fac) {
    878             safetyHelper->ReLocateWithinVolume(newPosition);
    879            
    880           } else {
    881             // check safety after displacement
    882             G4double postsafety = safetyHelper->ComputeSafety(newPosition);
    883 
    884             // displacement to boundary
    885             if(postsafety <= 0.0) {
    886               safetyHelper->Locate(newPosition, newDirection);
    887 
    888             // not on the boundary
    889             } else {
    890               safetyHelper->ReLocateWithinVolume(newPosition);
    891             }
    892           }
    893           fParticleChange->ProposePosition(newPosition);
    894         }
    895      }
     833        ComputeDisplacement(fParticleChange, latDirection, r, safety);
     834      }
    896835  }
    897836}
     
    963902    else if (tau >= tausmall)
    964903    {
    965       G4double xsi = 3.0; 
     904      G4double xsi = 3.;
    966905      G4double x0 = 1.;
    967906      G4double a = 1., ea = 0., eaa = 1.;
     
    994933        return SimpleScattering(xmeanth,x2meanth);
    995934
    996       // from MUSCAT H,Be,Fe data
    997       G4double c = coeffc1;                         
    998       if(y > -13.5)
    999         c += coeffc2*exp(3.*log(y+13.5));
     935      // from e- and muon scattering data                   
     936      G4double c = coeffc1+coeffc2*y; ;                         
    1000937
    1001938      if(abs(c-3.) < 0.001)  c = 3.001;     
    1002939      if(abs(c-2.) < 0.001)  c = 2.001;     
     940      if(abs(c-1.) < 0.001)  c = 1.001;     
    1003941
    1004942      G4double c1 = c-1.;
     
    11161054
    11171055//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    1118 
    1119 void G4UrbanMscModel2::SampleSecondaries(std::vector<G4DynamicParticle*>*,
    1120                                          const G4MaterialCutsCouple*,
    1121                                          const G4DynamicParticle*,
    1122                                          G4double,
    1123                                          G4double)
    1124 {}
    1125 
    1126 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
  • trunk/source/processes/electromagnetic/standard/src/G4UrbanMscModel90.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4UrbanMscModel90.cc,v 1.10 2008/10/29 14:15:30 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4UrbanMscModel90.cc,v 1.13 2009/04/10 18:10:58 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    6060#include "G4LossTableManager.hh"
    6161#include "G4ParticleChangeForMSC.hh"
    62 #include "G4TransportationManager.hh"
    63 #include "G4SafetyHelper.hh"
    6462
    6563#include "G4Poisson.hh"
     
    113111  SetParticle(p);
    114112
    115   if (pParticleChange) {
    116    fParticleChange = reinterpret_cast<G4ParticleChangeForMSC*>(pParticleChange);
    117   } else {
    118    fParticleChange = new G4ParticleChangeForMSC();
    119   }
    120   safetyHelper = G4TransportationManager::GetTransportationManager()
    121     ->GetSafetyHelper();
    122   safetyHelper->InitialiseHelper();
     113  fParticleChange = GetParticleChangeForMSC();
     114  InitialiseSafetyHelper();
    123115
    124116  isInitialized = true;
     
    419411    {
    420412      //compute geomlimit and presafety
    421       GeomLimit(track);
     413      G4double geomlimit = ComputeGeomLimit(track, presafety, currentRange);
    422414   
    423415      // is far from boundary
     
    522514      // i.e. when it is needed for optimization purposes
    523515      if((stepStatus != fGeomBoundary) && (presafety < tlimitminfix))
    524         presafety = safetyHelper->ComputeSafety(sp->GetPosition());
     516        presafety = ComputeSafety(sp->GetPosition(),tPathLength);
    525517
    526518      // is far from boundary
     
    569561  //     << " currentMinimalStep= " << currentMinimalStep << G4endl;
    570562  return tPathLength ;
    571 }
    572 
    573 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    574 
    575 void G4UrbanMscModel90::GeomLimit(const G4Track&  track)
    576 {
    577   geomlimit = geombig;
    578 
    579   // no geomlimit for the World volume
    580   if((track.GetVolume() != 0) &&
    581      (track.GetVolume() != safetyHelper->GetWorldVolume())) 
    582   {
    583     G4double cstep = currentRange;
    584     geomlimit = safetyHelper->CheckNextStep(
    585                   track.GetStep()->GetPreStepPoint()->GetPosition(),
    586                   track.GetMomentumDirection(),
    587                   cstep,
    588                   presafety);
    589     //    G4cout << "!!!G4UrbanMscModel90::GeomLimit presafety= " << presafety
    590     //     << " limit= " << geomlimit << G4endl;
    591   } 
    592563}
    593564
     
    788759        G4ThreeVector latDirection(dirx,diry,0.0);
    789760        latDirection.rotateUz(oldDirection);
    790 
    791         G4ThreeVector Position = *(fParticleChange->GetProposedPosition());
    792         G4double fac = 1.;
    793         if(r >  safety) {
    794           //  ******* so safety is computed at boundary too ************
    795           G4double newsafety = safetyHelper->ComputeSafety(Position);
    796           //G4double newsafety = safety;
    797           if(r > newsafety)
    798             fac = newsafety/r ;
    799         } 
    800 
    801         if(fac > 0.)
    802         {
    803           // compute new endpoint of the Step
    804           G4ThreeVector newPosition = Position+fac*r*latDirection;
    805 
    806           // definetly not on boundary
    807           if(1. == fac) {
    808             //if(0. < fac) {
    809             safetyHelper->ReLocateWithinVolume(newPosition);
    810 
    811            
    812           } else {
    813             // check safety after displacement
    814             G4double postsafety = safetyHelper->ComputeSafety(newPosition);
    815 
    816             // displacement to boundary
    817             if(postsafety <= 0.) {
    818               safetyHelper->Locate(newPosition, newDirection);
    819 
    820             // not on the boundary
    821             } else {
    822               safetyHelper->ReLocateWithinVolume(newPosition);
    823             }
    824           }
    825           fParticleChange->ProposePosition(newPosition);
    826         }
    827      }
     761        ComputeDisplacement(fParticleChange, latDirection, r, safety);
     762      }
    828763  }
    829764}
  • trunk/source/processes/electromagnetic/standard/src/G4WaterStopping.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4WaterStopping.cc,v 1.11 2008/12/18 13:01:38 gunter Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4WaterStopping.cc,v 1.16 2009/05/15 19:04:21 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828
    2929//---------------------------------------------------------------------------
     
    3636//
    3737// Modifications:
     38// 29.04.2009 A.Ivantchenko added revised data for G4WATER, provided by
     39//            Prof.P.Sigmund Univ. Southern Denmark in the framework of
     40//            the ESA Technology Research Programme (ESA contract 21435/08/NL/AT)
    3841//
    3942//----------------------------------------------------------------------------
     
    98101  G4int zz[16] = {3, 4, 5, 6, 7, 8, 9, 10,11,12,13,14,15,16,17,18};
    99102  G4int aa[16] = {7, 9, 11, 12, 14, 16, 19, 20, 23, 24, 27, 28,31,32, 35,40};
    100   // G4double A_Ion[16] = {6.941,9.0122,10.811,12.011,14.007,15.999,18.998,20.180,22.990,24.305,26.982,28.086,30.974,32.065,35.453,39.948};
     103  // G4double A_Ion[17] = {6.941,9.0122,10.811,12.011,14.007,15.999,18.998,20.180,22.990,24.305,26.982,28.086,30.974,32.065,35.453,39.948};
    101104  for(i=0; i<16; i++) {
    102105    Z[i] = zz[i];
     
    109112  G4double factor = 1000.*MeV/cm;
    110113
    111 G4double G4_WATER_Li [53]={2.626, 2.84, 3.191, 3.461, 3.665, 3.817, 3.927, 4.004, 4.056, 4.102, 3.998, 3.853, 3.702, 3.413, 3.158, 2.934, 2.739, 2.567, 2.415, 2.28, 1.782, 1.465, 1.247, 1.087, 0.8706, 0.7299, 0.631, 0.5575, 0.5005, 0.455, 0.4178, 0.3004, 0.2376, 0.1981, 0.1708, 0.1354, 0.1132, 0.09803, 0.08692, 0.07842, 0.07171, 0.06627, 0.0495, 0.04085, 0.03557, 0.03203, 0.0276, 0.02498, 0.02327, 0.0221, 0.02126, 0.02064, 0.02016, };
    112 AddData(E,G4_WATER_Li,factor);
    113 
    114 G4double G4_WATER_Be [53]={3.272, 3.565, 4.061, 4.463, 4.79, 5.052, 5.258, 5.419, 5.542, 5.803, 5.787, 5.675, 5.529, 5.215, 4.912, 4.634, 4.381, 4.152, 3.944, 3.756, 3.026, 2.533, 2.179, 1.913, 1.542, 1.296, 1.122, 0.9911, 0.8898, 0.8087, 0.7423, 0.5335, 0.4219, 0.3518, 0.3034, 0.2406, 0.2013, 0.1743, 0.1545, 0.1394, 0.1275, 0.1178, 0.08805, 0.07266, 0.06328, 0.05698, 0.0491, 0.04444, 0.04141, 0.03933, 0.03783, 0.03672, 0.03588, };
    115 AddData(E,G4_WATER_Be,factor);
    116 
    117 G4double G4_WATER_B [53]={3.773, 4.142, 4.776, 5.304, 5.749, 6.122, 6.431, 6.684, 6.89, 7.432, 7.551, 7.505, 7.391, 7.091, 6.772, 6.463, 6.172, 5.901, 5.65, 5.418, 4.484, 3.817, 3.322, 2.94, 2.392, 2.02, 1.752, 1.549, 1.391, 1.265, 1.161, 0.8332, 0.6587, 0.5492, 0.4737, 0.3757, 0.3144, 0.2723, 0.2415, 0.2179, 0.1993, 0.1842, 0.1376, 0.1136, 0.09894, 0.08909, 0.07678, 0.0695, 0.06477, 0.06151, 0.05916, 0.05743, 0.05611, };
    118 AddData(E,G4_WATER_B,factor);
    119 
    120 G4double G4_WATER_C [53]={4.154, 4.593, 5.358, 6.009, 6.568, 7.049, 7.46, 7.809, 8.103, 8.968, 9.262, 9.311, 9.25, 8.994, 8.68, 8.358, 8.045, 7.747, 7.465, 7.199, 6.093, 5.269, 4.636, 4.137, 3.403, 2.891, 2.516, 2.23, 2.004, 1.823, 1.673, 1.2, 0.9483, 0.7904, 0.6817, 0.5406, 0.4525, 0.392, 0.3477, 0.3138, 0.287, 0.2653, 0.1983, 0.1637, 0.1426, 0.1284, 0.1107, 0.1002, 0.09335, 0.08865, 0.08528, 0.08278, 0.08088, };
    121 AddData(E,G4_WATER_C,factor);
    122 
    123 G4double G4_WATER_N [53]={4.49, 4.984, 5.86, 6.616, 7.276, 7.854, 8.36, 8.799, 9.179, 10.39, 10.89, 11.07, 11.08, 10.9, 10.61, 10.3, 9.974, 9.66, 9.357, 9.068, 7.823, 6.859, 6.097, 5.484, 4.56, 3.9, 3.408, 3.029, 2.727, 2.482, 2.28, 1.636, 1.291, 1.076, 0.9274, 0.7354, 0.6156, 0.5333, 0.4731, 0.427, 0.3906, 0.3611, 0.27, 0.2229, 0.1942, 0.1749, 0.1507, 0.1365, 0.1272, 0.1208, 0.1162, 0.1128, 0.1102, };
    124 AddData(E,G4_WATER_N,factor);
    125 
    126 G4double G4_WATER_O [53]={4.778, 5.321, 6.298, 7.152, 7.907, 8.578, 9.173, 9.7, 10.16, 11.73, 12.46, 12.78, 12.89, 12.81, 12.57, 12.27, 11.95, 11.63, 11.32, 11.01, 9.659, 8.571, 7.691, 6.967, 5.854, 5.042, 4.427, 3.945, 3.56, 3.245, 2.983, 2.142, 1.689, 1.406, 1.212, 0.9602, 0.8037, 0.6963, 0.6178, 0.5577, 0.5102, 0.4716, 0.3527, 0.2913, 0.2538, 0.2285, 0.197, 0.1784, 0.1663, 0.1579, 0.1519, 0.1475, 0.1441, };
    127 AddData(E,G4_WATER_O,factor);
    128 
    129 G4double G4_WATER_F [53]={4.992, 5.575, 6.637, 7.578, 8.418, 9.171, 9.847, 10.45, 11, 12.9, 13.88, 14.35, 14.56, 14.59, 14.4, 14.13, 13.83, 13.51, 13.19, 12.87, 11.44, 10.26, 9.279, 8.463, 7.187, 6.237, 5.506, 4.928, 4.461, 4.076, 3.753, 2.707, 2.137, 1.779, 1.533, 1.215, 1.017, 0.8809, 0.7816, 0.7056, 0.6456, 0.5969, 0.4466, 0.3688, 0.3213, 0.2894, 0.2496, 0.2259, 0.2106, 0.2, 0.1924, 0.1868, 0.1825, };
    130 AddData(E,G4_WATER_F,factor);
    131 
    132 G4double G4_WATER_Ne [53]={5.182, 5.797, 6.931, 7.948, 8.865, 9.693, 10.44, 11.12, 11.74, 13.98, 15.21, 15.85, 16.17, 16.33, 16.21, 15.98, 15.69, 15.38, 15.06, 14.74, 13.24, 11.98, 10.91, 10.01, 8.584, 7.503, 6.66, 5.986, 5.436, 4.979, 4.595, 3.332, 2.635, 2.195, 1.892, 1.499, 1.255, 1.087, 0.9646, 0.8709, 0.7969, 0.7368, 0.5514, 0.4555, 0.3969, 0.3576, 0.3083, 0.2792, 0.2602, 0.2472, 0.2378, 0.2308, 0.2255, };
    133 AddData(E,G4_WATER_Ne,factor);
    134 
    135 G4double G4_WATER_Na [53]={5.352, 5.998, 7.203, 8.3, 9.298, 10.21, 11.04, 11.81, 12.5, 15.13, 16.68, 17.56, 18.04, 18.43, 18.44, 18.29, 18.05, 17.78, 17.48, 17.18, 15.67, 14.32, 13.15, 12.14, 10.5, 9.226, 8.218, 7.401, 6.728, 6.166, 5.69, 4.112, 3.237, 2.686, 2.307, 1.821, 1.521, 1.317, 1.168, 1.054, 0.9644, 0.8917, 0.6674, 0.5514, 0.4806, 0.4329, 0.3734, 0.3381, 0.3152, 0.2993, 0.288, 0.2796, 0.2732, };
    136 AddData(E,G4_WATER_Na,factor);
    137 
    138 G4double G4_WATER_Mg [53]={5.542, 6.193, 7.42, 8.551, 9.59, 10.54, 11.42, 12.23, 12.98, 15.85, 17.62, 18.66, 19.26, 19.76, 19.83, 19.7, 19.47, 19.2, 18.89, 18.58, 17.02, 15.62, 14.41, 13.36, 11.64, 10.3, 9.233, 8.362, 7.64, 7.033, 6.516, 4.777, 3.792, 3.162, 2.725, 2.159, 1.806, 1.565, 1.388, 1.254, 1.147, 1.061, 0.7944, 0.6565, 0.5722, 0.5156, 0.4447, 0.4027, 0.3754, 0.3566, 0.343, 0.333, 0.3254, };
    139 AddData(E,G4_WATER_Mg,factor);
    140 
    141 G4double G4_WATER_Al [53]={5.724, 6.39, 7.649, 8.82, 9.905, 10.91, 11.84, 12.71, 13.51, 16.66, 18.69, 19.93, 20.68, 21.38, 21.56, 21.5, 21.32, 21.07, 20.79, 20.48, 18.91, 17.47, 16.19, 15.08, 13.24, 11.78, 10.61, 9.641, 8.835, 8.153, 7.569, 5.583, 4.444, 3.71, 3.199, 2.534, 2.12, 1.836, 1.629, 1.471, 1.346, 1.245, 0.9325, 0.7707, 0.6719, 0.6054, 0.5223, 0.473, 0.441, 0.4189, 0.403, 0.3912, 0.3823, };
    142 AddData(E,G4_WATER_Al,factor);
    143 
    144 G4double G4_WATER_Si [53]={5.905, 6.583, 7.868, 9.073, 10.2, 11.25, 12.23, 13.14, 13.99, 17.4, 19.66, 21.1, 22.01, 22.91, 23.21, 23.22, 23.09, 22.87, 22.61, 22.32, 20.76, 19.28, 17.95, 16.78, 14.83, 13.26, 11.99, 10.94, 10.06, 9.304, 8.656, 6.43, 5.135, 4.294, 3.705, 2.938, 2.458, 2.129, 1.889, 1.706, 1.561, 1.444, 1.082, 0.8942, 0.7796, 0.7026, 0.6061, 0.549, 0.5119, 0.4862, 0.4678, 0.4542, 0.4438, };
    145 AddData(E,G4_WATER_Si,factor);
    146 
    147 G4double G4_WATER_P [53]={6.12, 6.81, 8.118, 9.352, 10.51, 11.61, 12.63, 13.58, 14.48, 18.13, 20.63, 22.28, 23.34, 24.47, 24.91, 25.02, 24.95, 24.78, 24.55, 24.28, 22.76, 21.26, 19.89, 18.67, 16.59, 14.92, 13.54, 12.39, 11.42, 10.59, 9.867, 7.367, 5.896, 4.935, 4.259, 3.376, 2.824, 2.445, 2.169, 1.959, 1.792, 1.657, 1.242, 1.027, 0.8954, 0.807, 0.6963, 0.6308, 0.5881, 0.5587, 0.5375, 0.5219, 0.51, };
    148 AddData(E,G4_WATER_P,factor);
    149 
    150 G4double G4_WATER_S [53]={6.294, 7, 8.338, 9.604, 10.8, 11.94, 13, 14, 14.94, 18.82, 21.55, 23.41, 24.65, 26.01, 26.6, 26.81, 26.81, 26.69, 26.5, 26.26, 24.79, 23.28, 21.88, 20.61, 18.43, 16.64, 15.16, 13.92, 12.86, 11.95, 11.15, 8.371, 6.715, 5.624, 4.856, 3.847, 3.217, 2.785, 2.47, 2.229, 2.04, 1.886, 1.413, 1.169, 1.019, 0.9187, 0.7929, 0.7183, 0.6697, 0.6362, 0.6122, 0.5944, 0.5808, };
    151 AddData(E,G4_WATER_S,factor);
    152 
    153 G4double G4_WATER_Cl [53]={6.522, 7.237, 8.59, 9.875, 11.1, 12.26, 13.36, 14.39, 15.37, 19.45, 22.4, 24.45, 25.86, 27.46, 28.19, 28.5, 28.57, 28.5, 28.34, 28.13, 26.72, 25.21, 23.78, 22.47, 20.2, 18.32, 16.75, 15.42, 14.28, 13.3, 12.44, 9.392, 7.557, 6.34, 5.479, 4.344, 3.633, 3.145, 2.789, 2.517, 2.303, 2.13, 1.596, 1.32, 1.151, 1.038, 0.8957, 0.8115, 0.7567, 0.7189, 0.6917, 0.6717, 0.6563, };
    154 AddData(E,G4_WATER_Cl,factor);
    155 
    156 G4double G4_WATER_Ar [53]={6.642, 7.369, 8.739, 10.04, 11.28, 12.47, 13.59, 14.66, 15.66, 19.93, 23.08, 25.32, 26.89, 28.72, 29.6, 30.01, 30.15, 30.13, 30, 29.82, 28.46, 26.94, 25.49, 24.15, 21.81, 19.86, 18.22, 16.82, 15.61, 14.57, 13.65, 10.39, 8.394, 7.063, 6.114, 4.859, 4.067, 3.522, 3.125, 2.821, 2.581, 2.387, 1.789, 1.48, 1.291, 1.164, 1.005, 0.9105, 0.8491, 0.8067, 0.7763, 0.7537, 0.7365, };
    157 AddData(E,G4_WATER_Ar,factor);
     114  G4double G4_WATER_Li[53]={2.3193,2.5198,2.8539,3.1164,3.3203,3.4756,3.5914,3.6755,3.7347,3.8125,3.7349,3.6134,3.4818,3.2258,2.9949,2.7909,2.611,2.4517,2.3103,2.1841,1.7151,1.4139,1.2053,1.0525,0.84417,0.70862,0.61317,0.54214,0.48708,0.44305,0.40697,0.29312,0.23208,0.19364,0.16706,0.13252,0.11092,0.09608,0.08522,0.076915,0.07035,0.065026,0.048615,0.040137,0.034964,0.03149,0.027148,0.024579,0.022911,0.021761,0.020937,0.020327,0.019862};
     115  AddData(E,G4_WATER_Li,factor);
     116  G4double G4_WATER_Be[53]={2.872,3.1439,3.6102,3.9967,4.3169,4.5788,4.7897,4.9568,5.0872,5.387,5.4028,5.3185,5.1971,4.9243,4.6549,4.4036,4.1732,3.9629,3.771,3.5957,2.9117,2.4439,2.1062,1.8518,1.4956,1.2587,1.0901,0.96393,0.86589,0.78742,0.72313,0.52053,0.41214,0.34394,0.2968,0.2355,0.19717,0.17081,0.15152,0.13676,0.1251,0.11564,0.086471,0.071399,0.062202,0.056023,0.048303,0.043734,0.040767,0.038723,0.037256,0.036172,0.035345};
     117  AddData(E,G4_WATER_Be,factor);
     118  G4double G4_WATER_B[53]={3.2922,3.6315,4.2226,4.7242,5.1543,5.5219,5.8323,6.0911,6.3043,6.8888,7.0451,7.0309,6.9445,6.6925,6.4129,6.1372,5.8747,5.6283,5.3983,5.1841,4.3121,3.6826,3.2109,2.8459,2.3203,1.9619,1.7028,1.5072,1.3543,1.2315,1.1307,0.81305,0.64344,0.53693,0.46337,0.36777,0.30797,0.26684,0.23674,0.21371,0.1955,0.18072,0.13517,0.11163,0.097256,0.087601,0.075535,0.068395,0.063757,0.060561,0.058268,0.056574,0.05528};
     119  AddData(E,G4_WATER_B,factor);
     120  G4double G4_WATER_C[53]={3.6037,4.0035,4.7125,5.3248,5.8601,6.3287,6.7363,7.0875,7.3872,8.2986,8.635,8.7189,8.6879,8.485,8.2162,7.9331,7.6534,7.3839,7.1272,6.884,5.8573,5.0814,4.4808,4.0044,3.3005,2.808,2.4458,2.1691,1.9511,1.7751,1.6302,1.1714,0.9263,0.77269,0.66676,0.52925,0.44328,0.38415,0.34086,0.30773,0.28154,0.26028,0.19473,0.16083,0.14014,0.12624,0.10886,0.098575,0.091894,0.08729,0.083986,0.081545,0.079682};
     121  AddData(E,G4_WATER_C,factor);
     122  G4double G4_WATER_N[53]={3.8821,4.3278,5.1314,5.8371,6.4632,7.021,7.5168,7.9545,8.3378,9.5943,10.145,10.356,10.402,10.278,10.041,9.7677,9.4845,9.2035,8.9301,8.6668,7.5173,6.6126,5.8919,5.308,4.4226,3.7883,3.3138,2.9467,2.655,2.4179,2.2217,1.5965,1.2614,1.0516,0.90715,0.71995,0.60305,0.52268,0.46384,0.41882,0.3832,0.35431,0.26515,0.21903,0.19087,0.17194,0.14829,0.13429,0.12519,0.11892,0.11442,0.1111,0.10856};
     123  AddData(E,G4_WATER_N,factor);
     124  G4double G4_WATER_O[53]={4.1215,4.6063,5.4945,6.2868,6.9978,7.6391,8.2175,8.7372,9.201,10.808,11.596,11.955,12.096,12.077,11.89,11.639,11.364,11.081,10.799,10.523,9.2787,8.2615,7.4307,6.7431,5.6787,4.8981,4.3045,3.8393,3.4663,3.161,2.9069,2.0903,1.6501,1.3745,1.1851,0.94004,0.78733,0.68244,0.60568,0.54694,0.50048,0.46278,0.34643,0.28622,0.24945,0.22474,0.19384,0.17555,0.16367,0.15547,0.14959,0.14525,0.14194};
     125  AddData(E,G4_WATER_O,factor);
     126  G4double G4_WATER_F[53]={4.2951,4.8107,5.7678,6.6342,7.4196,8.1343,8.7858,9.3786,9.9152,11.857,12.89,13.408,13.652,13.749,13.62,13.398,13.136,12.857,12.573,12.291,10.982,9.88,8.9601,8.1871,6.9687,6.0574,5.3535,4.7954,4.3434,3.9704,3.658,2.642,2.0878,1.7393,1.4994,1.1892,0.99601,0.86336,0.76632,0.69207,0.63334,0.58568,0.43857,0.36242,0.3159,0.28462,0.24552,0.22237,0.20733,0.19696,0.18951,0.18401,0.17981};
     127  AddData(E,G4_WATER_F,factor);
     128  G4double G4_WATER_Ne[53]={4.4513,4.991,6.004,6.9338,7.7852,8.5662,9.284,9.9435,10.547,12.813,14.099,14.791,15.151,15.382,15.321,15.136,14.895,14.626,14.345,14.061,12.705,11.53,10.532,9.6823,8.3208,7.2846,6.4735,5.8234,5.2919,4.8502,4.4779,3.252,2.5745,2.146,1.8503,1.4675,1.2291,1.0654,0.94575,0.85419,0.78178,0.72301,0.54158,0.44763,0.39022,0.35162,0.30335,0.27477,0.25619,0.24339,0.23419,0.2274,0.22222};
     129  AddData(E,G4_WATER_Ne,factor);
     130  G4double G4_WATER_Na[53]={4.5914,5.1553,6.2244,7.2203,8.1435,8.9982,9.7906,10.526,11.206,13.848,15.453,16.384,16.916,17.369,17.442,17.344,17.16,16.93,16.675,16.407,15.045,13.799,12.706,11.753,10.187,8.9672,7.9956,7.2072,6.5562,6.0112,5.5493,4.0154,3.1635,2.6262,2.2573,1.7832,1.4904,1.2907,1.1451,1.0339,0.94615,0.87498,0.65548,0.54186,0.47243,0.42574,0.36734,0.33275,0.31027,0.29478,0.28364,0.27542,0.26915};
     131  AddData(E,G4_WATER_Na,factor);
     132  G4double G4_WATER_Mg[53]={4.7537,5.3178,6.3962,7.4137,8.3663,9.2554,10.085,10.859,11.581,14.455,16.279,17.373,18.018,18.598,18.727,18.654,18.479,18.25,17.99,17.716,16.313,15.026,13.895,12.907,11.277,9.9981,8.9727,8.1344,7.4376,6.8507,6.35,4.6625,3.7049,3.0916,2.666,2.1135,1.7695,1.5336,1.3613,1.2296,1.1255,1.041,0.7802,0.64511,0.56252,0.50698,0.43749,0.39634,0.36958,0.35114,0.33789,0.3281,0.32063};
     133  AddData(E,G4_WATER_Mg,factor);
     134  G4double G4_WATER_Al[53]={4.911,5.4856,6.5852,7.6302,8.6193,9.551,10.426,11.248,12.018,15.152,17.23,18.531,19.33,20.11,20.354,20.352,20.224,20.024,19.785,19.521,18.12,16.795,15.611,14.565,12.819,11.431,10.305,9.3772,8.6003,7.9413,7.3761,5.45,4.342,3.6272,3.129,2.4808,2.0767,1.7997,1.5975,1.4429,1.3207,1.2216,0.91581,0.75739,0.66053,0.59537,0.51383,0.46554,0.43413,0.41248,0.39693,0.38544,0.37667};
     135  AddData(E,G4_WATER_Al,factor);
     136  G4double G4_WATER_Si[53]={5.0697,5.6529,6.77,7.8376,8.8564,9.8229,10.736,11.597,12.409,15.773,18.09,19.594,20.549,21.535,21.9,21.975,21.896,21.73,21.513,21.265,19.878,18.525,17.298,16.202,14.354,12.867,11.651,10.64,9.7876,9.0607,8.4341,6.2756,5.0169,4.1981,3.6247,2.8758,2.4078,2.0868,1.8523,1.6731,1.5315,1.4167,1.0623,0.8787,0.76644,0.69091,0.59637,0.54036,0.50394,0.47883,0.46078,0.44746,0.43728};
     137  AddData(E,G4_WATER_Si,factor);
     138  G4double G4_WATER_P[53]={5.2616,5.8538,6.9867,8.074,9.1192,10.117,11.065,11.964,12.815,16.396,18.945,20.657,21.779,22.993,23.502,23.672,23.659,23.54,23.356,23.132,21.792,20.425,19.162,18.02,16.066,14.472,13.155,12.051,11.114,10.311,9.6149,7.1917,5.7614,4.8249,4.1667,3.305,2.7661,2.3966,2.1269,1.9215,1.7603,1.6263,1.2197,1.0091,0.88027,0.79361,0.68512,0.62083,0.57902,0.55019,0.52947,0.51417,0.50248};
     139  AddData(E,G4_WATER_P,factor);
     140  G4double G4_WATER_S[53]={5.4129,6.0193,7.1761,8.2871,9.36,10.39,11.373,12.308,13.196,16.986,19.762,21.683,22.976,24.431,25.091,25.363,25.421,25.354,25.208,25.013,23.734,22.366,21.074,19.891,17.84,16.146,14.731,13.536,12.516,11.636,10.869,8.1727,6.5617,5.4997,4.7505,3.7671,3.1514,2.7293,2.4215,2.1866,2.0012,1.8509,1.3881,1.1485,1.002,0.90348,0.78008,0.70695,0.65938,0.62657,0.60299,0.58558,0.57229};
     141  AddData(E,G4_WATER_S,factor);
     142  G4double G4_WATER_Cl[53]={5.6171,6.2307,7.3984,8.5209,9.6097,10.661,11.669,12.632,13.551,17.518,20.497,22.615,24.076,25.769,26.58,26.953,27.082,27.066,26.958,26.791,25.579,24.214,22.901,21.685,19.553,17.771,16.271,14.996,13.9,12.949,12.118,9.1688,7.385,6.2003,5.3604,4.2535,3.5588,3.0821,2.7343,2.4689,2.2595,2.0898,1.5673,1.297,1.1318,1.0205,0.88128,0.79874,0.74504,0.708,0.68138,0.66172,0.64671};
     143  AddData(E,G4_WATER_Cl,factor);
     144  G4double G4_WATER_Ar[53]={5.7158,6.3394,7.5204,8.6525,9.7528,10.82,11.849,12.836,13.78,17.904,21.07,23.375,24.999,26.928,27.889,28.361,28.559,28.592,28.521,28.381,27.228,25.869,24.541,23.299,21.103,19.255,17.686,16.346,15.19,14.183,13.3,10.137,8.2021,6.9062,5.9819,4.757,3.9841,3.4523,3.0636,2.7668,2.5324,2.3425,1.7573,1.4546,1.2694,1.1448,0.98872,0.8962,0.83601,0.79448,0.76464,0.74259,0.72575};
     145  AddData(E,G4_WATER_Ar,factor);
    158146
    159147  if(corr) {
  • trunk/source/processes/electromagnetic/standard/src/G4WentzelVIModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4WentzelVIModel.cc,v 1.16 2008/11/19 11:47:50 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4WentzelVIModel.cc,v 1.32 2009/05/10 16:09:29 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    5252//
    5353
    54 
    5554//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    5655//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    6059#include "G4LossTableManager.hh"
    6160#include "G4ParticleChangeForMSC.hh"
    62 #include "G4TransportationManager.hh"
    63 #include "G4SafetyHelper.hh"
    6461#include "G4PhysicsTableHelper.hh"
    6562#include "G4ElementVector.hh"
     
    7168
    7269//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     70
     71G4double G4WentzelVIModel::ScreenRSquare[] = {0.0};
     72G4double G4WentzelVIModel::FormFactor[]    = {0.0};
    7373
    7474using namespace std;
     
    9696  thePositron = G4Positron::Positron();
    9797  theProton   = G4Proton::Proton();
    98   a0 = alpha2*electron_mass_c2*electron_mass_c2/(0.885*0.885);
     98  lowEnergyLimit = 0.1*keV;
    9999  G4double p0 = electron_mass_c2*classic_electr_radius;
    100100  coeff  = twopi*p0*p0;
    101   constn = 6.937e-6/(MeV*MeV);
    102101  tkin = targetZ = mom2 = DBL_MIN;
    103102  ecut = etag = DBL_MAX;
     
    106105  xsecn.resize(nelments);
    107106  prob.resize(nelments);
    108   for(size_t j=0; j<100; j++) {
    109     FF[j]    = 0.0;
    110   }
     107
     108  // Thomas-Fermi screening radii
     109  // Formfactors from A.V. Butkevich et al., NIM A 488 (2002) 282
     110
     111  if(0.0 == ScreenRSquare[0]) {
     112    G4double a0 = electron_mass_c2/0.88534;
     113    G4double constn = 6.937e-6/(MeV*MeV);
     114
     115    ScreenRSquare[0] = alpha2*a0*a0;
     116    for(G4int j=1; j<100; j++) {
     117      G4double x = a0*fNistManager->GetZ13(j);
     118      ScreenRSquare[j] = alpha2*x*x;
     119      x = fNistManager->GetA27(j);
     120      FormFactor[j] = constn*x*x;
     121    }
     122  }
    111123}
    112124
     
    132144  if(!isInitialized) {
    133145    isInitialized = true;
    134 
    135     if (pParticleChange)
    136       fParticleChange = reinterpret_cast<G4ParticleChangeForMSC*>(pParticleChange);
    137     else
    138       fParticleChange = new G4ParticleChangeForMSC();
    139 
    140     safetyHelper = G4TransportationManager::GetTransportationManager()
    141       ->GetSafetyHelper();
    142     safetyHelper->InitialiseHelper();
     146    fParticleChange = GetParticleChangeForMSC();
     147    InitialiseSafetyHelper();
    143148  }
    144149}
     
    156161  SetupKinematic(ekin, cutEnergy);
    157162  SetupTarget(Z, ekin);
    158   G4double xsec = ComputeTransportXSectionPerVolume();
     163  G4double xsec = ComputeTransportXSectionPerAtom();
    159164  /* 
    160165  G4cout << "CS: e= " << tkin << " cosEl= " << cosTetMaxElec2
     
    167172//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    168173
    169 G4double G4WentzelVIModel::ComputeTransportXSectionPerVolume()
     174G4double G4WentzelVIModel::ComputeTransportXSectionPerAtom()
    170175{
    171176  G4double xSection = 0.0;
     
    189194      y = 0.0;
    190195    }
    191     xSection += y/targetZ;
    192   }
    193   /*
    194   G4cout << "G4WentzelVIModel:XS per A " << " Z= " << Z << " e(MeV)= " << kinEnergy/MeV
     196    xSection = y;
     197  }
     198  /* 
     199  G4cout << "G4WentzelVI:XS per A " << " Z= " << targetZ
     200         << " e(MeV)= " << tkin/MeV << " XSel= " << xSection
    195201         << " cut(MeV)= " << ecut/MeV 
    196202         << " zmaxE= " << (1.0 - cosTetMaxElec)/screenZ
    197          << " zmaxN= " << (1.0 - cosTetMsxNuc)/screenZ << G4endl;
     203         << " zmaxN= " << (1.0 - cosTetMaxNuc2)/screenZ
     204         << " costm= " << cosTetMaxNuc2 << G4endl;
    198205  */
    199 
    200206  // scattering off nucleus
    201207  if(cosTetMaxNuc2 < 1.0) {
    202208    x  = 1.0 - cosTetMaxNuc2;
    203209    x1 = screenZ*formfactA;
    204     x2 = 1.0/(1.0 - x1);
     210    x2 = 1.0 - x1;
    205211    x3 = x/screenZ;
    206212    x4 = formfactA*x;
    207213    // low-energy limit
    208214    if(x3 < numlimit && x1 < numlimit) {
    209       y = 0.5*x3*x3*x2*x2*x2*(1.0 - 1.333333*x3 + 1.5*x3*x3 - 1.5*x1
    210                               + 3.0*x1*x1 + 2.666666*x3*x1);
     215      y = 0.5*x3*x3*(1.0 - 1.3333333*x3 + 1.5*x3*x3 - 1.5*x1
     216                     + 3.0*x1*x1 + 2.666666*x3*x1)/(x2*x2*x2);
    211217      // high energy limit
    212     } else if(1.0 < x1) {
     218    } else if(x2 <= 0.0) {
    213219      x4 = x1*(1.0 + x3);
    214220      y  = x3*(1.0 + 0.5*x3 - (2.0 - x1)*(1.0 + x3 + x3*x3/3.0)/x4)/(x4*x4);
     
    216222    } else {
    217223      y = ((1.0 + x1)*x2*log((1. + x3)/(1. + x4))
    218            - x3/(1. + x3) - x4/(1. + x4))*x2*x2;
    219     }
     224           - x3/(1. + x3) - x4/(1. + x4))/(x2*x2);
     225    }
     226    //G4cout << "y= " << y << " x1= " <<x1<<"  x2= " <<x2
     227    //     <<"  x3= "<<x3<<"  x4= " << x4<<G4endl;
    220228    if(y < 0.0) {
    221229      nwarnings++;
     
    230238      y = 0.0;
    231239    }
    232     xSection += y;
    233   }
    234   xSection *= (coeff*targetZ*targetZ*chargeSquare*invbeta2/mom2);
    235   //  G4cout << "   XStotal= " << xSection/barn << " screenZ= " << screenZ
    236   //     << " formF= " << formfactA << " for " << p->GetParticleName() << G4endl;
     240    xSection += y*targetZ;
     241  }
     242  xSection *= kinFactor;
     243  /*
     244  G4cout << "Z= " << targetZ << " XStot= " << xSection/barn
     245         << " screenZ= " << screenZ << " formF= " << formfactA
     246         << " for " << particle->GetParticleName()
     247         << " m= " << mass << " 1/v= " << sqrt(invbeta2) << " p= " << sqrt(mom2)
     248         << " x= " << x
     249         << G4endl;
     250  */
    237251  return xSection;
    238252}
     
    277291  // i.e. when it is needed for optimization purposes
    278292  if(stepStatus != fGeomBoundary && presafety < tlimitminfix)
    279     presafety = safetyHelper->ComputeSafety(sp->GetPosition());
     293    presafety = ComputeSafety(sp->GetPosition(), tlimit);
    280294  /*
    281295  G4cout << "G4WentzelVIModel::ComputeTruePathLengthLimit tlimit= "
     
    291305    G4double rlimit = facrange*lambda0;
    292306    G4double rcut = currentCouple->GetProductionCuts()->GetProductionCut(1);
    293     if(rcut > rlimit) rlimit = std::pow(2.0*rcut*rcut*lambda0,0.33333333);
     307    if(rcut > rlimit) rlimit = std::pow(rcut*rcut*rlimit,0.33333333);
     308    rlimit = std::min(rlimit, facgeom*currentMaterial->GetRadlen());
    294309    if(rlimit < tlimit) tlimit = rlimit;
    295310  }
     
    404419  } else {
    405420
    406     // define threshold angle as 2 sigma of central value
     421    // define threshold angle between single and multiple scattering
    407422    cosThetaMin = 1.0 - 3.0*x1;
    408423
     
    570585
    571586    if(r > tlimitminfix) {
    572       G4ThreeVector Position = *(fParticleChange->GetProposedPosition());
    573       G4double fac= 1.;
    574       if(r >= safety) {
    575         //  ******* so safety is computed at boundary too ************
    576         G4double newsafety =
    577           safetyHelper->ComputeSafety(Position) - tlimitminfix;
    578         if(newsafety <= 0.0) fac = 0.0;
    579         else if(r > newsafety) fac = newsafety/r ;
    580         //G4cout << "NewSafety= " << newsafety << " fac= " << fac
    581         // << " r= " << r << " sint= " << sint << " pos " << Position << G4endl;
    582       } 
    583 
    584       if(fac > 0.) {
    585         // compute new endpoint of the Step
    586         G4ThreeVector newPosition = Position + fac*pos;
    587 
    588         // check safety after displacement
    589         G4double postsafety = safetyHelper->ComputeSafety(newPosition);
    590 
    591         // displacement to boundary
    592         if(postsafety <= 0.0) {
    593           safetyHelper->Locate(newPosition, newDirection);
    594 
    595           // not on the boundary
    596         } else {
    597           safetyHelper->ReLocateWithinVolume(newPosition);
    598           // if(fac < 1.0) G4cout << "NewPosition " << newPosition << G4endl;
    599         }
    600      
    601         fParticleChange->ProposePosition(newPosition);
    602       }
     587      pos /= r;
     588      ComputeDisplacement(fParticleChange, pos, r, safety);
    603589    }
    604590  }
     
    624610  G4double xs = 0.0;
    625611
    626   G4double fac = coeff*chargeSquare*invbeta2/mom2;
    627 
    628612  for (G4int i=0; i<nelm; i++) {
    629613    SetupTarget((*theElementVector)[i]->GetZ(), tkin);
     
    635619    cosTetMaxNuc2  = std::max(cosnm,cosThetaMin);
    636620    cosTetMaxElec2 = std::max(cosem,cosThetaMin);
    637     xtsec += ComputeTransportXSectionPerVolume()*density;
     621    xtsec += ComputeTransportXSectionPerAtom()*density;
    638622    // return limit back
    639623    cosTetMaxElec2 = cosem;
     
    643627    G4double nsec = 0.0;
    644628    G4double x1 = 1.0 - cosThetaMin + screenZ;
    645     G4double f  = fac*targetZ*density;
     629    G4double f  = kinFactor*density;
    646630
    647631    // scattering off electrons
     
    656640      G4double s  = screenZ*formfactA;
    657641      G4double z1 = 1.0 - cosnm + screenZ;
    658       G4double d  = (1.0 - s)/formfactA;
     642      G4double s1 = 1.0 - s;
     643      G4double d  = s1/formfactA;
    659644
    660645      // check numerical limit
     
    667652        G4double x2 = x1 + d;
    668653        G4double z2 = z1 + d;
    669         nsec = (1.0 + 2.0*s)*((cosThetaMin - cosnm)*(1.0/(x1*z1) + 1.0/(x2*z2)) -
    670                            2.0*log(z1*x2/(z2*x1))/d);
     654        nsec = (1.0/x1 - 1.0/z1 + 1.0/x2 - 1.0/z2 - 2.0*log(z1*x2/(z2*x1))/d)/(s1*s1);
    671655      }
    672656      nsec *= f*targetZ;
     
    801785      G4double mom22 = t1*(t1 + 2.0*mass);
    802786      G4double ctm = (mom2 + mom22 - mom21)*0.5/sqrt(mom2*mom22);
    803       if(ctm < 1.0) cosTetMaxElec = ctm;
     787      if(ctm <  1.0) cosTetMaxElec = ctm;
     788      if(ctm < -1.0) cosTetMaxElec = -1.0;
    804789    }
    805790  }
     
    808793
    809794//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    810 
    811 void G4WentzelVIModel::SampleSecondaries(std::vector<G4DynamicParticle*>*,
    812                                      const G4MaterialCutsCouple*,
    813                                      const G4DynamicParticle*,
    814                                      G4double,
    815                                      G4double)
    816 {}
    817 
    818 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
  • trunk/source/processes/electromagnetic/standard/src/G4eBremsstrahlung.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eBremsstrahlung.cc,v 1.55 2008/11/14 19:23:07 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4eBremsstrahlung.cc,v 1.56 2009/02/20 12:06:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    104104//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    105105
     106G4bool G4eBremsstrahlung::IsApplicable(const G4ParticleDefinition& p)
     107{
     108  return (&p == G4Electron::Electron() || &p == G4Positron::Positron());
     109}
     110
     111//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     112
    106113void G4eBremsstrahlung::InitialiseEnergyLossProcess(
    107114                                                const G4ParticleDefinition* p,
  • trunk/source/processes/electromagnetic/standard/src/G4eBremsstrahlungModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eBremsstrahlungModel.cc,v 1.43 2008/11/13 19:28:58 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4eBremsstrahlungModel.cc,v 1.44 2009/04/09 18:41:18 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    160160  }
    161161  if(isInitialised) return;
    162 
    163   if(pParticleChange) {
    164     fParticleChange = reinterpret_cast<G4ParticleChangeForLoss*>(pParticleChange);
    165   } else {
    166     fParticleChange = new G4ParticleChangeForLoss();
    167   }
     162  fParticleChange = GetParticleChangeForLoss();
    168163  isInitialised = true;
    169164}
  • trunk/source/processes/electromagnetic/standard/src/G4eBremsstrahlungRelModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eBremsstrahlungRelModel.cc,v 1.12 2008/11/13 23:28:27 schaelic Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4eBremsstrahlungRelModel.cc,v 1.14 2009/04/09 18:41:18 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    178178
    179179  if(isInitialised) return;
    180 
    181   if(pParticleChange) {
    182     fParticleChange = reinterpret_cast<G4ParticleChangeForLoss*>(pParticleChange);
    183   } else {
    184     fParticleChange = new G4ParticleChangeForLoss();
    185   }
     180  fParticleChange = GetParticleChangeForLoss();
    186181  isInitialised = true;
    187182}
  • trunk/source/processes/electromagnetic/standard/src/G4eCoulombScatteringModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eCoulombScatteringModel.cc,v 1.59 2008/10/22 18:39:29 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4eCoulombScatteringModel.cc,v 1.69 2009/05/10 16:09:29 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    6666//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    6767
     68G4double G4eCoulombScatteringModel::ScreenRSquare[] = {0.0};
     69G4double G4eCoulombScatteringModel::FormFactor[]    = {0.0};
     70
    6871using namespace std;
    6972
     
    8487  currentMaterial = 0;
    8588  currentElement  = 0;
    86   a0 = alpha2*electron_mass_c2*electron_mass_c2/(0.885*0.885);
     89  lowEnergyLimit = keV;
    8790  G4double p0 = electron_mass_c2*classic_electr_radius;
    8891  coeff  = twopi*p0*p0;
    89   constn = 6.937e-6/(MeV*MeV);
    9092  tkin = targetZ = mom2 = DBL_MIN;
    9193  elecXSection = nucXSection = 0.0;
    92   recoilThreshold = DBL_MAX;
     94  recoilThreshold = 100.*keV;
    9395  ecut = DBL_MAX;
    9496  particle = 0;
    9597  currentCouple = 0;
    96   for(size_t j=0; j<100; j++) {
    97     FF[j] = 0.0;
    98   }
     98
     99  // Thomas-Fermi screening radii
     100  // Formfactors from A.V. Butkevich et al., NIM A 488 (2002) 282
     101
     102  if(0.0 == ScreenRSquare[0]) {
     103    G4double a0 = electron_mass_c2/0.88534;
     104    G4double constn = 6.937e-6/(MeV*MeV);
     105
     106    ScreenRSquare[0] = alpha2*a0*a0;
     107    for(G4int j=1; j<100; j++) {
     108      G4double x = a0*fNistManager->GetZ13(j);
     109      ScreenRSquare[j] = alpha2*x*x;
     110      x = fNistManager->GetA27(j);
     111      FormFactor[j] = constn*x*x;
     112    }
     113  }
    99114}
    100115
     
    121136  if(!isInitialised) {
    122137    isInitialised = true;
    123 
    124     if(pParticleChange)
    125       fParticleChange =
    126         reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange);
    127     else
    128       fParticleChange = new G4ParticleChangeForGamma();
     138    fParticleChange = GetParticleChangeForGamma();
    129139  }
    130140  if(mass < GeV && particle->GetParticleType() != "nucleus") {
     
    157167      G4double ctm = (mom2 + mom22 - mom21)*0.5/sqrt(mom2*mom22);
    158168      //G4cout << "ctm= " << ctm << G4endl;
    159       if(ctm < 1.0) cosTetMaxElec = ctm;
     169      if(ctm <  1.0) cosTetMaxElec = ctm;
     170      if(ctm < -1.0) cosTetMaxElec = -1.0;
    160171    }
    161172  }
     
    196207{
    197208  // This method needs initialisation before be called
    198 
    199   G4double fac = coeff*targetZ*chargeSquare*invbeta2/mom2;
     209  G4double fac = coeff*targetZ*chargeSquare*kinFactor;
    200210  elecXSection = 0.0;
    201211  nucXSection  = 0.0;
     
    216226    G4double s  = screenZ*formfactA;
    217227    G4double z1 = 1.0 - cosTetMaxNuc2 + screenZ;
    218     G4double d  = (1.0 - s)/formfactA;
     228    G4double s1 = 1.0 - s;
     229    G4double d  = s1/formfactA;
    219230    //G4cout <<"x1= "<<x1<<" z1= " <<z1<<" s= "<<s << " d= " <<d <<G4endl;
    220231    if(d < 0.2*x1) {
     
    226237      G4double x2 = x1 + d;
    227238      G4double z2 = z1 + d;
    228       x = (1.0 + 2.0*s)*((cosTetMinNuc - cosTetMaxNuc2)*(1.0/(x1*z1) + 1.0/(x2*z2)) -
    229                          2.0*log(z1*x2/(z2*x1))/d);
     239      x = (1.0/x1 - 1.0/z1 + 1.0/x2 - 1.0/z2 - 2.0*log(z1*x2/(z2*x1))/d)/(s1*s1);
    230240    }
    231241    nucXSection += fac*targetZ*x;
    232242  }
    233 
    234243  //G4cout<<" cross(bn)= "<<nucXSection/barn<<" xsElec(bn)= "<<elecXSection/barn
    235244  //    << " Asc= " << screenZ << G4endl;
     
    283292    G4int ia = SelectIsotopeNumber(currentElement);
    284293    G4double Trec = z1*mom2/(amu_c2*G4double(ia));
    285     G4double th =
    286       std::min(recoilThreshold,
    287                targetZ*currentElement->GetIonisation()->GetMeanExcitationEnergy());
    288 
    289     if(Trec > th) {
    290       G4int iz = G4int(targetZ);
     294
     295    if(Trec > recoilThreshold) {
    291296      G4ParticleDefinition* ion = theParticleTable->FindIon(iz, ia, 0, iz);
    292297      Trec = z1*mom2/ion->GetPDGMass();
  • trunk/source/processes/electromagnetic/standard/src/G4eIonisation.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eIonisation.cc,v 1.56 2008/10/20 08:56:41 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4eIonisation.cc,v 1.57 2009/02/20 12:06:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    103103//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    104104
     105G4double G4eIonisation::MinPrimaryEnergy(const G4ParticleDefinition*,
     106                                         const G4Material*,
     107                                         G4double cut)
     108{
     109  G4double x = cut;
     110  if(isElectron) x += cut;
     111  return x;
     112}
     113
     114//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     115
     116G4bool G4eIonisation::IsApplicable(const G4ParticleDefinition& p)
     117{
     118  return (&p == G4Electron::Electron() || &p == G4Positron::Positron());
     119}
     120
     121//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     122
    105123void G4eIonisation::InitialiseEnergyLossProcess(
    106124                    const G4ParticleDefinition* part,
  • trunk/source/processes/electromagnetic/standard/src/G4eeToTwoGammaModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eeToTwoGammaModel.cc,v 1.14 2007/05/23 08:47:35 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4eeToTwoGammaModel.cc,v 1.15 2009/04/09 18:41:18 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    102102{
    103103  if(isInitialised) return;
    104 
    105   if(pParticleChange)
    106     fParticleChange =
    107       reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange);
    108   else
    109     fParticleChange = new G4ParticleChangeForGamma();
    110 
     104  fParticleChange = GetParticleChangeForGamma();
    111105  isInitialised = true;
    112106}
  • trunk/source/processes/electromagnetic/standard/src/G4eplusAnnihilation.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eplusAnnihilation.cc,v 1.29 2008/10/15 17:53:44 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4eplusAnnihilation.cc,v 1.30 2009/02/20 12:06:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    7979//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    8080
     81G4bool G4eplusAnnihilation::IsApplicable(const G4ParticleDefinition& p)
     82{
     83  return (&p == G4Positron::Positron());
     84}
     85
     86//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     87
     88G4double G4eplusAnnihilation::AtRestGetPhysicalInteractionLength(
     89                              const G4Track&, G4ForceCondition* condition)
     90{
     91  *condition = NotForced;
     92  return 0.0;
     93}
     94
     95//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     96
    8197void G4eplusAnnihilation::InitialiseProcess(const G4ParticleDefinition*)
    8298{
  • trunk/source/processes/electromagnetic/standard/src/G4hIonisation.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4hIonisation.cc,v 1.81 2008/10/22 16:02:20 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4hIonisation.cc,v 1.82 2009/02/20 12:06:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    122122{}
    123123
     124//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     125
     126G4bool G4hIonisation::IsApplicable(const G4ParticleDefinition& p)
     127{
     128  return (p.GetPDGCharge() != 0.0 && p.GetPDGMass() > 10.0*MeV &&
     129         !p.IsShortLived());
     130}
     131
     132//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     133
     134G4double G4hIonisation::MinPrimaryEnergy(const G4ParticleDefinition*,
     135                                         const G4Material*,
     136                                         G4double cut)
     137{
     138  G4double x = 0.5*cut/electron_mass_c2;
     139  G4double g = x*ratio + std::sqrt((1. + x)*(1. + x*ratio*ratio));
     140  return mass*(g - 1.0);
     141}
     142
    124143//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 
    125144
  • trunk/source/processes/electromagnetic/standard/src/G4ionIonisation.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4ionIonisation.cc,v 1.65 2008/10/15 17:53:44 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4ionIonisation.cc,v 1.66 2009/02/20 12:06:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    104104//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    105105
     106G4bool G4ionIonisation::IsApplicable(const G4ParticleDefinition& p)
     107{
     108  return (p.GetPDGCharge() != 0.0 && !p.IsShortLived() &&
     109          p.GetParticleType() == "nucleus");
     110}
     111
     112//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     113
     114G4double G4ionIonisation::MinPrimaryEnergy(const G4ParticleDefinition* p,
     115                                           const G4Material*,
     116                                           G4double cut)
     117{
     118  return
     119    p->GetPDGMass()*(std::sqrt(1. + 0.5*cut/CLHEP::electron_mass_c2) - 1.0);
     120}
     121
     122//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     123
    106124void G4ionIonisation::InitialiseEnergyLossProcess(
    107125                      const G4ParticleDefinition* part,
Note: See TracChangeset for help on using the changeset viewer.