Ignore:
Timestamp:
Nov 5, 2010, 3:45:55 PM (14 years ago)
Author:
garnier
Message:

update ti head

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

Legend:

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

    r1315 r1340  
    1 $Id: History,v 1.504 2010/06/04 09:25:12 vnivanch Exp $
     1$Id: History,v 1.514 2010/11/04 17:31:43 vnivanch Exp $
    22-------------------------------------------------------------------
    33
     
    1717     * Reverse chronological order (last date on top), please *
    1818     ----------------------------------------------------------
     19
     2004 November 2010: V.Ivant (emstand-V09-03-25)
     21- Fixed warnings of the Coverity tool (pedantic initialisation);
     22
     2326 October 2010: V.Ivant (emstand-V09-03-24)
     24- Fixed problem reported by the Coverity tool (mainly pedantic
     25  initialisation);
     26- G4BetheHeitlerModel, G4PairProductionRelModel - removed unused
     27  internal table of cross section
     28- G4WaterStopping - fixed bug in index of data for Fe ion
     29
     3014 October 2010: V.Ivant (emstand-V09-03-23)
     31- G4ModifiedTsai - added (moved from lowenergy)
     32- G4PairProductionRelModel, G4eBremsstrahlungRelModel - return back
     33     the version of 9.4beta (disable tag 21); use general interface
     34     to sample polar angular distribution (G4ModifiedTsai - default)
     35
     3628 September 2010: V.Ivant (emstand-V09-03-22)
     37- G4ionIonisation, G4alphaIonisation - removed obsolete nuclear stopping
     38      flag and Get/Set methods (nuclear stopping is simulated by the
     39      dedicated G4NuclearStopping process)
     40
     4112 September 2010: V.Ivant (emstand-V09-03-21)
     42- G4BetheBlochModel - fixed shell corrections
     43- G4PairProductionRelModel, G4eBremsstrahlungRelModel - fixed
     44     SetCurrentElement method, fix is important for unit tests
     45
     4612 August 2010: V.Ivant (emstand-V09-03-20)
     47- G4UniversalFluctuation - L.Urban revision of width correction
     48  providing better results for thin targets and a good tail 
     49
     5014 June 2010:  V.Ivant (emstand-V09-03-19)
     51- G4UniversalFluctuation93 new class keeping version of the release 9.3
     52  for the G4UniversalFluctuation
     53- G4UniversalFluctuation - improved comments
     54
     5511 June 2010:  V.Ivant (emstand-V09-03-18)
     56- G4UniversalFluctuation - L.Urban fixed anomaly at the tail of
     57                           distribution for thin targets
    1958
    20594 June 2010:  V.Ivant (emstand-V09-03-17)
  • trunk/source/processes/electromagnetic/standard/include/G4BetheHeitlerModel.hh

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4BetheHeitlerModel.hh,v 1.6 2007/05/22 17:34:36 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4BetheHeitlerModel.hh,v 1.9 2010/10/26 10:35:22 vnivanch Exp $
     27// GEANT4 tag $Name: emstand-V09-03-24 $
    2828//
    2929// -------------------------------------------------------------------
     
    6363
    6464  G4BetheHeitlerModel(const G4ParticleDefinition* p = 0,
    65                       const G4String& nam = "Bethe-Heitler");
     65                      const G4String& nam = "BetheHeitler");
    6666 
    6767  virtual ~G4BetheHeitlerModel();
     
    9797  G4ParticleDefinition*     thePositron;
    9898  G4ParticleChangeForGamma* fParticleChange;
    99   G4PhysicsTable*           theCrossSectionTable;
    100 
    101   G4double                  lowGammaEnergy;
    102   G4double                  highGammaEnergy;
    103 
    104   G4int                     nbins;
    105   size_t                    indexZ[120];
    106  
    10799};
    108100
  • trunk/source/processes/electromagnetic/standard/include/G4CoulombScattering.hh

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4CoulombScattering.hh,v 1.14 2010/02/17 18:59:22 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4CoulombScattering.hh,v 1.15 2010/10/25 19:13:23 vnivanch Exp $
     27// GEANT4 tag $Name: emstand-V09-03-24 $
    2828//
    2929// -------------------------------------------------------------------
     
    9393  G4double thEnergyElec;
    9494  G4bool isInitialised;
    95   G4bool buildElmTableFlag;
    9695  const G4ParticleDefinition* aParticle;
    9796
  • trunk/source/processes/electromagnetic/standard/include/G4PAIySection.hh

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4PAIySection.hh,v 1.1 2007/10/01 17:45:14 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4PAIySection.hh,v 1.2 2010/11/04 17:30:31 vnivanch Exp $
     28// GEANT4 tag $Name: emstand-V09-03-25 $
    2929//
    3030//
     
    110110  // Inline access functions
    111111
    112   G4int GetNumberOfGammas() const { return fNumberOfGammas ; }
    113          
    114   G4int GetSplineSize() const { return fSplineNumber ; }
    115          
    116   G4int GetIntervalNumber() const { return fIntervalNumber ; }
    117 
    118   G4double GetEnergyInterval(G4int i){ return fEnergyInterval[i] ; }
    119 
    120   G4double GetDifPAIySection(G4int i){ return fDifPAIySection[i] ; }
    121   G4double GetPAIdNdxCrenkov(G4int i){ return fdNdxCerenkov[i] ; }
    122   G4double GetPAIdNdxPlasmon(G4int i){ return fdNdxPlasmon[i] ; }
    123          
    124   G4double GetMeanEnergyLoss() const {return fIntegralPAIySection[0] ; }
    125   G4double GetMeanCerenkovLoss() const {return fIntegralCerenkov[0] ; }
    126   G4double GetMeanPlasmonLoss() const {return fIntegralPlasmon[0] ; }
    127 
    128   G4double GetNormalizationCof() const { return fNormalizationCof ; }
     112  inline G4int GetNumberOfGammas() const { return fNumberOfGammas ; }
     113         
     114  inline G4int GetSplineSize() const { return fSplineNumber ; }
     115         
     116  inline G4int GetIntervalNumber() const { return fIntervalNumber ; }
     117
     118  inline G4double GetEnergyInterval(G4int i){ return fEnergyInterval[i] ; }
     119
     120  inline G4double GetDifPAIySection(G4int i){ return fDifPAIySection[i] ; }
     121  inline G4double GetPAIdNdxCrenkov(G4int i){ return fdNdxCerenkov[i] ; }
     122  inline G4double GetPAIdNdxPlasmon(G4int i){ return fdNdxPlasmon[i] ; }
     123         
     124  inline G4double GetMeanEnergyLoss() const {return fIntegralPAIySection[0] ; }
     125  inline G4double GetMeanCerenkovLoss() const {return fIntegralCerenkov[0] ; }
     126  inline G4double GetMeanPlasmonLoss() const {return fIntegralPlasmon[0] ; }
     127
     128  inline G4double GetNormalizationCof() const { return fNormalizationCof ; }
    129129         
    130130  inline G4double GetPAItable(G4int i,G4int j) const ;
    131131
    132   inline G4double    GetLorentzFactor(G4int i) const ;
     132  inline G4double GetLorentzFactor(G4int i) const ;
    133133                 
    134134  inline G4double GetSplineEnergy(G4int i) const ;
     
    185185  G4double   fPAItable[500][112] ;         // Output array
    186186
    187 } ;   
     187};
    188188
    189189////////////////  Inline methods //////////////////////////////////
  • trunk/source/processes/electromagnetic/standard/include/G4PairProductionRelModel.hh

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PairProductionRelModel.hh,v 1.3 2009/06/04 13:45:53 gunter Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4PairProductionRelModel.hh,v 1.9 2010/10/26 10:35:22 vnivanch Exp $
     27// GEANT4 tag $Name: emstand-V09-03-24 $
    2828//
    2929// -------------------------------------------------------------------
     
    6464
    6565  G4PairProductionRelModel(const G4ParticleDefinition* p = 0,
    66                       const G4String& nam = "Bethe-Heitler");
     66                           const G4String& nam = "BetheHeitlerLPM");
    6767 
    6868  virtual ~G4PairProductionRelModel();
     
    8888
    8989  // * fast inline functions *
    90   inline void SetCurrentElement(const G4double);
     90  inline void SetCurrentElement(G4double /*Z*/);
    9191
    9292  // set / get methods
     
    110110  G4double ScreenFunction2(G4double ScreenVariable);
    111111
    112 
    113 
    114 
    115112  G4double ComputeXSectionPerAtom(G4double totalEnergy, G4double Z);
    116113
     
    128125  G4ParticleDefinition*     thePositron;
    129126  G4ParticleChangeForGamma* fParticleChange;
    130   G4PhysicsTable*           theCrossSectionTable;
    131 
    132   G4double                  lowGammaEnergy;
    133   G4double                  highGammaEnergy;
    134 
    135   G4int                     nbins;
    136   size_t                    indexZ[120];
    137127
    138128  G4double fLPMconstant;
     
    196186//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    197187
    198 inline void G4PairProductionRelModel::SetCurrentElement(const G4double Z)
     188inline void G4PairProductionRelModel::SetCurrentElement(G4double Z)
    199189{
    200190  if(Z != currentZ) {
     
    214204      Finel = facFinel - 2.*lnZ/3. ;
    215205    }
    216 
    217206    fCoulomb=GetCurrentElement()->GetfCoulomb();
    218207  }
    219208}
     209
    220210//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    221211
  • trunk/source/processes/electromagnetic/standard/include/G4UniversalFluctuation.hh

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4UniversalFluctuation.hh,v 1.10 2009/03/19 14:15:17 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4UniversalFluctuation.hh,v 1.12 2010/08/08 08:19:59 urban Exp $
     27// GEANT4 tag $Name: emstand-V09-03-24 $
    2828//
    2929// -------------------------------------------------------------------
     
    3434// File name:     G4UniversalFluctuation
    3535//
    36 // Author:        Vladimir Ivanchenko
     36// Author:        V.Ivanchenko make a class with the Laszlo Urban model
    3737//
    3838// Creation date: 03.01.2002
     
    110110  G4double ipotLogFluct;
    111111  G4double e0;
     112  G4double esmall;
    112113
    113114  G4double e1,e2;
     
    116117  G4double theBohrBeta2;
    117118  G4double minLoss;
    118   G4double nmaxCont1;
    119   G4double nmaxCont2;
     119  G4double nmaxCont;
     120  G4double rate,fw;
     121
    120122
    121123};
  • trunk/source/processes/electromagnetic/standard/include/G4alphaIonisation.hh

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4alphaIonisation.hh,v 1.1 2009/11/10 11:50:30 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4alphaIonisation.hh,v 1.3 2010/10/26 10:06:12 vnivanch Exp $
     27// GEANT4 tag $Name: emstand-V09-03-24 $
    2828//
    2929// -------------------------------------------------------------------
     
    7171  virtual void PrintInfo();
    7272
    73   void ActivateNuclearStopping(G4bool);
    74 
    7573protected:
    7674
     
    8280
    8381  inline G4double BetheBlochEnergyThreshold();
    84 
    85   inline G4bool NuclearStoppingFlag();
    8682
    8783private:
     
    9894
    9995  G4bool     isInitialised;
    100   G4bool     nuclearStopping;
    10196};
    10297
    10398//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    104 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    105 
    106 inline void G4alphaIonisation::ActivateNuclearStopping(G4bool val)
    107 {
    108   nuclearStopping = val;
    109 }
    110 
    11199//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    112100
     
    118106//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    119107
    120 inline G4bool G4alphaIonisation::NuclearStoppingFlag()
    121 {
    122   return nuclearStopping;
    123 }
    124 
    125 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    126 
    127108#endif
  • trunk/source/processes/electromagnetic/standard/include/G4eBremsstrahlungRelModel.hh

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eBremsstrahlungRelModel.hh,v 1.11 2009/02/20 12:06:37 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4eBremsstrahlungRelModel.hh,v 1.14 2010/10/26 10:35:22 vnivanch Exp $
     27// GEANT4 tag $Name: emstand-V09-03-24 $
    2828//
    2929// -------------------------------------------------------------------
     
    6565
    6666  G4eBremsstrahlungRelModel(const G4ParticleDefinition* p = 0,
    67                             const G4String& nam = "eBremRel");
     67                            const G4String& nam = "eBremLPM");
    6868
    6969  virtual ~G4eBremsstrahlungRelModel();
     
    159159
    160160private:
     161
    161162  // consts
    162   G4double highKinEnergy;
    163163  G4double lowKinEnergy;
    164164  G4double fMigdalConstant;
     
    195195    }
    196196
    197     fCoulomb=GetCurrentElement()->GetfCoulomb();
    198     fMax   = Fel-fCoulomb + Finel/currentZ  +  (1.+1./currentZ)/12.;
     197    fCoulomb = GetCurrentElement()->GetfCoulomb();
     198    fMax = Fel-fCoulomb + Finel/currentZ  +  (1.+1./currentZ)/12.;
    199199  }
    200200}
  • trunk/source/processes/electromagnetic/standard/include/G4eMultipleScattering.hh

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eMultipleScattering.hh,v 1.3 2009/11/01 13:04:12 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4eMultipleScattering.hh,v 1.4 2010/10/26 10:39:02 vnivanch Exp $
     27// GEANT4 tag $Name: emstand-V09-03-24 $
    2828//
    2929// -----------------------------------------------------------------------------
     
    6464public:    // with description
    6565
    66   G4eMultipleScattering(const G4String& processName="msc");
     66  G4eMultipleScattering(const G4String& processName = "msc");
    6767
    6868  virtual ~G4eMultipleScattering();
     
    7575
    7676  // geom. step length distribution should be sampled or not
    77   void Setsamplez(G4bool value) { samplez = value;};
     77  //void Setsamplez(G4bool value) { samplez = value;};
    7878
    7979  // to reduce the energy/step dependence
    80   void Setdtrl(G4double value) { dtrl = value;};
     80  //void Setdtrl(G4double value) { dtrl = value;};
    8181
    8282  // 'soften' step limitation above lambdalimit
    83   void SetLambdalimit(G4double value) { lambdalimit = value;};
     83  //void SetLambdalimit(G4double value) { lambdalimit = value;};
    8484
    8585protected:
     
    9090private:        // data members
    9191
    92   G4double lambdalimit;
    93   G4double dtrl;
     92  //  G4double lambdalimit;
     93  //G4double dtrl;
    9494
    95   G4bool   samplez;
     95  //G4bool   samplez;
    9696  G4bool   isInitialized;
    9797
  • trunk/source/processes/electromagnetic/standard/include/G4ionIonisation.hh

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4ionIonisation.hh,v 1.57 2009/02/20 12:06:37 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4ionIonisation.hh,v 1.58 2010/09/28 15:50:00 vnivanch Exp $
     27// GEANT4 tag $Name: emstand-V09-03-24 $
    2828//
    2929// -------------------------------------------------------------------
     
    9595  void ActivateStoppingData(G4bool);
    9696
    97   void ActivateNuclearStopping(G4bool);
    98 
    9997protected:
    10098
     
    106104
    107105  inline G4double BetheBlochEnergyThreshold();
    108 
    109   inline G4bool NuclearStoppingFlag();
    110106
    111107private:
     
    123119  G4bool     isInitialised;
    124120  G4bool     stopDataActive;
    125   G4bool     nuclearStopping;
    126121};
    127122
     
    136131//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    137132
    138 inline void G4ionIonisation::ActivateNuclearStopping(G4bool val)
    139 {
    140   nuclearStopping = val;
    141 }
    142 
    143 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    144 
    145133inline G4double G4ionIonisation::BetheBlochEnergyThreshold()
    146134{
     
    150138//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    151139
    152 inline G4bool G4ionIonisation::NuclearStoppingFlag()
    153 {
    154   return nuclearStopping;
    155 }
    156 
    157 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    158 
    159140#endif
  • trunk/source/processes/electromagnetic/standard/src/G4BetheBlochModel.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4BetheBlochModel.cc,v 1.37 2010/05/27 10:25:59 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4BetheBlochModel.cc,v 1.40 2010/11/04 17:30:31 vnivanch Exp $
     27// GEANT4 tag $Name: emstand-V09-03-25 $
    2828//
    2929// -------------------------------------------------------------------
     
    8282{
    8383  fParticleChange = 0;
     84  theElectron = G4Electron::Electron();
    8485  if(p) {
    8586    SetGenericIon(p);
    8687    SetParticle(p);
    87   }
    88   theElectron = G4Electron::Electron();
     88  } else {
     89    SetParticle(theElectron);
     90  }
    8991  corr = G4LossTableManager::Instance()->EmCorrections(); 
    9092  nist = G4NistManager::Instance();
     
    117119  //     << G4endl;
    118120
    119   corrFactor = chargeSquare;
    120121  // always false before the run
    121122  SetDeexcitationFlag(false);
     
    157158  G4double q = particle->GetPDGCharge()/eplus;
    158159  chargeSquare = q*q;
     160  corrFactor = chargeSquare;
    159161  ratio = electron_mass_c2/mass;
    160162  G4double magmom =
     
    275277
    276278  // shell correction
    277   dedx -= 2.0*corr->ShellCorrection(p,material,kineticEnergy);
     279  //dedx -= 2.0*corr->ShellCorrection(p,material,kineticEnergy);
     280  dedx -= corr->ShellCorrection(p,material,kineticEnergy);
    278281
    279282  // now compute the total ionization loss
    280 
    281   if (dedx < 0.0) dedx = 0.0 ;
    282 
    283283  dedx *= twopi_mc2_rcl2*chargeSquare*eDensity/beta2;
    284284
     
    289289    dedx += corr->HighOrderCorrections(p,material,kineticEnergy,cutEnergy);
    290290  }
     291
     292  if (dedx < 0.0) { dedx = 0.0; }
    291293  return dedx;
    292294}
  • trunk/source/processes/electromagnetic/standard/src/G4BetheHeitlerModel.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4BetheHeitlerModel.cc,v 1.13 2009/04/09 18:41:18 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4BetheHeitlerModel.cc,v 1.15 2010/10/25 19:02:32 vnivanch Exp $
     27// GEANT4 tag $Name: emstand-V09-03-24 $
    2828//
    2929// -------------------------------------------------------------------
     
    4343// 16-11-05 replace shootBit() by G4UniformRand()  mma
    4444// 04-12-05 SetProposedKineticEnergy(0.) for the killed photon (mma)
    45 // 20-02-20 SelectRandomElement is called for any initial gamma energy
     45// 20-02-07 SelectRandomElement is called for any initial gamma energy
    4646//          in order to have selected element for polarized model (VI)
     47// 25-10-10 Removed unused table, added element selector (VI)
    4748//
    4849// Class Description:
     
    5859#include "G4Gamma.hh"
    5960#include "Randomize.hh"
    60 #include "G4DataVector.hh"
    61 #include "G4PhysicsLogVector.hh"
    6261#include "G4ParticleChangeForGamma.hh"
    63 #include "G4LossTableManager.hh"
    6462
    6563//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    6967G4BetheHeitlerModel::G4BetheHeitlerModel(const G4ParticleDefinition*,
    7068                                         const G4String& nam)
    71   : G4VEmModel(nam),
    72     theCrossSectionTable(0),
    73     nbins(10)
     69  : G4VEmModel(nam)
    7470{
    7571  fParticleChange = 0;
     
    8278
    8379G4BetheHeitlerModel::~G4BetheHeitlerModel()
    84 {
    85   if(theCrossSectionTable) {
    86     theCrossSectionTable->clearAndDestroy();
    87     delete theCrossSectionTable;
    88   }
    89 }
    90 
    91 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    92 
    93 void G4BetheHeitlerModel::Initialise(const G4ParticleDefinition*,
    94                                      const G4DataVector&)
    95 {
    96   if(!fParticleChange) fParticleChange = GetParticleChangeForGamma();
    97 
    98   if(theCrossSectionTable) {
    99     theCrossSectionTable->clearAndDestroy();
    100     delete theCrossSectionTable;
    101   }
    102 
    103   const G4ElementTable* theElementTable = G4Element::GetElementTable();
    104   size_t nvect = G4Element::GetNumberOfElements();
    105   theCrossSectionTable = new G4PhysicsTable(nvect);
    106   G4PhysicsLogVector* ptrVector;
    107   G4double emin = LowEnergyLimit();
    108   G4double emax = HighEnergyLimit();
    109   G4int n = nbins*G4int(log10(emax/emin));
    110   G4bool spline = G4LossTableManager::Instance()->SplineFlag();
    111   G4double e, value;
    112 
    113   for(size_t j=0; j<nvect ; j++) {
    114 
    115     ptrVector  = new G4PhysicsLogVector(emin, emax, n);
    116     ptrVector->SetSpline(spline);
    117     G4double Z = (*theElementTable)[j]->GetZ();
    118     G4int   iz = G4int(Z);
    119     indexZ[iz] = j;
    120  
    121     for(G4int i=0; i<nbins; i++) {
    122       e = ptrVector->GetLowEdgeEnergy( i ) ;
    123       value = ComputeCrossSectionPerAtom(theGamma, e, Z); 
    124       ptrVector->PutValue( i, value );
    125     }
    126 
    127     theCrossSectionTable->insert(ptrVector);
    128   }
    129 }
    130 
    131 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    132 
    133 G4double G4BetheHeitlerModel::ComputeCrossSectionPerAtom(
    134                                                    const G4ParticleDefinition*,
    135                                               G4double GammaEnergy, G4double Z,
    136                                               G4double, G4double, G4double)
     80{}
     81
     82//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     83
     84void G4BetheHeitlerModel::Initialise(const G4ParticleDefinition* p,
     85                                     const G4DataVector& cuts)
     86{
     87  if(!fParticleChange) { fParticleChange = GetParticleChangeForGamma(); }
     88  InitialiseElementSelectors(p, cuts);
     89}
     90
     91//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     92
     93G4double
     94G4BetheHeitlerModel::ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
     95                                                G4double GammaEnergy, G4double Z,
     96                                                G4double, G4double, G4double)
    13797// Calculates the microscopic cross section in GEANT4 internal units.
    13898// A parametrized formula from L. Urban is used to estimate
     
    144104  static const G4double GammaEnergyLimit = 1.5*MeV;
    145105  G4double CrossSection = 0.0 ;
    146   if ( Z < 1. ) return CrossSection;
    147   if ( GammaEnergy <= 2.0*electron_mass_c2 ) return CrossSection;
     106  if ( Z < 0.9 || GammaEnergy <= 2.0*electron_mass_c2 ) { return CrossSection; }
    148107
    149108  static const G4double
     
    160119
    161120  G4double GammaEnergySave = GammaEnergy;
    162   if (GammaEnergy < GammaEnergyLimit) GammaEnergy = GammaEnergyLimit ;
     121  if (GammaEnergy < GammaEnergyLimit) { GammaEnergy = GammaEnergyLimit; }
    163122
    164123  G4double X=log(GammaEnergy/electron_mass_c2), X2=X*X, X3=X2*X, X4=X3*X, X5=X4*X;
     
    177136  }
    178137
    179   if (CrossSection < 0.) CrossSection = 0.;
     138  if (CrossSection < 0.) { CrossSection = 0.; }
    180139  return CrossSection;
    181140}
     
    208167  G4double epsil ;
    209168  G4double epsil0 = electron_mass_c2/GammaEnergy ;
    210   if(epsil0 > 1.0) return;
     169  if(epsil0 > 1.0) { return; }
    211170
    212171  // do it fast if GammaEnergy < 2. MeV
     
    225184    // Extract Coulomb factor for this Element
    226185    G4double FZ = 8.*(anElement->GetIonisation()->GetlogZ3());
    227     if (GammaEnergy > 50.*MeV) FZ += 8.*(anElement->GetfCoulomb());
     186    if (GammaEnergy > 50.*MeV) { FZ += 8.*(anElement->GetfCoulomb()); }
    228187
    229188    // limits of the screening variable
     
    334293
    335294//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    336 
    337 
  • trunk/source/processes/electromagnetic/standard/src/G4BohrFluctuations.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4BohrFluctuations.cc,v 1.8 2009/09/29 11:33:22 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4BohrFluctuations.cc,v 1.9 2010/10/25 18:23:36 vnivanch Exp $
     27// GEANT4 tag $Name: emstand-V09-03-24 $
    2828//
    2929// -------------------------------------------------------------------
     
    6767  xmin(0.2),
    6868  minLoss(0.001*eV)
    69 {}
     69{
     70  particleMass   = proton_mass_c2;
     71  chargeSquare   = 1.0;
     72  kineticEnergy  = 0.0;
     73  beta2          = 0.0;
     74}
    7075
    7176//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    9297                                                      G4double& meanLoss)
    9398{
    94   if(meanLoss <= minLoss) return meanLoss;
     99  if(meanLoss <= minLoss) { return meanLoss; }
    95100  G4double siga = Dispersion(material,dp,tmax,length);
    96101  G4double loss = meanLoss;
     
    142147                                        G4double& length)
    143148{
    144   if(!particle) InitialiseMe(dp->GetDefinition());
     149  if(!particle) { InitialiseMe(dp->GetDefinition()); }
    145150
    146151  G4double electronDensity = material->GetElectronDensity();
  • trunk/source/processes/electromagnetic/standard/src/G4BraggIonModel.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4BraggIonModel.cc,v 1.27 2009/11/22 18:00:23 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4BraggIonModel.cc,v 1.30 2010/11/04 17:30:31 vnivanch Exp $
     27// GEANT4 tag $Name: emstand-V09-03-25 $
    2828//
    2929// -------------------------------------------------------------------
     
    8181    isInitialised(false)
    8282{
    83   if(p) SetParticle(p);
    8483  SetHighEnergyLimit(2.0*MeV);
    8584
     
    9089  theZieglerFactor = eV*cm2*1.0e-15;
    9190  theElectron      = G4Electron::Electron();
     91  corrFactor       = 1.0;
     92  if(p) { SetParticle(p); }
     93  else  { SetParticle(theElectron); }
    9294}
    9395
     
    110112                                 const G4DataVector&)
    111113{
    112   if(p != particle) SetParticle(p);
     114  if(p != particle) { SetParticle(p); }
    113115
    114116  corrFactor = chargeSquare;
     
    122124    G4String pname = particle->GetParticleName();
    123125    if(particle->GetParticleType() == "nucleus" &&
    124        pname != "deuteron" && pname != "triton") isIon = true;
     126       pname != "deuteron" && pname != "triton") { isIon = true; }
    125127
    126128    corr = G4LossTableManager::Instance()->EmCorrections();
  • trunk/source/processes/electromagnetic/standard/src/G4BraggModel.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4BraggModel.cc,v 1.26 2010/06/04 09:08:43 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4BraggModel.cc,v 1.28 2010/11/04 17:30:31 vnivanch Exp $
     27// GEANT4 tag $Name: emstand-V09-03-25 $
    2828//
    2929// -------------------------------------------------------------------
     
    8484    isInitialised(false)
    8585{
    86   if(p) SetParticle(p);
    8786  SetHighEnergyLimit(2.0*MeV);
    8887
     
    9089  theZieglerFactor = eV*cm2*1.0e-15;
    9190  theElectron = G4Electron::Electron();
     91  expStopPower125 = 0.0;
    9292
    9393  corr = G4LossTableManager::Instance()->EmCorrections();
     94  if(p) { SetParticle(p); }
     95  else  { SetParticle(theElectron); }
    9496}
    9597
  • trunk/source/processes/electromagnetic/standard/src/G4IonFluctuations.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4IonFluctuations.cc,v 1.26 2009/03/31 13:24:40 toshito Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4IonFluctuations.cc,v 1.27 2010/10/25 19:13:23 vnivanch Exp $
     27// GEANT4 tag $Name: emstand-V09-03-24 $
    2828//
    2929// -------------------------------------------------------------------
     
    8080    xmin(0.2),
    8181    minLoss(0.001*eV)
    82 {}
     82{
     83  kineticEnergy = 0.0;
     84  beta2 = 0.0;
     85}
    8386
    8487//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
  • trunk/source/processes/electromagnetic/standard/src/G4PAIModel.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PAIModel.cc,v 1.52 2010/06/03 07:28:39 grichine Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4PAIModel.cc,v 1.54 2010/11/04 17:30:32 vnivanch Exp $
     27// GEANT4 tag $Name: emstand-V09-03-25 $
    2828//
    2929// -------------------------------------------------------------------
     
    8181  fBg2lim(0.0169),
    8282  fTaulim(8.4146e-3)
    83 {
    84   if(p) SetParticle(p);
    85  
     83
    8684  fElectron = G4Electron::Electron();
    8785  fPositron = G4Positron::Positron();
     
    9391  fLambdaVector      = 0;
    9492  fdNdxCutVector     = 0;
     93  fParticleEnergyVector = 0;
     94  fSandiaIntervalNumber = 0;
     95  fMatIndex = 0;
     96  fDeltaCutInKinEnergy = 0.0;
     97
     98  if(p) { SetParticle(p); }
     99  else  { SetParticle(fElectron); }
    95100
    96101  isInitialised      = false;
     
    132137void G4PAIModel::SetParticle(const G4ParticleDefinition* p)
    133138{
    134   if(fParticle == p) return;
     139  if(fParticle == p) { return; }
    135140  fParticle = p;
    136141  fMass = fParticle->GetPDGMass();
     
    141146  fRatio = electron_mass_c2/fMass;
    142147  fQc = fMass/fRatio;
     148  fLowestKineticEnergy  = fMass*(fLowestGamma  - 1.0);
     149  fHighestKineticEnergy = fMass*(fHighestGamma - 1.0);
    143150}
    144151
     
    148155                            const G4DataVector&)
    149156{
    150   G4cout<<"G4PAIModel::Initialise for "<<p->GetParticleName()<<G4endl;
    151   if(isInitialised) return;
     157  //G4cout<<"G4PAIModel::Initialise for "<<p->GetParticleName()<<G4endl;
     158  if(isInitialised) { return; }
    152159  isInitialised = true;
    153160
    154161  SetParticle(p);
    155   fLowestKineticEnergy  = fMass*(fLowestGamma  - 1.0);
    156   fHighestKineticEnergy = fMass*(fHighestGamma - 1.0);
    157162
    158163  fParticleEnergyVector = new G4PhysicsLogVector(fLowestKineticEnergy,
     
    213218void G4PAIModel::ComputeSandiaPhotoAbsCof()
    214219{
    215   G4int i, j, numberOfElements ;
    216   static const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
     220  G4int i, j;
     221  const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
    217222
    218223  G4SandiaTable thisMaterialSandiaTable(fMatIndex) ;
    219   numberOfElements = (*theMaterialTable)[fMatIndex]->
    220                                               GetNumberOfElements();
     224  G4int numberOfElements =
     225    (*theMaterialTable)[fMatIndex]->GetNumberOfElements();
     226
    221227  G4int* thisMaterialZ = new G4int[numberOfElements] ;
    222228
     
    236242  fSandiaPhotoAbsCof = new G4double*[fSandiaIntervalNumber] ;
    237243
    238   for(i=0;i<fSandiaIntervalNumber;i++)  fSandiaPhotoAbsCof[i] = new G4double[5] ;
     244  for(i=0; i<fSandiaIntervalNumber; i++) 
     245  {
     246    fSandiaPhotoAbsCof[i] = new G4double[5];
     247  }
    239248   
    240249  for( i = 0 ; i < fSandiaIntervalNumber ; i++ )
    241250  {
    242     fSandiaPhotoAbsCof[i][0] = thisMaterialSandiaTable.GetPhotoAbsorpCof(i+1,0) ;
     251    fSandiaPhotoAbsCof[i][0] = thisMaterialSandiaTable.GetPhotoAbsorpCof(i+1,0);
    243252
    244253    for( j = 1; j < 5 ; j++ )
    245254    {
    246       fSandiaPhotoAbsCof[i][j] = thisMaterialSandiaTable.
    247                                       GetPhotoAbsorpCof(i+1,j)*
     255      fSandiaPhotoAbsCof[i][j] = thisMaterialSandiaTable.GetPhotoAbsorpCof(i+1,j)*
    248256                 (*theMaterialTable)[fMatIndex]->GetDensity() ;
    249257    }
    250258  }
    251   // delete[] thisMaterialZ ;
     259  delete[] thisMaterialZ;
    252260}
    253261
     
    307315    ionloss = fPAIySection.GetMeanEnergyLoss() ;   //  total <dE/dx>
    308316
    309     if ( ionloss < DBL_MIN)  ionloss = DBL_MIN;
     317    if ( ionloss < DBL_MIN) { ionloss = 0.0; }
    310318    fdEdxVector->PutValue(i,ionloss) ;
    311319
  • trunk/source/processes/electromagnetic/standard/src/G4PAIPhotonModel.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PAIPhotonModel.cc,v 1.24 2010/06/03 07:28:39 grichine Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4PAIPhotonModel.cc,v 1.25 2010/10/26 09:16:50 vnivanch Exp $
     27// GEANT4 tag $Name: emstand-V09-03-24 $
    2828//
    2929// -------------------------------------------------------------------
     
    8383  fTaulim(8.4146e-3)
    8484{
    85   if(p) SetParticle(p);
    86 
    8785  fVerbose  = 0;
    8886  fElectron = G4Electron::Electron();
     
    9088
    9189  fProtonEnergyVector = new G4PhysicsLogVector(fLowestKineticEnergy,
    92                                                            fHighestKineticEnergy,
    93                                                            fTotBin);
     90                                               fHighestKineticEnergy,
     91                                               fTotBin);
    9492  fPAItransferTable     = 0;
    9593  fPAIphotonTable       = 0;
     
    104102  fdNdxCutPhotonVector  = 0;
    105103  fdNdxCutPlasmonVector = 0;
     104
     105  fSandiaIntervalNumber = 0;
     106  fMatIndex = 0;
     107
     108  if(p) { SetParticle(p); }
     109  else  { SetParticle(fElectron); }
    106110
    107111  isInitialised      = false;
     
    161165                                   const G4DataVector&)
    162166{
    163   G4cout<<"G4PAIPhotonModel::Initialise for "<<p->GetParticleName()<<G4endl;
    164   if(isInitialised) return;
     167  //  G4cout<<"G4PAIPhotonModel::Initialise for "<<p->GetParticleName()<<G4endl;
     168  if(isInitialised) { return; }
    165169  isInitialised = true;
    166170
     
    229233{
    230234  G4int i, j, numberOfElements ;
    231   static const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
     235  const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
    232236
    233237  G4SandiaTable thisMaterialSandiaTable(fMatIndex) ;
     
    264268    }
    265269  }
    266   // delete[] thisMaterialZ ;
     270  delete[] thisMaterialZ ;
    267271}
    268272
  • trunk/source/processes/electromagnetic/standard/src/G4PAIySection.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4PAIySection.cc,v 1.4 2009/07/26 15:51:01 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4PAIySection.cc,v 1.6 2010/11/04 17:30:32 vnivanch Exp $
     27// GEANT4 tag $Name: emstand-V09-03-25 $
    2928//
    3029//
     
    7069
    7170G4PAIySection::G4PAIySection()
    72 {}
     71{
     72  fSandia = 0;
     73  fDensity = fElectronDensity = fNormalizationCof = 0.0;
     74  fIntervalNumber = fSplineNumber = 0;
     75}
    7376
    7477////////////////////////////////////////////////////////////////////////////
  • trunk/source/processes/electromagnetic/standard/src/G4PairProductionRelModel.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PairProductionRelModel.cc,v 1.3 2009/05/15 17:12:33 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4PairProductionRelModel.cc,v 1.4 2010/10/26 09:06:04 vnivanch Exp $
     27// GEANT4 tag $Name: emstand-V09-03-24 $
    2828//
    2929// -------------------------------------------------------------------
     
    8585                                         const G4String& nam)
    8686  : G4VEmModel(nam),
    87     theCrossSectionTable(0),
    88     nbins(10),
    8987    fLPMconstant(fine_structure_const*electron_mass_c2*electron_mass_c2/(4.*pi*hbarc)*0.5),
    9088    fLPMflag(true),
     
    9997  nist = G4NistManager::Instance(); 
    10098
     99  currentZ = z13 = z23 = lnZ = Fel = Finel = fCoulomb = phiLPM = gLPM = xiLPM = 0;
     100
    101101}
    102102
     
    104104
    105105G4PairProductionRelModel::~G4PairProductionRelModel()
    106 {
    107   if(theCrossSectionTable) {
    108     theCrossSectionTable->clearAndDestroy();
    109     delete theCrossSectionTable;
    110   }
    111 }
    112 
    113 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    114 
    115 void G4PairProductionRelModel::Initialise(const G4ParticleDefinition*,
    116                                           const G4DataVector&)
    117 {
    118   fParticleChange = GetParticleChangeForGamma();
    119 
    120   if(theCrossSectionTable) {
    121     theCrossSectionTable->clearAndDestroy();
    122     delete theCrossSectionTable;
    123   }
    124 
    125   const G4ElementTable* theElementTable = G4Element::GetElementTable();
    126   size_t nvect = G4Element::GetNumberOfElements();
    127   theCrossSectionTable = new G4PhysicsTable(nvect);
    128   G4PhysicsLogVector* ptrVector;
    129   G4double emin = LowEnergyLimit();
    130   G4double emax = HighEnergyLimit();
    131   G4int n = nbins*G4int(log10(emax/emin));
    132   G4bool spline = G4LossTableManager::Instance()->SplineFlag();
    133   G4double e, value;
    134 
    135   for(size_t j=0; j<nvect ; j++) {
    136 
    137     ptrVector  = new G4PhysicsLogVector(emin, emax, n);
    138     ptrVector->SetSpline(spline);
    139     G4double Z = (*theElementTable)[j]->GetZ();
    140     G4VEmModel::SetCurrentElement((*theElementTable)[j]);
    141     G4int   iz = G4int(Z);
    142     indexZ[iz] = j;
    143  
    144     for(G4int i=0; i<nbins; i++) {
    145       e = ptrVector->GetLowEdgeEnergy( i ) ;
    146       value = ComputeCrossSectionPerAtom(theGamma, e, Z); 
    147       ptrVector->PutValue( i, value );
    148     }
    149 
    150     theCrossSectionTable->insert(ptrVector);
    151   }
    152 }
    153 
    154 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    155 /*
    156 G4double G4PairProductionRelModel::ComputeRelXSectionPerAtom(G4double k, G4double Z)
    157 {
    158 
    159   G4double cross = 0.0;
    160  
    161 
    162 
    163 
    164 }
    165 */
     106{}
     107
     108//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     109
     110void G4PairProductionRelModel::Initialise(const G4ParticleDefinition* p,
     111                                          const G4DataVector& cuts)
     112{
     113  if(!fParticleChange) { fParticleChange = GetParticleChangeForGamma(); }
     114  InitialiseElementSelectors(p, cuts);
     115}
    166116
    167117//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    340290  //  static const G4double gammaEnergyLimit = 1.5*MeV;
    341291  G4double crossSection = 0.0 ;
    342   if ( Z < 1. ) return crossSection;
     292  if ( Z < 0.9 ) return crossSection;
    343293  if ( gammaEnergy <= 2.0*electron_mass_c2 ) return crossSection;
    344294
  • trunk/source/processes/electromagnetic/standard/src/G4UniversalFluctuation.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4UniversalFluctuation.cc,v 1.22 2009/03/20 18:11:23 urban Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4UniversalFluctuation.cc,v 1.28 2010/10/26 10:06:12 vnivanch Exp $
     27// GEANT4 tag $Name: emstand-V09-03-24 $
    2828//
    2929// -------------------------------------------------------------------
     
    3434// File name:     G4UniversalFluctuation
    3535//
    36 // Author:        Vladimir Ivanchenko
     36// Author:        Laszlo Urban
    3737//
    3838// Creation date: 03.01.2002
     
    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 // 19-03-09 new width correction (does not depend on previous steps) (L.Urban)         
     59// 19-03-09 new width correction (does not depend on previous steps) (L.Urban)
    6060// 20-03-09 modification in the width correction (L.Urban)
     61// 14-06-10 fixed tail distribution - do not use uniform function (L.Urban)
     62// 08-08-10 width correction algorithm has bee modified -->
     63//          better results for thin targets (L.Urban)
    6164//
    6265
     
    8285  theBohrBeta2(50.0*keV/proton_mass_c2),
    8386  minLoss(10.*eV),
    84   nmaxCont1(4.),
    85   nmaxCont2(16.)
     87  nmaxCont(16.),
     88  rate(0.55),
     89  fw(4.)
    8690{
    8791  lastMaterial = 0;
     92
     93  particleMass = chargeSquare = ipotFluct = electronDensity = f1Fluct = f2Fluct
     94    = e1Fluct = e2Fluct = e1LogFluct = e2LogFluct = ipotLogFluct = e0 = esmall
     95    = e1 = e2 = 0;
    8896}
    8997
     
    118126  // shortcut for very very small loss (out of validity of the model)
    119127  //
    120   if (meanLoss < minLoss)
    121     return meanLoss;
    122 
    123   if(!particle) InitialiseMe(dp->GetDefinition());
     128  if (meanLoss < minLoss) { return meanLoss; }
     129
     130  if(!particle) { InitialiseMe(dp->GetDefinition()); }
    124131
    125132  G4double tau   = dp->GetKineticEnergy()/particleMass;
     
    174181    ipotLogFluct = material->GetIonisation()->GetLogMeanExcEnergy();
    175182    e0 = material->GetIonisation()->GetEnergy0fluct();
     183    esmall = 0.5*sqrt(e0*ipotFluct); 
    176184    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);
     185   
    188186  }
    189187
     
    193191  G4double a1 = 0. , a2 = 0., a3 = 0. ;
    194192
    195   // cut and material dependent rate
    196   G4double rate = 1.0;
    197193  if(tmax > ipotFluct) {
    198194    G4double w2 = log(2.*electron_mass_c2*beta2*gam2)-beta2;
    199195
    200     if(w2 > ipotLogFluct && w2 > e2LogFluct) {
    201 
    202       rate = 0.03+0.23*log(log(tmax/ipotFluct));
     196    if(w2 > ipotLogFluct && w2 > e2LogFluct && tmax> ipotFluct)  {
    203197      G4double C = meanLoss*(1.-rate)/(w2-ipotLogFluct);
    204198      a1 = C*f1Fluct*(w2-e1LogFluct)/e1Fluct;
    205199      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)
     200         
     201
     202  if(a1 < nmaxCont)
     203  {
     204    //small energy loss
     205    G4double sa1 = sqrt(a1);
     206    if(G4UniformRand() < exp(-sa1))
    210207      {
    211         width = 3.1623/sqrt(meanLoss/e1Fluct);
    212         if(width < a2/a1)
    213         width = a2/a1;
     208       e1 = esmall;
     209       a1 = meanLoss*(1.-rate)/e1;
     210       a2 = 0.;
     211       e2 = e2Fluct;
    214212      }
    215       a1 *= width;
    216       e1 = e1Fluct/width;
     213      else
     214      {
     215       a1 = sa1 ;   
     216       e1 = sa1*e1Fluct;
     217       e2 = e2Fluct;
     218      }
     219    }
     220    else
     221    {
     222      //not small energy loss
     223      //correction to get better fwhm value
     224      a1 /= fw;
     225      e1 = fw*e1Fluct;
    217226      e2 = e2Fluct;
    218227    }
    219   }
     228  }   
     229 }
    220230
    221231  G4double w1 = tmax/e0;
     
    223233    a3 = rate*meanLoss*(tmax-e0)/(e0*tmax*log(w1));
    224234
    225   //'nearly' Gaussian fluctuation if a1>nmaxCont2&&a2>nmaxCont2&&a3>nmaxCont2 
     235  //'nearly' Gaussian fluctuation if a1>nmaxCont&&a2>nmaxCont&&a3>nmaxCont 
    226236  G4double emean = 0.;
    227237  G4double sig2e = 0., sige = 0.;
     
    229239 
    230240  // excitation of type 1
    231   if(a1 > nmaxCont2)
     241  if(a1 > nmaxCont)
    232242  {
    233243    emean += a1*e1;
     
    243253
    244254  // excitation of type 2
    245   if(a2 > nmaxCont2)
     255  if(a2 > nmaxCont)
    246256  {
    247257    emean += a2*e2;
     
    262272    p3 = a3;
    263273    G4double alfa = 1.;
    264     if(a3 > nmaxCont2)
     274    if(a3 > nmaxCont)
    265275    {
    266        alfa            = w1*(nmaxCont2+a3)/(w1*nmaxCont2+a3);
     276       alfa            = w1*(nmaxCont+a3)/(w1*nmaxCont+a3);
    267277       G4double alfa1  = alfa*log(alfa)/(alfa-1.);
    268278       G4double namean = a3*w1*(alfa-1.)/((w1-1.)*alfa);
  • trunk/source/processes/electromagnetic/standard/src/G4UrbanMscModel90.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4UrbanMscModel90.cc,v 1.13 2009/04/10 18:10:58 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4UrbanMscModel90.cc,v 1.14 2010/10/26 10:06:12 vnivanch Exp $
     27// GEANT4 tag $Name: emstand-V09-03-24 $
    2828//
    2929// -------------------------------------------------------------------
     
    9393  inside        = false; 
    9494  insideskin    = false;
     95
     96  skindepth = skin*stepmin;
     97
     98  mass = proton_mass_c2;
     99  charge = 1.0;
     100  currentKinEnergy = currentRange = currentRadLength = masslimite = masslimitmu
     101    = lambda0 = lambdaeff = tPathLength = zPathLength = par1 = par2 = par3 = 0;
     102
     103  currentMaterialIndex = 0;
    95104}
    96105
     
    105114                                   const G4DataVector&)
    106115{
    107   skindepth     = skin*stepmin;
     116  skindepth = skin*stepmin;
    108117  if(isInitialized) return;
    109118
  • trunk/source/processes/electromagnetic/standard/src/G4UrbanMscModel92.cc

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4UrbanMscModel92.cc,v 1.1 2009/11/01 13:05:01 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4UrbanMscModel92.cc,v 1.2 2010/10/26 10:06:12 vnivanch Exp $
     28// GEANT4 tag $Name: emstand-V09-03-24 $
    2929//
    3030// -------------------------------------------------------------------
     
    166166  insideskin    = false;
    167167
     168  skindepth = skin*stepmin;
     169
     170  mass = proton_mass_c2;
     171  charge = ChargeSquare = 1.0;
     172  currentKinEnergy = currentRadLength = lambda0 = lambdaeff = tPathLength
     173    = zPathLength = par1 = par2 = par3 = 0;
     174
     175  currentMaterialIndex = 0;
    168176}
    169177
  • trunk/source/processes/electromagnetic/standard/src/G4UrbanMscModel93.cc

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4UrbanMscModel93.cc,v 1.5 2010/06/25 09:41:44 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4UrbanMscModel93.cc,v 1.7 2010/11/04 17:30:32 vnivanch Exp $
     28// GEANT4 tag $Name: emstand-V09-03-25 $
    2929//
    3030// -------------------------------------------------------------------
     
    166166  insideskin    = false;
    167167
     168  skindepth = skin*stepmin;
     169
     170  mass = proton_mass_c2;
     171  charge = ChargeSquare = 1.0;
     172  currentKinEnergy = currentRadLength = lambda0 = lambdaeff = tPathLength
     173    = zPathLength = par1 = par2 = par3 = 0;
     174
     175  currentMaterialIndex = -1;
    168176}
    169177
     
    179187{
    180188  skindepth = skin*stepmin;
    181   if(isInitialized) return;
     189
     190  if(isInitialized) { return; }
    182191  // set values of some data members
    183192  SetParticle(p);
     
    460469
    461470  // stop here if small range particle
    462   if(inside) return tPathLength;           
     471  if(inside) { return tPathLength; }           
    463472 
    464   if(tPathLength > currentRange) tPathLength = currentRange;
     473  if(tPathLength > currentRange) { tPathLength = currentRange; }
    465474
    466475  presafety = sp->GetSafety();
    467476
    468  // G4cout << "G4Urban2::StepLimit tPathLength= "
    469  //      <<tPathLength<<" safety= " << presafety
    470  //        << " range= " <<currentRange<< " lambda= "<<lambda0
    471  //      << " Alg: " << steppingAlgorithm <<G4endl;
     477  // G4cout << "G4Urban2::StepLimit tPathLength= "
     478  //     <<tPathLength<<" safety= " << presafety
     479  //        << " range= " <<currentRange<< " lambda= "<<lambda0
     480  //     << " Alg: " << steppingAlgorithm <<G4endl;
    472481
    473482  // far from geometry boundary
  • trunk/source/processes/electromagnetic/standard/src/G4WaterStopping.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4WaterStopping.cc,v 1.21 2010/04/26 17:44:34 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4WaterStopping.cc,v 1.22 2010/10/26 10:06:12 vnivanch Exp $
     27// GEANT4 tag $Name: emstand-V09-03-24 $
    2828
    2929//---------------------------------------------------------------------------
     
    6868{
    6969  G4double res = 0.0;
    70   if((iz > 26) || (iz < 3) || (iz > 18 && iz < 26)) { return res; }
    7170  G4int idx = iz - 3;
     71
     72  if(iz == 26) { idx = 16; }
     73  else if (iz < 3 || iz > 18) { return res; }
     74
    7275  G4double scaledEnergy = energy/A[idx];
    7376  if(scaledEnergy < emin) {
  • trunk/source/processes/electromagnetic/standard/src/G4WentzelOKandVIxSection.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4WentzelOKandVIxSection.cc,v 1.10 2010/06/01 13:34:21 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4WentzelOKandVIxSection.cc,v 1.12 2010/11/04 17:30:32 vnivanch Exp $
     27// GEANT4 tag $Name: emstand-V09-03-25 $
    2828//
    2929// -------------------------------------------------------------------
     
    9393    }
    9494  }
     95  currentMaterial = 0;
     96  elecXSRatio = factB = formfactA = screenZ = 0.0;
     97  cosTetMaxElec = cosTetMaxNuc = invbeta2 = kinFactor = 1.0;
     98
     99  Initialise(theElectron, 1.0);
     100  SetTargetMass(proton_mass_c2);
    95101}
    96102
  • trunk/source/processes/electromagnetic/standard/src/G4WentzelVIModel.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4WentzelVIModel.cc,v 1.60 2010/06/01 11:13:31 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4WentzelVIModel.cc,v 1.61 2010/10/26 10:06:12 vnivanch Exp $
     27// GEANT4 tag $Name: emstand-V09-03-24 $
    2828//
    2929// -------------------------------------------------------------------
     
    8989  fG4pow = G4Pow::GetInstance();
    9090  wokvi = new G4WentzelOKandVIxSection();
     91
     92  preKinEnergy = tPathLength = zPathLength = lambdaeff = currentRange = xtsec = 0;
     93  currentMaterialIndex = 0;
     94  cosThetaMax = cosTetMaxNuc = 1.0;
    9195}
    9296
  • trunk/source/processes/electromagnetic/standard/src/G4alphaIonisation.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4alphaIonisation.cc,v 1.1 2009/11/10 11:50:30 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4alphaIonisation.cc,v 1.3 2010/10/26 10:06:12 vnivanch Exp $
     27// GEANT4 tag $Name: emstand-V09-03-24 $
    2828//
    2929// -------------------------------------------------------------------
     
    6464  : G4VEnergyLossProcess(name),
    6565    theParticle(0),
    66     isInitialised(false),
    67     nuclearStopping(true)
     66    isInitialised(false)
    6867{
    6968  //  SetLinearLossLimit(0.15);
     
    7473  mass = 0.0;
    7574  ratio = 0.0;
     75  eth = 8*MeV;
    7676}
    7777
     
    8585G4bool G4alphaIonisation::IsApplicable(const G4ParticleDefinition& p)
    8686{
    87   return (p.GetPDGCharge() == 2*eplus);
     87  return (!p.IsShortLived() &&
     88          std::fabs(p.GetPDGCharge() - 2*CLHEP::eplus) < 0.01);
    8889}
    8990
     
    122123    SetSecondaryParticle(G4Electron::Electron());
    123124
    124     if (!EmModel(1)) SetEmModel(new G4BraggIonModel(), 1);
     125    if (!EmModel(1)) { SetEmModel(new G4BraggIonModel(), 1); }
    125126    EmModel(1)->SetLowEnergyLimit(MinKinEnergy());
    126127
     
    129130    EmModel(1)->SetHighEnergyLimit(eth);
    130131
    131     if (!FluctModel()) SetFluctModel(new G4UniversalFluctuation());
     132    if (!FluctModel()) { SetFluctModel(new G4UniversalFluctuation()); }
    132133    AddEmModel(1, EmModel(1), new G4IonFluctuations());
    133134
    134     if (!EmModel(2)) SetEmModel(new G4BetheBlochModel(),2); 
     135    if (!EmModel(2)) { SetEmModel(new G4BetheBlochModel(),2); } 
    135136    EmModel(2)->SetLowEnergyLimit(eth);
    136137    EmModel(2)->SetHighEnergyLimit(MaxKinEnergy());
     
    139140    isInitialised = true;
    140141  }
    141   // reinitialisation of corrections for the new run
    142   EmModel(1)->ActivateNuclearStopping(nuclearStopping);
    143   EmModel(2)->ActivateNuclearStopping(nuclearStopping);
    144142}
    145143
     
    147145
    148146void G4alphaIonisation::PrintInfo()
    149 {
    150   if (G4Alpha::Alpha() == theParticle) {
    151     if(EmModel(1) && EmModel(2)) {
    152       G4cout << "      NuclearStopping= " << nuclearStopping
    153              << G4endl;
    154     }
    155   }
    156 }
     147{}
    157148
    158149//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
  • trunk/source/processes/electromagnetic/standard/src/G4eBremsstrahlungModel.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eBremsstrahlungModel.cc,v 1.46 2010/04/28 18:39:40 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4eBremsstrahlungModel.cc,v 1.48 2010/10/26 10:35:22 vnivanch Exp $
     27// GEANT4 tag $Name: emstand-V09-03-24 $
    2828//
    2929// -------------------------------------------------------------------
     
    5555// 15-02-07  correct LPMconstant by a factor 2, thanks to G. Depaola (mma)
    5656// 09-09-08  MigdalConstant increased in (2pi)^2 times (A.Schaelicke)
     57// 13-10-10  Add angular distributon interface (VI)
    5758//
    5859// Class Description:
     
    7576#include "G4DataVector.hh"
    7677#include "G4ParticleChangeForLoss.hh"
     78#include "G4ModifiedTsai.hh"
    7779
    7880//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    9092    isInitialised(false)
    9193{
    92   if(p) SetParticle(p);
     94  if(p) { SetParticle(p); }
    9395  theGamma = G4Gamma::Gamma();
    9496  minThreshold = 0.1*keV;
     97  SetAngularDistribution(new G4ModifiedTsai());
     98  highKinEnergy = HighEnergyLimit();
     99  lowKinEnergy  = LowEnergyLimit();
    95100}
    96101
     
    129134                                        const G4DataVector& cuts)
    130135{
    131   if(p) SetParticle(p);
     136  if(p) { SetParticle(p); }
    132137  highKinEnergy = HighEnergyLimit();
    133138  lowKinEnergy  = LowEnergyLimit();
     
    172177                                                   G4double cutEnergy)
    173178{
    174   if(!particle) SetParticle(p);
    175   if(kineticEnergy < lowKinEnergy) return 0.0;
     179  if(!particle) { SetParticle(p); }
     180  if(kineticEnergy < lowKinEnergy) { return 0.0; }
    176181
    177182  const G4double thigh = 100.*GeV;
     
    272277    dedx += loss;
    273278  }
    274   if(dedx < 0.) dedx = 0.;
     279  if(dedx < 0.) { dedx = 0.; }
    275280  return dedx;
    276281}
     
    413418                                                    G4double maxEnergy)
    414419{
    415   if(!particle) SetParticle(p);
     420  if(!particle) { SetParticle(p); }
    416421  G4double cross = 0.0;
    417422  G4double tmax = min(maxEnergy, kineticEnergy);
    418423  G4double cut  = max(cutEnergy, minThreshold);
    419   if(cut >= tmax) return cross;
     424  if(cut >= tmax) { return cross; }
    420425
    421426  const G4ElementVector* theElementVector = material->GetElementVector();
     
    495500{
    496501  G4double cross = 0.0 ;
    497   if ( kineticEnergy < 1*keV || kineticEnergy < cut) return cross;
     502  if ( kineticEnergy < 1*keV || kineticEnergy < cut) { return cross; }
    498503
    499504  static const G4double ksi=2.0, alfa=1.00;
     
    664669  G4double kineticEnergy = dp->GetKineticEnergy();
    665670  G4double tmax = min(maxEnergy, kineticEnergy);
    666   if(tmin >= tmax) return;
     671  if(tmin >= tmax) { return; }
    667672
    668673//
     
    709714  G4double xmax     = tmax/kineticEnergy;
    710715  G4double kappa    = 0.0;
    711   if(xmax >= 1.) xmax = 1.;
    712   else     kappa    = log(xmax)/log(xmin);
     716  if(xmax >= 1.) { xmax = 1.; }
     717  else   { kappa    = log(xmax)/log(xmin); }
    713718  G4double epsilmin = tmin/totalEnergy;
    714719  G4double epsilmax = tmax/totalEnergy;
     
    812817      } while( greject < G4UniformRand()*grejmax );
    813818    }
    814     /*
    815     if(x > 0.999) {
    816       G4cout << "### G4eBremsstrahlungModel Warning: e= " << kineticEnergy
    817              << " tlow= " << tlow
    818              << " x= " << x
    819              << " greject= " << greject
    820              << " grejmax= " << grejmax
    821              << " migdal= " << migdal
    822              << G4endl;
    823       //      if(x >= 1.0) G4Exception("X=1");
    824     }
    825     */
    826819    gammaEnergy = x*kineticEnergy;
    827820
     
    837830
    838831  //
    839   //  angles of the emitted gamma. ( Z - axis along the parent particle)
     832  // angles of the emitted gamma. ( Z - axis along the parent particle)
     833  // use general interface
    840834  //
    841   //  universal distribution suggested by L. Urban
    842   // (Geant3 manual (1993) Phys211),
    843   //  derived from Tsai distribution (Rev Mod Phys 49,421(1977))
    844 
    845   G4double u;
    846   const G4double a1 = 0.625 , a2 = 3.*a1 , d = 27. ;
    847 
    848   if (9./(9.+d) > G4UniformRand()) u = - log(G4UniformRand()*G4UniformRand())/a1;
    849      else                          u = - log(G4UniformRand()*G4UniformRand())/a2;
    850 
    851   G4double theta = u*electron_mass_c2/totalEnergy;
     835  G4double theta = GetAngularDistribution()->PolarAngle(totalEnergy,
     836                                                        totalEnergy-gammaEnergy,
     837                                                        (G4int)anElement->GetZ());
    852838
    853839  G4double sint = sin(theta);
  • trunk/source/processes/electromagnetic/standard/src/G4eBremsstrahlungRelModel.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eBremsstrahlungRelModel.cc,v 1.15 2010/04/06 17:02:23 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4eBremsstrahlungRelModel.cc,v 1.18 2010/11/04 17:30:32 vnivanch Exp $
     27// GEANT4 tag $Name: emstand-V09-03-25 $
    2828//
    2929// -------------------------------------------------------------------
     
    4242// 13.11.08    add SetLPMflag and SetLPMconstant methods
    4343// 13.11.08    change default LPMconstant value
     44// 13.10.10    add angular distributon interface (VI)
    4445//
    4546// Main References:
     
    6566#include "G4ParticleChangeForLoss.hh"
    6667#include "G4LossTableManager.hh"
    67 
     68#include "G4ModifiedTsai.hh"
    6869
    6970//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    9091    use_completescreening(true),isInitialised(false)
    9192{
    92   if(p) SetParticle(p);
    9393  theGamma = G4Gamma::Gamma();
    9494
    9595  minThreshold = 0.1*keV;
    96   SetLowEnergyLimit(GeV); 
     96  lowKinEnergy = GeV;
     97  SetLowEnergyLimit(lowKinEnergy); 
    9798
    9899  nist = G4NistManager::Instance(); 
     100
     101  SetLPMFlag(true);
     102  SetAngularDistribution(new G4ModifiedTsai());
     103
     104  particleMass = kinEnergy = totalEnergy = currentZ = z13 = z23 = lnZ = Fel
     105    = Finel = fCoulomb = fMax = densityFactor = densityCorr = lpmEnergy
     106    = xiLPM = phiLPM = gLPM = klpm = kp = 0.0;
     107
     108  energyThresholdLPM = 1.e39;
     109
    99110  InitialiseConstants();
    100 
    101   SetLPMFlag(true);
     111  if(p) { SetParticle(p); }
    102112}
    103113
     
    125135  particle = p;
    126136  particleMass = p->GetPDGMass();
    127   if(p == G4Electron::Electron()) isElectron = true;
    128   else                            isElectron = false;
     137  if(p == G4Electron::Electron()) { isElectron = true; }
     138  else                            { isElectron = false;}
    129139}
    130140
     
    140150
    141151void G4eBremsstrahlungRelModel::SetupForMaterial(const G4ParticleDefinition*,
    142                                                  const G4Material* mat, G4double kineticEnergy)
     152                                                 const G4Material* mat,
     153                                                 G4double kineticEnergy)
    143154{
    144155  densityFactor = mat->GetElectronDensity()*fMigdalConstant;
     
    146157
    147158  // Threshold for LPM effect (i.e. below which LPM hidden by density effect)
    148   if (LPMFlag())
     159  if (LPMFlag()) {
    149160    energyThresholdLPM=sqrt(densityFactor)*lpmEnergy;
    150   else
     161  } else {
    151162     energyThresholdLPM=1.e39;   // i.e. do not use LPM effect
    152 
     163  }
    153164  // calculate threshold for density effect
    154165  kinEnergy   = kineticEnergy;
     
    168179                                           const G4DataVector& cuts)
    169180{
    170   if(p) SetParticle(p);
    171 
    172   highKinEnergy = HighEnergyLimit();
     181  if(p) { SetParticle(p); }
     182
    173183  lowKinEnergy  = LowEnergyLimit();
    174184
     
    177187  InitialiseElementSelectors(p, cuts);
    178188
    179   if(isInitialised) return;
     189  if(isInitialised) { return; }
    180190  fParticleChange = GetParticleChangeForLoss();
    181191  isInitialised = true;
     
    190200                                                   G4double cutEnergy)
    191201{
    192   if(!particle) SetParticle(p);
    193   if(kineticEnergy < lowKinEnergy) return 0.0;
     202  if(!particle) { SetParticle(p); }
     203  if(kineticEnergy < lowKinEnergy) { return 0.0; }
    194204  G4double cut = std::min(cutEnergy, kineticEnergy);
    195   if(cut == 0.0) return 0.0;
     205  if(cut == 0.0) { return 0.0; }
    196206
    197207  SetupForMaterial(particle, material,kineticEnergy);
     
    261271                                              G4double maxEnergy)
    262272{
    263   if(!particle) SetParticle(p);
    264   if(kineticEnergy < lowKinEnergy) return 0.0;
     273  if(!particle) { SetParticle(p); }
     274  if(kineticEnergy < lowKinEnergy) { return 0.0; }
    265275  G4double cut  = std::min(cutEnergy, kineticEnergy);
    266276  G4double tmax = std::min(maxEnergy, kineticEnergy);
    267277
    268   if(cut >= tmax) return 0.0;
     278  if(cut >= tmax) { return 0.0; }
    269279
    270280  SetCurrentElement(Z);
     
    273283
    274284  // allow partial integration
    275   if(tmax < kinEnergy) cross -= ComputeXSectionPerAtom(tmax);
     285  if(tmax < kinEnergy) { cross -= ComputeXSectionPerAtom(tmax); }
    276286 
    277287  cross *= Z*Z*bremFactor;
     
    390400  // *** make sure suppression is smaller than 1 ***
    391401  // *** caused by Migdal approximation in xi    ***
    392   if (xiLPM*phiLPM>1. || s>0.57)  xiLPM=1./phiLPM;
     402  if (xiLPM*phiLPM>1. || s>0.57)  { xiLPM=1./phiLPM; }
    393403}
    394404
     
    401411//    * complete screening
    402412{
    403   if(gammaEnergy < 0.0) return 0.0;
     413  if(gammaEnergy < 0.0) { return 0.0; }
    404414
    405415  G4double y = gammaEnergy/totalEnergy;
     
    429439{
    430440
    431   if(gammaEnergy < 0.0) return 0.0;
     441  if(gammaEnergy < 0.0) { return 0.0; }
    432442
    433443  G4double y = gammaEnergy/totalEnergy;
     
    465475{
    466476  G4double kineticEnergy = dp->GetKineticEnergy();
    467   if(kineticEnergy < lowKinEnergy) return;
     477  if(kineticEnergy < lowKinEnergy) { return; }
    468478  G4double cut  = std::min(cutEnergy, kineticEnergy);
    469479  G4double emax = std::min(maxEnergy, kineticEnergy);
    470   if(cut >= emax) return;
     480  if(cut >= emax) { return; }
    471481
    472482  SetupForMaterial(particle, couple->GetMaterial(),kineticEnergy);
     
    483493  //  G4double fmax= fMax;
    484494  G4bool highe = true;
    485   if(totalEnergy < energyThresholdLPM) highe = false;
     495  if(totalEnergy < energyThresholdLPM) { highe = false; }
    486496 
    487497  G4double xmin = log(cut*cut + densityCorr);
     
    507517
    508518  //
    509   //  angles of the emitted gamma. ( Z - axis along the parent particle)
     519  // angles of the emitted gamma. ( Z - axis along the parent particle)
     520  // use general interface
    510521  //
    511   //  universal distribution suggested by L. Urban
    512   // (Geant3 manual (1993) Phys211),
    513   //  derived from Tsai distribution (Rev Mod Phys 49,421(1977))
    514 
    515   G4double u;
    516   const G4double a1 = 0.625 , a2 = 3.*a1 , d = 27. ;
    517 
    518   if (9./(9.+d) > G4UniformRand()) u = - log(G4UniformRand()*G4UniformRand())/a1;
    519      else                          u = - log(G4UniformRand()*G4UniformRand())/a2;
    520 
    521   G4double theta = u*particleMass/totalEnergy;
     522  G4double theta = GetAngularDistribution()->PolarAngle(totalEnergy,
     523                                                        totalEnergy-gammaEnergy,
     524                                                        (G4int)currentZ);
     525
    522526  G4double sint = sin(theta);
    523527  G4double phi = twopi * G4UniformRand();
  • trunk/source/processes/electromagnetic/standard/src/G4eCoulombScatteringModel.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eCoulombScatteringModel.cc,v 1.89 2010/05/27 14:22:05 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4eCoulombScatteringModel.cc,v 1.90 2010/10/26 10:35:22 vnivanch Exp $
     27// GEANT4 tag $Name: emstand-V09-03-24 $
    2828//
    2929// -------------------------------------------------------------------
     
    9191  currentCouple = 0;
    9292  wokvi = new G4WentzelOKandVIxSection();
     93
     94  currentMaterialIndex = 0;
     95
     96  cosTetMinNuc = 1.0;
     97  cosTetMaxNuc = -1.0;
     98  elecRatio = 0.0;
     99  mass = proton_mass_c2;
    93100}
    94101
  • trunk/source/processes/electromagnetic/standard/src/G4hIonisation.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4hIonisation.cc,v 1.85 2010/06/04 09:22:14 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4hIonisation.cc,v 1.86 2010/10/26 10:42:04 vnivanch Exp $
     27// GEANT4 tag $Name: emstand-V09-03-24 $
    2828//
    2929// -------------------------------------------------------------------
     
    116116  mass = 0.0;
    117117  ratio = 0.0;
     118  eth = 2*MeV;
    118119}
    119120
  • trunk/source/processes/electromagnetic/standard/src/G4ionIonisation.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4ionIonisation.cc,v 1.70 2009/11/27 20:06:32 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4ionIonisation.cc,v 1.72 2010/10/26 10:42:04 vnivanch Exp $
     27// GEANT4 tag $Name: emstand-V09-03-24 $
    2828//
    2929// -------------------------------------------------------------------
     
    6666#include "G4Electron.hh"
    6767#include "G4Proton.hh"
    68 //#include "G4Alpha.hh"
    6968#include "G4GenericIon.hh"
    7069#include "G4BraggModel.hh"
     
    8382G4ionIonisation::G4ionIonisation(const G4String& name)
    8483  : G4VEnergyLossProcess(name),
    85     corr(0),
    8684    theParticle(0),
    8785    isInitialised(false),
    88     stopDataActive(true),
    89     nuclearStopping(true)
     86    stopDataActive(true)
    9087{
    9188  SetLinearLossLimit(0.02);
     
    9592  //  SetVerboseLevel(1);
    9693  corr = G4LossTableManager::Instance()->EmCorrections();
     94  eth = 2*MeV;
    9795}
    9896
     
    136134    const G4ParticleDefinition* theBaseParticle = 0;
    137135
    138     if(part == ion)     theBaseParticle = 0;
    139     else if(bpart == 0) theBaseParticle = ion;
    140     else                theBaseParticle = bpart;
     136    if(part == ion)     { theBaseParticle = 0; }
     137    else if(bpart == 0) { theBaseParticle = ion; }
     138    else                { theBaseParticle = bpart; }
    141139
    142140    SetBaseParticle(theBaseParticle);
    143141    SetSecondaryParticle(G4Electron::Electron());
    144142
    145     if (!EmModel(1)) SetEmModel(new G4BraggIonModel(), 1);
     143    if (!EmModel(1)) { SetEmModel(new G4BraggIonModel(), 1); }
    146144    EmModel(1)->SetLowEnergyLimit(MinKinEnergy());
    147145
     
    150148    EmModel(1)->SetHighEnergyLimit(eth);
    151149
    152     if (!FluctModel()) SetFluctModel(new G4IonFluctuations());
     150    if (!FluctModel()) { SetFluctModel(new G4IonFluctuations()); }
    153151    AddEmModel(1, EmModel(1), FluctModel());
    154152
    155     if (!EmModel(2)) SetEmModel(new G4BetheBlochModel(),2); 
     153    if (!EmModel(2)) { SetEmModel(new G4BetheBlochModel(),2); } 
    156154    EmModel(2)->SetLowEnergyLimit(eth);
    157155    EmModel(2)->SetHighEnergyLimit(MaxKinEnergy());
     
    166164  }
    167165  // reinitialisation of corrections for the new run
    168   EmModel(1)->ActivateNuclearStopping(nuclearStopping);
    169   EmModel(2)->ActivateNuclearStopping(nuclearStopping);
    170   if(part == ion) corr->InitialiseForNewRun();
     166  if(part == ion) { corr->InitialiseForNewRun(); }
    171167}
    172168
     
    178174    G4cout << "      Stopping Power data for "
    179175           << corr->GetNumberOfStoppingVectors()
    180            << " ion/material pairs, nuclearStopping: " << nuclearStopping
     176           << " ion/material pairs "
    181177           << G4endl;
    182178  }
Note: See TracChangeset for help on using the changeset viewer.