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

maj sur la beta de geant 4.9.3

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

Legend:

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

    r819 r1055  
    1 $Id: History,v 1.9 2001/10/11 16:21:31 maire Exp $
     1$Id: History,v 1.10 2008/11/14 19:54:40 gcosmo Exp $
    22-------------------------------------------------------------------
    33
     
    1717     * Reverse chronological order (last date on top), please *
    1818     ----------------------------------------------------------
    19      
     19
     2014 nov 08 G.Cosmo     
     21- Added "adjoint" module.
     22
    202311 oct 01 mma (em-V03-02-01)
    2124- Global tag including: emlowen-V03-02-22  muons-V03-02-06  stand-V03-02-08
  • trunk/source/processes/electromagnetic/highenergy/History

    r1007 r1055  
    1 $Id: History,v 1.30 2008/10/16 14:29:48 vnivanch Exp $
     1$Id: History,v 1.32 2009/04/12 17:35:41 vnivanch Exp $
    22-------------------------------------------------------------------
    33
     
    1717     * Reverse chronological order (last date on top), please *
    1818     ----------------------------------------------------------
     19
     2012 April 09: V.Ivanchenko (emhighenergy-V09-02-01)
     21- G4mplIonisationModel, G4eeToHadronsMultiModel - simplified initialisation
     22
     2320 February 09: V.Ivanchenko (emhighenergy-V09-02-00)
     24- Cleanup: improved comments, move virtual methods from .hh to .cc
    1925
    202616 October 08: V.Ivanchenko (emhighenergy-V09-01-06)
  • trunk/source/processes/electromagnetic/highenergy/include/G4BetheBlochNoDeltaModel.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4BetheBlochNoDeltaModel.hh,v 1.7 2006/06/29 19:32:14 gunter Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4BetheBlochNoDeltaModel.hh,v 1.8 2009/02/20 16:38:33 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    6868                                        G4double cutEnergy);
    6969
    70   virtual G4double ComputeCrossSectionPerElectron(
    71                                         const G4ParticleDefinition*,
    72                                         G4double kineticEnergy,
    73                                         G4double cutEnergy,
    74                                         G4double maxEnergy);
     70  virtual G4double CrossSectionPerVolume(const G4Material*,
     71                                         const G4ParticleDefinition*,
     72                                         G4double kineticEnergy,
     73                                         G4double cutEnergy,
     74                                         G4double maxEnergy);
    7575
    7676private:
     
    8484//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    8585
    86 inline G4double G4BetheBlochNoDeltaModel::ComputeDEDXPerVolume(
    87                             const G4Material* material,
    88                             const G4ParticleDefinition* pd,
    89                             G4double kinEnergy, G4double)
    90 {
    91   G4double dedx = G4BetheBlochModel::ComputeDEDXPerVolume(material, pd, kinEnergy, DBL_MAX);
    92   return dedx;
    93 }
    94 
    95 inline G4double G4BetheBlochNoDeltaModel::ComputeCrossSectionPerElectron(
    96                             const G4ParticleDefinition*,
    97                             G4double, G4double, G4double)
    98 {
    99   return 0.0;
    100 }
    101 
    102 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    103 
    10486#endif
  • trunk/source/processes/electromagnetic/highenergy/include/G4BraggNoDeltaModel.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4BraggNoDeltaModel.hh,v 1.6 2006/06/29 19:32:16 gunter Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4BraggNoDeltaModel.hh,v 1.7 2009/02/20 16:38:33 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    6868                                        G4double cutEnergy);
    6969
    70   virtual G4double ComputeCrossSectionPerElectron(
     70  virtual G4double CrossSectionPerVolume(const G4Material*,
    7171                                         const G4ParticleDefinition*,
    7272                                         G4double kineticEnergy,
    7373                                         G4double cutEnergy,
    7474                                         G4double maxEnergy);
    75 
    7675private:
    7776
     
    8483//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    8584
    86 inline G4double G4BraggNoDeltaModel::ComputeDEDXPerVolume(
    87                             const G4Material* material,
    88                             const G4ParticleDefinition* pd,
    89                             G4double kinEnergy, G4double)
    90 {
    91   G4double dedx = G4BraggIonModel::ComputeDEDXPerVolume(material, pd, kinEnergy, DBL_MAX);
    92   return dedx;
    93 }
    94 
    95 inline G4double G4BraggNoDeltaModel::ComputeCrossSectionPerElectron(
    96                             const G4ParticleDefinition*,
    97                             G4double, G4double, G4double)
    98 {
    99   return 0.0;
    100 }
    101 
    102 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    103 
    10485#endif
  • trunk/source/processes/electromagnetic/highenergy/include/G4ee2KChargedModel.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4ee2KChargedModel.hh,v 1.1 2008/07/10 18:07:26 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4ee2KChargedModel.hh,v 1.2 2009/02/20 16:38:33 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    6767  virtual ~G4ee2KChargedModel();
    6868
    69   G4double ThresholdEnergy() const;
     69  virtual G4double ThresholdEnergy() const;
    7070
    71   G4double PeakEnergy() const;
     71  virtual G4double PeakEnergy() const;
    7272
    73   G4double ComputeCrossSection(G4double) const;
     73  virtual G4double ComputeCrossSection(G4double) const;
    7474
    75   G4PhysicsVector* PhysicsVector(G4double, G4double) const;
     75  virtual G4PhysicsVector* PhysicsVector(G4double, G4double) const;
    7676
    7777  virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*,
     
    9292//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    9393
    94 inline G4double G4ee2KChargedModel::ThresholdEnergy() const
    95 {
    96   return 2.0*massK;
    97 }
    98 
    99 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    100 
    101 inline G4double G4ee2KChargedModel::PeakEnergy() const
    102 {
    103   return massPhi;
    104 }
    105 
    106 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    107 
    108 inline G4double G4ee2KChargedModel::ComputeCrossSection(G4double e) const
    109 {
    110   G4double ee = std::min(HighEnergy(),e);
    111   return cross->CrossSection2Kcharged(ee);
    112 }
    113 
    114 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    115 
    11694#endif
  • trunk/source/processes/electromagnetic/highenergy/include/G4ee2KNeutralModel.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4ee2KNeutralModel.hh,v 1.1 2008/07/10 18:07:26 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4ee2KNeutralModel.hh,v 1.2 2009/02/20 16:38:33 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    6767  virtual ~G4ee2KNeutralModel();
    6868
    69   G4double ThresholdEnergy() const;
     69  virtual G4double ThresholdEnergy() const;
    7070
    71   G4double PeakEnergy() const;
     71  virtual G4double PeakEnergy() const;
    7272
    73   G4double ComputeCrossSection(G4double) const;
     73  virtual G4double ComputeCrossSection(G4double) const;
    7474
    75   G4PhysicsVector* PhysicsVector(G4double, G4double) const;
     75  virtual G4PhysicsVector* PhysicsVector(G4double, G4double) const;
    7676
    7777  virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*,
     
    9292//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    9393
    94 inline G4double G4ee2KNeutralModel::ThresholdEnergy() const
    95 {
    96   return 2.0*massK;
    97 }
    98 
    99 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    100 
    101 inline G4double G4ee2KNeutralModel::PeakEnergy() const
    102 {
    103   return massPhi;
    104 }
    105 
    106 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    107 
    108 inline G4double G4ee2KNeutralModel::ComputeCrossSection(G4double e) const
    109 {
    110   G4double ee = std::min(HighEnergy(),e);
    111   return cross->CrossSection2Kneutral(ee);
    112 }
    113 
    114 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    115 
    11694#endif
  • trunk/source/processes/electromagnetic/highenergy/include/G4eeTo3PiModel.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eeTo3PiModel.hh,v 1.1 2008/07/10 18:07:26 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4eeTo3PiModel.hh,v 1.2 2009/02/20 16:38:33 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    6767  virtual ~G4eeTo3PiModel();
    6868
    69   G4double ThresholdEnergy() const;
     69  virtual G4double ThresholdEnergy() const;
    7070
    71   G4double PeakEnergy() const;
     71  virtual G4double PeakEnergy() const;
    7272
    73   G4double ComputeCrossSection(G4double) const;
     73  virtual G4double ComputeCrossSection(G4double) const;
    7474
    75   G4PhysicsVector* PhysicsVector(G4double, G4double) const;
     75  virtual G4PhysicsVector* PhysicsVector(G4double, G4double) const;
    7676
    7777  virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*,
     
    9696//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    9797
    98 inline G4double G4eeTo3PiModel::ThresholdEnergy() const
    99 {
    100   return std::max(LowEnergy(),2.0*massPi + massPi0);
    101 }
    102 
    103 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    104 
    105 inline G4double G4eeTo3PiModel::PeakEnergy() const
    106 {
    107   G4double e = massOm;
    108   if(HighEnergy() > massPhi) e = massPhi;
    109   return e;
    110 }
    111 
    112 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    113 
    114 inline G4double G4eeTo3PiModel::ComputeCrossSection(G4double e) const
    115 {
    116   G4double ee = std::min(HighEnergy(),e);
    117   return cross->CrossSection3pi(ee);
    118 }
    119 
    120 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    121 
    12298#endif
  • trunk/source/processes/electromagnetic/highenergy/include/G4eeToHadrons.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eeToHadrons.hh,v 1.8 2007/05/23 08:50:41 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4eeToHadrons.hh,v 1.9 2009/02/20 16:38:33 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    7070
    7171  // Print out of the class parameters
    72   void PrintInfo();
     72  virtual void PrintInfo();
    7373
    7474  // Set the factor to artificially increase the crossSection (default 1)
     
    7777protected:
    7878
    79   void InitialiseProcess(const G4ParticleDefinition*);
     79  virtual void InitialiseProcess(const G4ParticleDefinition*);
    8080
    8181private:
     
    9292};
    9393
    94 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    95 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    96 
    97 inline G4bool G4eeToHadrons::IsApplicable(const G4ParticleDefinition& p)
    98 {
    99   return (&p == G4Positron::Positron());
    100 }
    101 
    10294//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    10395
  • trunk/source/processes/electromagnetic/highenergy/include/G4eeToHadronsMultiModel.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eeToHadronsMultiModel.hh,v 1.6 2008/07/10 18:06:38 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4eeToHadronsMultiModel.hh,v 1.7 2009/02/20 16:38:33 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    9191                                 G4double maxEnergy = DBL_MAX);
    9292
     93  virtual void PrintInfo();
     94
     95  // Set the factor to artificially increase the crossSection (default 1)
     96  void SetCrossSecFactor(G4double fac);
     97
    9398  inline G4double ComputeCrossSectionPerElectron(
    9499                                         const G4ParticleDefinition*,
     
    96101                                         G4double cutEnergy = 0.0,
    97102                                         G4double maxEnergy = DBL_MAX);
    98 
    99   void PrintInfo();
    100 
    101   // Set the factor to artificially increase the crossSection (default 1)
    102   void SetCrossSecFactor(G4double fac);
    103103
    104104private:
  • trunk/source/processes/electromagnetic/highenergy/include/G4eeToPGammaModel.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eeToPGammaModel.hh,v 1.1 2008/07/10 18:07:26 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4eeToPGammaModel.hh,v 1.2 2009/02/20 16:38:33 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    6868  virtual ~G4eeToPGammaModel();
    6969
    70   G4double ThresholdEnergy() const;
     70  virtual G4double ThresholdEnergy() const;
    7171
    72   G4double PeakEnergy() const;
     72  virtual G4double PeakEnergy() const;
    7373
    74   G4double ComputeCrossSection(G4double) const;
     74  virtual G4double ComputeCrossSection(G4double) const;
    7575
    76   G4PhysicsVector* PhysicsVector(G4double, G4double) const;
     76  virtual G4PhysicsVector* PhysicsVector(G4double, G4double) const;
    7777
    7878  virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*,
     
    9797//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    9898
    99 inline G4double G4eeToPGammaModel::ThresholdEnergy() const
    100 {
    101   return LowEnergy();
    102 }
    103 
    104 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    105 
    106 inline G4double G4eeToPGammaModel::PeakEnergy() const
    107 {
    108   return massR;
    109 }
    110 
    111 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    112 
    113 inline G4double G4eeToPGammaModel::ComputeCrossSection(G4double e) const
    114 {
    115   G4double ee = std::min(HighEnergy(),e);
    116   G4double xs;
    117   if(particle == pi0) xs = cross->CrossSectionPi0G(ee);
    118   else                xs = cross->CrossSectionEtaG(ee);
    119   return xs;
    120 }
    121 
    122 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    123 
    12499#endif
  • trunk/source/processes/electromagnetic/highenergy/include/G4eeToTwoPiModel.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eeToTwoPiModel.hh,v 1.4 2008/07/10 18:06:39 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4eeToTwoPiModel.hh,v 1.5 2009/02/20 16:38:33 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    6767  virtual ~G4eeToTwoPiModel();
    6868
    69   G4double ThresholdEnergy() const;
     69  virtual G4double ThresholdEnergy() const;
    7070
    71   G4double PeakEnergy() const;
     71  virtual G4double PeakEnergy() const;
    7272
    73   G4double ComputeCrossSection(G4double) const;
     73  virtual G4double ComputeCrossSection(G4double) const;
    7474
    75   G4PhysicsVector* PhysicsVector(G4double, G4double) const;
     75  virtual G4PhysicsVector* PhysicsVector(G4double, G4double) const;
    7676
    7777  virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*,
     
    9393//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    9494
    95 inline G4double G4eeToTwoPiModel::ThresholdEnergy() const
    96 {
    97   return 2.0*massPi;
    98 }
    99 
    100 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    101 
    102 inline G4double G4eeToTwoPiModel::PeakEnergy() const
    103 {
    104   return massRho;
    105 }
    106 
    107 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    108 
    109 inline G4double G4eeToTwoPiModel::ComputeCrossSection(G4double e) const
    110 {
    111   G4double ee = std::min(HighEnergy(),e);
    112   return cross->CrossSection2pi(ee);
    113 }
    114 
    115 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    116 
    11795#endif
  • trunk/source/processes/electromagnetic/highenergy/include/G4hBremsstrahlung.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4hBremsstrahlung.hh,v 1.1 2008/03/06 11:47:10 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4hBremsstrahlung.hh,v 1.2 2009/02/20 16:38:33 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    7272  virtual ~G4hBremsstrahlung();
    7373
    74   G4bool IsApplicable(const G4ParticleDefinition& p);
     74  virtual G4bool IsApplicable(const G4ParticleDefinition& p);
    7575
    76   G4double MinPrimaryEnergy(const G4ParticleDefinition* p,
    77                             const G4Material*,
    78                             G4double cut);
     76  virtual G4double MinPrimaryEnergy(const G4ParticleDefinition* p,
     77                                    const G4Material*,
     78                                    G4double cut);
    7979
    8080  // Print out of the class parameters
    81   void PrintInfo();
     81  virtual void PrintInfo();
    8282
    8383protected:
    8484
    85   void InitialiseEnergyLossProcess(const G4ParticleDefinition*,
    86                                    const G4ParticleDefinition*);
     85  virtual void InitialiseEnergyLossProcess(const G4ParticleDefinition*,
     86                                           const G4ParticleDefinition*);
    8787
    8888private:
     
    100100
    101101//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    102 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    103 
    104 inline
    105 G4bool G4hBremsstrahlung::IsApplicable(const G4ParticleDefinition& p)
    106 {
    107   return (p.GetPDGCharge() != 0.0 && p.GetPDGMass() > 110.0*MeV);
    108 }
    109 
    110 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    111 
    112 inline
    113 G4double G4hBremsstrahlung::MinPrimaryEnergy(const G4ParticleDefinition*,
    114                                               const G4Material*,
    115                                               G4double)
    116 {
    117   return lowestKinEnergy;
    118 }
    119 
    120 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    121102
    122103#endif
  • trunk/source/processes/electromagnetic/highenergy/include/G4hPairProduction.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4hPairProduction.hh,v 1.1 2008/03/06 11:47:11 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4hPairProduction.hh,v 1.2 2009/02/20 16:38:33 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    6969  virtual ~G4hPairProduction();
    7070
    71   G4bool IsApplicable(const G4ParticleDefinition& p);
     71  virtual G4bool IsApplicable(const G4ParticleDefinition& p);
    7272
    73   G4double MinPrimaryEnergy(const G4ParticleDefinition* p,
    74                             const G4Material*, G4double cut);
     73  virtual G4double MinPrimaryEnergy(const G4ParticleDefinition* p,
     74                                    const G4Material*, G4double cut);
    7575
    7676  // Print out of the class parameters
    77   void PrintInfo();
     77  virtual void PrintInfo();
    7878
    7979protected:
    8080
    81   void InitialiseEnergyLossProcess(const G4ParticleDefinition*,
    82                                    const G4ParticleDefinition*);
     81  virtual void InitialiseEnergyLossProcess(const G4ParticleDefinition*,
     82                                           const G4ParticleDefinition*);
    8383
    8484private:
     
    9898
    9999//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    100 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    101 
    102 inline
    103 G4bool G4hPairProduction::IsApplicable(const G4ParticleDefinition& p)
    104 {
    105   return (p.GetPDGCharge() != 0.0 && p.GetPDGMass() > 110.0*MeV);
    106 }
    107 
    108 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    109 
    110 inline
    111 G4double G4hPairProduction::MinPrimaryEnergy(const G4ParticleDefinition*,
    112                                               const G4Material*,
    113                                               G4double)
    114 {
    115   return lowestKinEnergy;
    116 }
    117 
    118 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    119100
    120101#endif
  • trunk/source/processes/electromagnetic/highenergy/include/G4hhIonisation.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4hhIonisation.hh,v 1.5 2007/05/23 08:50:41 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4hhIonisation.hh,v 1.6 2009/02/20 16:38:33 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    6969  virtual ~G4hhIonisation();
    7070
    71   G4bool IsApplicable(const G4ParticleDefinition& p);
     71  virtual G4bool IsApplicable(const G4ParticleDefinition& p);
    7272
    73   G4double MinPrimaryEnergy(const G4ParticleDefinition* p,
    74                             const G4Material*, G4double cut);
     73  virtual G4double MinPrimaryEnergy(const G4ParticleDefinition* p,
     74                                    const G4Material*, G4double cut);
    7575
    7676  // Print out of the class parameters
     
    104104
    105105//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    106 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    107 
    108 inline G4bool G4hhIonisation::IsApplicable(const G4ParticleDefinition& p)
    109 {
    110   return (p.GetPDGCharge() != 0.0 && p.GetPDGMass() > 100.0*MeV &&
    111          !p.IsShortLived());
    112 }
    113 
    114 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    115 
    116 inline G4double G4hhIonisation::MinPrimaryEnergy(const G4ParticleDefinition*,
    117                                                 const G4Material*,
    118                                                 G4double cut)
    119 {
    120   G4double x = 0.5*cut/electron_mass_c2;
    121   G4double y = electron_mass_c2/mass;
    122   G4double g = x*y + std::sqrt((1. + x)*(1. + x*y*y));
    123   return mass*(g - 1.0);
    124 }
    125 
    126 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    127106
    128107#endif
  • trunk/source/processes/electromagnetic/highenergy/include/G4mplIonisation.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4mplIonisation.hh,v 1.5 2007/05/23 08:50:41 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4mplIonisation.hh,v 1.6 2009/02/20 16:38:33 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    7272  virtual ~G4mplIonisation();
    7373
    74   G4bool IsApplicable(const G4ParticleDefinition& p);
     74  virtual G4bool IsApplicable(const G4ParticleDefinition& p);
    7575
    7676  // Print out of the class parameters
     
    9494
    9595//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    96 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    97 
    98 inline G4bool G4mplIonisation::IsApplicable(const G4ParticleDefinition& p)
    99 {
    100   return (p.GetParticleName() == "monopole");
    101 }
    102 
    103 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    10496
    10597#endif
  • trunk/source/processes/electromagnetic/highenergy/include/G4mplIonisationModel.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4mplIonisationModel.hh,v 1.6 2007/11/13 18:36:29 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4mplIonisationModel.hh,v 1.7 2009/02/20 16:38:33 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    120120
    121121//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    122 
    123 inline void G4mplIonisationModel::SampleSecondaries(std::vector<G4DynamicParticle*>*,
    124                                                     const G4MaterialCutsCouple*,
    125                                                     const G4DynamicParticle*,
    126                                                     G4double,
    127                                                     G4double)
    128 {}
    129 
    130 inline G4double G4mplIonisationModel::Dispersion(
    131                           const G4Material* material,
    132                           const G4DynamicParticle* dp,
    133                                 G4double& tmax,
    134                                 G4double& length)
    135 {
    136   G4double siga = 0.0;
    137   G4double tau   = dp->GetKineticEnergy()/mass;
    138   if(tau > 0.0) {
    139     G4double electronDensity = material->GetElectronDensity();
    140     G4double gam   = tau + 1.0;
    141     G4double invbeta2 = (gam*gam)/(tau * (tau+2.0));
    142     siga  = (invbeta2 - 0.5) * twopi_mc2_rcl2 * tmax * length
    143       * electronDensity * chargeSquare;
    144   }
    145   return siga;
    146 }
    147 
    148 
    149 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
  • trunk/source/processes/electromagnetic/highenergy/src/G4BetheBlochNoDeltaModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4BetheBlochNoDeltaModel.cc,v 1.3 2006/06/29 19:32:36 gunter Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4BetheBlochNoDeltaModel.cc,v 1.4 2009/02/20 16:38:33 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    5858{}
    5959
     60//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     61
    6062G4BetheBlochNoDeltaModel::~G4BetheBlochNoDeltaModel()
    6163{}
     
    6365//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    6466
     67G4double G4BetheBlochNoDeltaModel::ComputeDEDXPerVolume(
     68                            const G4Material* material,
     69                            const G4ParticleDefinition* pd,
     70                            G4double kinEnergy, G4double)
     71{
     72  return
     73    G4BetheBlochModel::ComputeDEDXPerVolume(material, pd, kinEnergy, DBL_MAX);
     74}
    6575
     76//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     77
     78G4double G4BetheBlochNoDeltaModel::CrossSectionPerVolume(
     79                    const G4Material*,const G4ParticleDefinition*,
     80                    G4double, G4double, G4double)
     81{
     82  return 0.0;
     83}
     84
     85//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     86
     87
  • trunk/source/processes/electromagnetic/highenergy/src/G4BraggNoDeltaModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4BraggNoDeltaModel.cc,v 1.3 2006/06/29 19:32:38 gunter Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4BraggNoDeltaModel.cc,v 1.4 2009/02/20 16:38:33 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    5353//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    5454
    55 
    5655G4BraggNoDeltaModel::G4BraggNoDeltaModel(const G4ParticleDefinition*p,
    5756                                         const G4String& nam) :
    5857  G4BraggIonModel(p, nam)
    5958{}
     59
     60//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    6061
    6162G4BraggNoDeltaModel::~G4BraggNoDeltaModel()
     
    6465//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    6566
     67G4double G4BraggNoDeltaModel::ComputeDEDXPerVolume(
     68                            const G4Material* material,
     69                            const G4ParticleDefinition* pd,
     70                            G4double kinEnergy, G4double)
     71{
     72  return
     73    G4BraggIonModel::ComputeDEDXPerVolume(material, pd, kinEnergy, DBL_MAX);
     74}
    6675
     76//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     77
     78G4double G4BraggNoDeltaModel::CrossSectionPerVolume(
     79                            const G4Material*,
     80                            const G4ParticleDefinition*,
     81                            G4double, G4double, G4double)
     82{
     83  return 0.0;
     84}
     85
     86//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     87
     88
  • trunk/source/processes/electromagnetic/highenergy/src/G4ee2KChargedModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4ee2KChargedModel.cc,v 1.1 2008/07/10 18:07:27 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4ee2KChargedModel.cc,v 1.2 2009/02/20 16:38:33 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    7575//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    7676
     77G4double G4ee2KChargedModel::ThresholdEnergy() const
     78{
     79  return 2.0*massK;
     80}
     81
     82//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     83
     84G4double G4ee2KChargedModel::PeakEnergy() const
     85{
     86  return massPhi;
     87}
     88
     89//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     90
     91G4double G4ee2KChargedModel::ComputeCrossSection(G4double e) const
     92{
     93  G4double ee = std::min(HighEnergy(),e);
     94  return cross->CrossSection2Kcharged(ee);
     95}
     96
     97//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     98
    7799G4PhysicsVector* G4ee2KChargedModel::PhysicsVector(G4double emin,
    78100                                                   G4double emax) const
  • trunk/source/processes/electromagnetic/highenergy/src/G4ee2KNeutralModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4ee2KNeutralModel.cc,v 1.1 2008/07/10 18:07:27 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4ee2KNeutralModel.cc,v 1.2 2009/02/20 16:38:33 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    7575//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    7676
     77G4double G4ee2KNeutralModel::ThresholdEnergy() const
     78{
     79  return 2.0*massK;
     80}
     81
     82//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     83
     84G4double G4ee2KNeutralModel::PeakEnergy() const
     85{
     86  return massPhi;
     87}
     88
     89//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     90
     91G4double G4ee2KNeutralModel::ComputeCrossSection(G4double e) const
     92{
     93  G4double ee = std::min(HighEnergy(),e);
     94  return cross->CrossSection2Kneutral(ee);
     95}
     96
     97//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     98
    7799G4PhysicsVector* G4ee2KNeutralModel::PhysicsVector(G4double emin,
    78100                                                   G4double emax) const
  • trunk/source/processes/electromagnetic/highenergy/src/G4eeTo3PiModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eeTo3PiModel.cc,v 1.1 2008/07/10 18:07:27 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4eeTo3PiModel.cc,v 1.2 2009/02/20 16:38:33 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    8181  G4cout << "### G4eeTo3PiModel::~G4eeTo3PiModel: gmax= "
    8282         << gmax << " gcash= " << gcash << G4endl;
     83}
     84
     85//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     86
     87G4double G4eeTo3PiModel::ThresholdEnergy() const
     88{
     89  return std::max(LowEnergy(),2.0*massPi + massPi0);
     90}
     91
     92//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     93
     94G4double G4eeTo3PiModel::PeakEnergy() const
     95{
     96  G4double e = massOm;
     97  if(HighEnergy() > massPhi) e = massPhi;
     98  return e;
     99}
     100
     101//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     102
     103G4double G4eeTo3PiModel::ComputeCrossSection(G4double e) const
     104{
     105  G4double ee = std::min(HighEnergy(),e);
     106  return cross->CrossSection3pi(ee);
    83107}
    84108
  • trunk/source/processes/electromagnetic/highenergy/src/G4eeToHadrons.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eeToHadrons.cc,v 1.8 2008/10/16 14:29:48 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4eeToHadrons.cc,v 1.9 2009/02/20 16:38:33 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    7575//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    7676
     77G4bool G4eeToHadrons::IsApplicable(const G4ParticleDefinition& p)
     78{
     79  return (&p == G4Positron::Positron());
     80}
     81
     82//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     83
    7784void G4eeToHadrons::InitialiseProcess(const G4ParticleDefinition*)
    7885{
  • trunk/source/processes/electromagnetic/highenergy/src/G4eeToHadronsMultiModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eeToHadronsMultiModel.cc,v 1.6 2008/07/11 17:49:11 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4eeToHadronsMultiModel.cc,v 1.8 2009/04/12 17:48:21 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    129129    nModels = models.size();
    130130
    131     if(pParticleChange) {
    132       fParticleChange =
    133         reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange);
    134     } else {
    135       fParticleChange = new G4ParticleChangeForGamma();
    136     }
     131    fParticleChange = GetParticleChangeForGamma();
    137132  }
    138133}
  • trunk/source/processes/electromagnetic/highenergy/src/G4eeToPGammaModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eeToPGammaModel.cc,v 1.1 2008/07/10 18:07:27 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4eeToPGammaModel.cc,v 1.2 2009/02/20 16:38:33 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    8383//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    8484
     85G4double G4eeToPGammaModel::ThresholdEnergy() const
     86{
     87  return LowEnergy();
     88}
     89
     90//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     91
     92G4double G4eeToPGammaModel::PeakEnergy() const
     93{
     94  return massR;
     95}
     96
     97//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     98
     99G4double G4eeToPGammaModel::ComputeCrossSection(G4double e) const
     100{
     101  G4double ee = std::min(HighEnergy(),e);
     102  G4double xs;
     103  if(particle == pi0) xs = cross->CrossSectionPi0G(ee);
     104  else                xs = cross->CrossSectionEtaG(ee);
     105  return xs;
     106}
     107
     108//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     109
    85110G4PhysicsVector* G4eeToPGammaModel::PhysicsVector(G4double emin,
    86111                                                  G4double emax) const
  • trunk/source/processes/electromagnetic/highenergy/src/G4eeToTwoPiModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eeToTwoPiModel.cc,v 1.6 2008/07/10 18:06:39 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4eeToTwoPiModel.cc,v 1.7 2009/02/20 16:38:33 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    7575//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    7676
     77G4double G4eeToTwoPiModel::ThresholdEnergy() const
     78{
     79  return 2.0*massPi;
     80}
     81
     82//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     83
     84G4double G4eeToTwoPiModel::PeakEnergy() const
     85{
     86  return massRho;
     87}
     88
     89//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     90
     91G4double G4eeToTwoPiModel::ComputeCrossSection(G4double e) const
     92{
     93  G4double ee = std::min(HighEnergy(),e);
     94  return cross->CrossSection2pi(ee);
     95}
     96
     97//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     98
    7799G4PhysicsVector* G4eeToTwoPiModel::PhysicsVector(G4double emin,
    78100                                                 G4double emax) const
  • trunk/source/processes/electromagnetic/highenergy/src/G4hBremsstrahlung.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4hBremsstrahlung.cc,v 1.3 2008/10/16 14:29:48 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4hBremsstrahlung.cc,v 1.4 2009/02/20 16:38:33 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    7272//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    7373
     74G4bool G4hBremsstrahlung::IsApplicable(const G4ParticleDefinition& p)
     75{
     76  return (p.GetPDGCharge() != 0.0 && p.GetPDGMass() > 110.0*MeV);
     77}
     78
     79//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     80
     81G4double G4hBremsstrahlung::MinPrimaryEnergy(const G4ParticleDefinition*,
     82                                             const G4Material*,
     83                                             G4double)
     84{
     85  return lowestKinEnergy;
     86}
     87
     88//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     89
    7490void G4hBremsstrahlung::InitialiseEnergyLossProcess(
    7591                                 const G4ParticleDefinition* part,
  • trunk/source/processes/electromagnetic/highenergy/src/G4hPairProduction.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4hPairProduction.cc,v 1.3 2008/10/16 14:29:48 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4hPairProduction.cc,v 1.4 2009/02/20 16:38:33 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    7373//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    7474
     75G4bool G4hPairProduction::IsApplicable(const G4ParticleDefinition& p)
     76{
     77  return (p.GetPDGCharge() != 0.0 && p.GetPDGMass() > 110.0*MeV);
     78}
     79
     80//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     81
     82G4double G4hPairProduction::MinPrimaryEnergy(const G4ParticleDefinition*,
     83                                             const G4Material*,
     84                                             G4double)
     85{
     86  return lowestKinEnergy;
     87}
     88
     89//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     90
    7591void G4hPairProduction::InitialiseEnergyLossProcess(
    7692                         const G4ParticleDefinition* part,
  • trunk/source/processes/electromagnetic/highenergy/src/G4hhIonisation.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4hhIonisation.cc,v 1.8 2008/10/16 14:29:48 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4hhIonisation.cc,v 1.9 2009/02/20 16:38:33 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    7575G4hhIonisation::~G4hhIonisation()
    7676{}
     77
     78//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     79
     80G4bool G4hhIonisation::IsApplicable(const G4ParticleDefinition& p)
     81{
     82  return (p.GetPDGCharge() != 0.0 && p.GetPDGMass() > 100.0*MeV &&
     83         !p.IsShortLived());
     84}
     85
     86//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     87
     88G4double G4hhIonisation::MinPrimaryEnergy(const G4ParticleDefinition*,
     89                                          const G4Material*,
     90                                          G4double cut)
     91{
     92  G4double x = 0.5*cut/electron_mass_c2;
     93  G4double y = electron_mass_c2/mass;
     94  G4double g = x*y + std::sqrt((1. + x)*(1. + x*y*y));
     95  return mass*(g - 1.0);
     96}
    7797
    7898//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
  • trunk/source/processes/electromagnetic/highenergy/src/G4mplIonisation.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4mplIonisation.cc,v 1.7 2008/10/16 14:29:48 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4mplIonisation.cc,v 1.8 2009/02/20 16:38:33 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    7575//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    7676
     77G4bool G4mplIonisation::IsApplicable(const G4ParticleDefinition& p)
     78{
     79  return (p.GetParticleName() == "monopole");
     80}
     81
     82//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     83
    7784void G4mplIonisation::InitialiseEnergyLossProcess(const G4ParticleDefinition*,
    7885                                                  const G4ParticleDefinition*)
  • trunk/source/processes/electromagnetic/highenergy/src/G4mplIonisationModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4mplIonisationModel.cc,v 1.5 2007/11/13 18:36:29 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4mplIonisationModel.cc,v 1.7 2009/04/12 17:35:41 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    7979  chargeSquare = magCharge * magCharge;
    8080  dedxlim = 45.*nmpl*nmpl*GeV*cm2/g;
     81  fParticleChange = 0;
    8182}
    8283
     
    9394  monopole = p;
    9495  mass     = monopole->GetPDGMass();
    95 
    96   if(pParticleChange)
    97     fParticleChange = reinterpret_cast<G4ParticleChangeForLoss*>(pParticleChange);
    98   else
    99     fParticleChange = new G4ParticleChangeForLoss();
     96  if(!fParticleChange) fParticleChange = GetParticleChangeForLoss();
    10097}
    10198
     
    139136//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    140137
    141 G4double G4mplIonisationModel::ComputeDEDXAhlen(const G4Material* material, G4double bg2)
     138G4double G4mplIonisationModel::ComputeDEDXAhlen(const G4Material* material,
     139                                                G4double bg2)
    142140{
    143141  G4double eDensity = material->GetElectronDensity();
     
    176174  return dedx;
    177175}
     176
     177//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     178
     179void G4mplIonisationModel::SampleSecondaries(std::vector<G4DynamicParticle*>*,
     180                                             const G4MaterialCutsCouple*,
     181                                             const G4DynamicParticle*,
     182                                             G4double,
     183                                             G4double)
     184{}
    178185
    179186//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    204211  return loss;
    205212}
     213
     214//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     215
     216G4double G4mplIonisationModel::Dispersion(const G4Material* material,
     217                                          const G4DynamicParticle* dp,
     218                                          G4double& tmax,
     219                                          G4double& length)
     220{
     221  G4double siga = 0.0;
     222  G4double tau   = dp->GetKineticEnergy()/mass;
     223  if(tau > 0.0) {
     224    G4double electronDensity = material->GetElectronDensity();
     225    G4double gam   = tau + 1.0;
     226    G4double invbeta2 = (gam*gam)/(tau * (tau+2.0));
     227    siga  = (invbeta2 - 0.5) * twopi_mc2_rcl2 * tmax * length
     228      * electronDensity * chargeSquare;
     229  }
     230  return siga;
     231}
     232
     233//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
  • trunk/source/processes/electromagnetic/lowenergy/History

    r1007 r1055  
    1 $Id: History,v 1.329 2008/12/12 08:50:59 sincerti Exp $
     1$Id: History,v 1.371 2009/05/20 09:27:46 pandola Exp $
    22-------------------------------------------------------------------
    33
     
    1818     ----------------------------------------------------------
    1919
     2020.05.2009, L. Pandola, tag emlowen-V09-02-38
     21            Update Penelope models, G4LivermoreIonisationModel and
     22            G4LivermoreBremsstrahlungModel; pointers deleted in the
     23            Initialise() method are explicitely zeroed
     24            (see tag emlowen-V09-02-37)
     25
     2614.05.2009, L. Pandola, tag emlowen-V09-02-37
     27            Correct G4PenelopeBremsstrahlungModel to get rid of a crash
     28            for re-inizialitation
     29
     3012.05.2009, A.Lechner, tag emlowen-V09-02-36
     31            Added new scaling algorithm, to obtain heavy ion stopping powers
     32            for ions not covered by ICRU 73 report (scaled from existing
     33            ICRU 73 data): G4IonDEDXScalingICRU73
     34            Included algorithm in ion model, G4IonParametrisedLossModel,
     35            extending therefore the applicability of the model to very heavy
     36            ions.
     37
     3803.05.2009, S.Incerti, tag emlowen-V09-02-35
     39            Fixed compilation error in G4LivermorePolarizedComptonModel.cc
     40
     4102.05.2009, S.Incerti, tag emlowen-V09-02-34
     42            Clean-up of G4LivermorePolarizedComptonModel and -Rayleigh models
     43
     4402.05.2009, S.Incerti, tag emlowen-V09-02-33
     45            Added message to obsolete non-migrated Geant4-DNA cross section and final state classes
     46
     4702.05.2009, S.Incerti, tag emlowen-V09-02-32
     48            Added message to obsolete non-migrated Livermore and Penelope classes           
     49
     5002.05.2009, S.Incerti, tag emlowen-V09-02-31
     51            Fixed handling of compounds in G4LivermoreGammaConversionModel.cc
     52
     5330.04.2009, S.Incerti, tag emlowen-V09-02-30
     54            Removed annoying G4cout in G4AugerData.cc.
     55            (AugerTransitionTable)
     56           
     5729.04.2009, S.Incerti, tag emlowen-V09-02-29
     58            Increased energy range validity of e- elastic Champion model
     59            up to 10 MeV (Geant4-DNA process).
     60            From this tag, G4LEDATA version 6.5 is needed.
     61
     6229.04.2009, S.Incerti, tag emlowen-V09-02-28
     63            Fixed cross section computation bug in:
     64            G4DNAScreenedRutherfordElasticModel.cc
     65            G4DNAChampionElasticModel.cc
     66
     6718.04.2009, V.Ivanchenko, tag emlowen-V09-02-27
     68            Cleanup of new model classes G4LivermoreBremsstrahlungModel,
     69            G4LivermoreComptonModel, G4LivermoreGammaConversionModel,
     70            G4LivermoreIonisationModel, G4LivermorePhotoElectricModel,
     71            G4LivermoreRayleighModel,G4PenelopeAnnihilationModel
     72            G4PenelopeBremsstrahlungModel, G4PenelopeComptonModel,
     73            G4PenelopeGammaConversionModel, G4PenelopeIonisationModel,
     74            G4PenelopePhotoElectricModel, G4PenelopeRayleighModel
     75              - defined high energy limit for a model in constructor
     76              - do not overwright default (zero) low energy limit of a model
     77              - do not change energy limits in Initiliation methods
     78              - added MinEnergyCut method for models used for energy loss
     79              - do not change track status inside the model for charged particles
     80              - simplified initialisation
     81              - protect all printouts by verbosityLevel variable
     82              - removed MeanFreePath method and table
     83              - cleaned logic in applying of deexcitation module
     84              - use G4ElementSelector if possible
     85            G4ShellVacancy - substitute "set" varibale,
     86                           - comment out destructor to avoid crash
     87
     8802.04.2009, L. Pandola, tag emlowen-V09-02-26
     89            Fixed bug in G4PenelopeRayleigh.cc (calculation of mfp for compounds).
     90            Notice that G4PenelopeRayleighModel.cc was ok. The old process is
     91            going to be obsolete in a while.
     92
     9325.03.2009, L. Pandola, tag emlowen-V09-02-25
     94            Fixed bug with momentum normalization in G4PenelopeBremsstrahlungModel.cc
     95            Fixed G4PenelopePhotoElectricModel.cc to avoid wrong Warnings
     96
     9723.03.2009, L. Pandola, tag emlowen-V09-02-24
     98            Same sa previous. For some reason emlowen-V09-02-23 didn't include
     99            the updated files.
     100
     10123.03.2009, L. Pandola, tag emlowen-V09-02-23
     102            - Added protections in G4eIonisationSpectrum and G4eIonisationParameters
     103              to avoid bug 1042.
     104            - From now on, G4LEDATA 6.4 should be used
     105
     10619.03.2009, S. Incerti, tag emlowen-V09-02-22
     107            - changed energy range display for migrated Livermore photon processes
     108
     10919.03.2009, S. Incerti, tag emlowen-V09-02-21
     110            - set default angular generator in G4LivermorePhotoElectric.cc as Sauter-Gavrila
     111
     11219.03.2009, L. Pandola, tag emlowen-V09-02-20
     113            - First fully tested version of G4LivermoreBremsstrahlungModel
     114            From this tag on, all Livermore models are migrated.
     115
     11618.03.2009, L. Pandola, tag emlowen-V09-02-19
     117            - Removed G4Rayleigh to avoid duplication with G4RayleighScattering
     118            - Clean-up of G4RayleighScattering (e.g. removed un-necessary dependencies)
     119
     12016.03.2009, A. Lechner, tag emlowen-V09-02-18
     121            - Replaced old version of G4IonParametrisedLossModel with newer one
     122            - Added G4IonDEDXHandler, which is a handler class used by the new
     123              G4IonParametrisedLossModel class
     124            - Added G4VIonDEDXScalingAlgorithm, which is used by G4IonDEDXHandler
     125            - Removed G4IonParametrisedLossTable (is replaced by G4IonDEDXHandler)
     126
     12704.03.2009, S. Incerti, tag emlowen-V09-02-17
     128            - moved IsApplicable method for Geant4-DNA process classes from .hh to .cc
     129
     13003.03.2009, S. Incerti, tag emlowen-V09-02-16
     131            - added gamma particle and energy range test in cross section computation
     132              to all Livermore photon processes
     133
     13416.02.2009, S. Incerti, tag emlowen-V09-02-15
     135            - added protections against FPE in G4hLowEnergyLoss.cc (see EM forum
     136              item 893)
     137
     13816.02.2009, S. Incerti, tag emlowen-V09-02-14
     139            - removed compilation warning in G4DNAEmfietzoglouExcitationModel.cc
     140
     14116.02.2009, S. Incerti, tag emlowen-V09-02-13
     142            - improved energy limit display in Geant4-DNA model classes
     143            - commented InitialiseElementSelectors call.
     144
     14516.02.2009, S. Incerti, tag emlowen-V09-02-12
     146            Made compatible with tag emutils-V09-02-00 the following files
     147            - G4DNAElastic.cc
     148            - G4DNAExcitation.cc
     149            - G4DNAIonisation.cc
     150            - G4DNAChargeDecrease.cc
     151            - G4DNAChargeIncrease.cc
     152
     15314.02.2009, S. Incerti, tag emlowen-V09-02-11
     154            Added several corrections to migrated Geant4-DNA processes:
     155            - G4DNABornIonisationModel.cc
     156            - G4DNAEmfietzoglouExcitationModel.cc
     157            - G4DNARuddIonisationModel.cc
     158            - G4DNAIonisation.hh
     159
     16010.02.2009, L. Pandola, tag emlowen-V09-02-10
     161            - Added G4LivermoreIonisationModel, namely first implementation of
     162              LowEnergyIonisation in the new design
     163
     16429.01.2009, L. Pandola, tag emlowen-V09-02-09
     165            - Updated public interface of G4eIonisationCrossSectionHandler.cc in order to
     166              facilitate the migration from G4LowEnergyIonisation to G4LivermoreIonisationModel
     167
     16822.01.2009, S. Incerti, tag emlowen-V09-02-08
     169            - Fixed compilation error problem & code syntax in DNA model classes
     170
     17121.01.2009, S. Incerti, tag emlowen-V09-02-07
     172            - Updated Livermore photon processes classes for handling of compound materials
     173            - Added pointer removal protections
     174            - Involved classes are :
     175              G4LivermoreRayleighModel.cc
     176              G4LivermorePolarizedRayleighModel.cc
     177              G4LivermorePolarizedComptonModel.cc
     178              G4LivermorePhotoElectricModel.cc
     179              G4LivermoreGammaconversionModel.cc
     180              G4LivermoreComptonModel.cc
     181
     18220.01.2009, S. Incerti, tag emlowen-V09-02-06
     183            Added 'kill particle without total energy deposit' feature for DNA charge change processes
     184            Involved files are :
     185            - G4DNAProcess.icc,
     186            - G4FinalStateProduct.hh,.cc,
     187            - G4FinalStateChargeDecrease.cc
     188            - G4FinalStateChargeIncrease.cc
     189
     19020.01.2009, S. Incerti, tag emlowen-V09-02-05
     191            - Corrected energy limits in G4CrossSectionIonisationBornPartial.cc
     192            - Added proton case in G4CrossSectionExcitationMillerGreenPartial.cc
     193            - Added protection (waterExcitation.ExcitationEnergy) in G4CrossSectionExcitationMillerGreenPartial.cc
     194
     19519.01.2009, S. Incerti, tag emlowen-V09-02-04
     196            Added angle initialisation in G4DNAScreenedRutherfordElasticModel
     197
     19812.01.2009, S. Incerti, tag emlowen-V09-02-03
     199            Added preliminary migrated Geant4-DNA processes and models.
     200
     20108.01.2009  L. Pandola, tag emlowen-V09-02-02
     202            Edited G4PenelopePhotoElectric.cc and G4PenelopePhotoElectricModel.cc
     203            to suppress a warning message from G4AtomicTransitionManager appearing
     204            for some elements (Oxygen ,Fluorine). This is due to the fact that
     205            Penelope and G4AtomicTransitionManager databases may contain a different number
     206            of shells. Physics results are unchanged.
     207
     20819.12.2008  L. Pandola, tag emlowen-V09-02-01
     209            Added G4RayleighScattering process (G4VEmProcess) to
     210            describe Rayleigh scattering. This was not available within
     211            the Std package
     212
     21315.12.2008  L. Pandola, tag emlowen-V09-02-00
     214            Same as the previous one (emlowen-V09-01-46). I arrived too late.
     215
     21615.12.2008  L. Pandola, tag emlowen-V09-01-46
     217            Added G4PenelopeBremsstrahlungModel, namely bremsstrahlung according to Penelope
     218            model, migrated to the Std-design (inheriting from G4VEmModel). A few minor
     219            cleaning of G4PenelopeBremsstrahlungContinuous.cc and G4PenelopeIonisation.cc.
     220            From this tag, ALL Penelope processes have been migrated.
     221
    2022212.12.2008   S. Incerti, tag emlowen-V09-01-45
    21223             Upgrade to G4LogLogInterpolation_revision1c.cc
    22224
    23 009.12.2008  S. Incerti, tag emlowen-V09-01-44
    24              Added protection to G4FinalStateElasticChampion.cc for angular treatment of XS at 180*deg
     22509.12.2008  S. Incerti, tag emlowen-V09-01-44
     226            Added protection to G4FinalStateElasticChampion.cc for angular treatment of XS
     227            at 180*deg
    25228
    2622909.12.2008   S. Incerti, tag emlowen-V09-01-43
  • trunk/source/processes/electromagnetic/lowenergy/include/G4AtomicDeexcitation.hh

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

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

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

    r1007 r1055  
    2525//
    2626// $Id: G4AugerData.hh
    27 // GEANT4 tag $Name: geant4-09-02 $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-00 $
    2828//
    2929// Author: Alfonso Mantero (Alfonso.Mantero@ge.infn.it)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4BremsstrahlungCrossSectionHandler.hh

    r819 r1055  
    7070  ~G4BremsstrahlungCrossSectionHandler();
    7171 
     72  G4double GetCrossSectionAboveThresholdForElement(G4double energy,
     73                                                   G4double cutEnergy,
     74                                                   G4int Z);
     75
    7276protected:
    7377
  • trunk/source/processes/electromagnetic/lowenergy/include/G4BremsstrahlungParameters.hh

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

    r1007 r1055  
    2626//
    2727// $Id: G4CompositeEMDataSet.hh,v 1.12 2008/03/17 13:45:25 pia Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-00 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4CrossSectionChargeDecrease.hh

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    r1007 r1055  
    2626//
    2727// $Id: G4DNACrossSectionDataSet.hh,v 1.6 2008/03/17 13:45:25 pia Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-00 $
    2929//
    3030// Author: Riccardo Capra <capra@ge.infn.it>
  • trunk/source/processes/electromagnetic/lowenergy/include/G4DNAGenericIonsManager.hh

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

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

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

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

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

    r1007 r1055  
    2626//
    2727// $Id: G4EMDataSet.hh,v 1.12 2008/03/17 13:45:25 pia Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-00 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4FinalStateChargeDecrease.hh

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    r1007 r1055  
    3737// First implementation: 10. 11. 2008
    3838//
    39 // Modifications:
    40 //
    41 //
     39// Modifications: 03. 02. 2009 - Bug fix iterators (AL)
     40//                11. 03. 2009 - Introduced new table handler (G4IonDEDXHandler)
     41//                               and modified method to add/remove tables
     42//                               (tables are now built in initialisation phase),
     43//                               Minor bug fix in ComputeDEDXPerVolume (AL)
     44//
    4245// Class description:
    4346//    Model for computing the energy loss of ions by employing a
     
    5760#include "G4VEmModel.hh"
    5861#include "G4EmCorrections.hh"
    59 #include "G4IonParametrisedLossTable.hh"
    60 #include "G4EmCorrections.hh"
     62#include "G4IonDEDXHandler.hh"
    6163#include <iomanip>
    6264#include <list>
     
    6769class G4BetheBlochModel;
    6870class G4ParticleChangeForLoss;
    69 
    70 typedef std::list<G4IonLossTableHandle*> LossTableList;
     71class G4VIonDEDXTable;
     72class G4VIonDEDXScalingAlgorithm;
     73class G4LPhysicsFreeVector;
     74
     75typedef std::list<G4IonDEDXHandler*> LossTableList;
    7176typedef std::pair<const G4ParticleDefinition*, const G4Material*> IonMatCouple;
    7277
     
    150155                                 G4double); // Length of current step
    151156
    152 
    153    // Template function which allows to add additional stopping power tables
     157   G4double GetRange(const G4ParticleDefinition*, // Projectile
     158                     const G4Material*,           // Target Material
     159                     G4double);                   // Kinetic energy
     160
     161   // Function which allows to add additional stopping power tables
    154162   // in combination with a scaling algorithm, which may depend on dynamic
    155163   // information like the current particle energy (the table and scaling
    156    // algorithm are used via a wrapper class, which performs e.g.caching or
     164   // algorithm are used via a handler class, which performs e.g.caching or
    157165   // which applies the scaling of energy and dE/dx values)
    158    template <class TABLE, class SCALING_ALGO>
    159    void AddDEDXTable() {
    160        G4IonLossTableHandle* table =
    161                new G4IonParametrisedLossTable<TABLE, SCALING_ALGO>;     
    162  
    163        lossTableList.push_front(table);
    164    }
    165 
    166    // Template function which allows to add additional stopping power tables
    167    // (the table itself is used via a wrapper class, which performs e.g.
    168    // caching)
    169    template <class TABLE>
    170    void AddDEDXTable() {
    171        G4IonLossTableHandle* table =
    172                new G4IonParametrisedLossTable<TABLE>;     
    173  
    174        lossTableList.push_front(table);
    175    }
     166   G4bool AddDEDXTable(const G4String& name,
     167                     G4VIonDEDXTable* table,
     168                     G4VIonDEDXScalingAlgorithm* algorithm = 0);
     169
     170   G4bool RemoveDEDXTable(const G4String& name);
    176171
    177172   // Function checking the applicability of physics tables to ion-material
     
    184179   // and a specified energy grid
    185180   void PrintDEDXTable(
     181                      const G4ParticleDefinition*,  // Projectile (ion)
     182                      const G4Material*, // Absorber material
     183                      G4double,          // Minimum energy per nucleon
     184                      G4double,          // Maximum energy per nucleon
     185                      G4int,             // Number of bins
     186                      G4bool);           // Logarithmic scaling of energy
     187
     188   // Function printing a dE/dx table for a given ion-material combination
     189   // and a specified energy grid
     190   void PrintDEDXTableHandlers(
    186191                      const G4ParticleDefinition*,  // Projectile (ion)
    187192                      const G4Material*, // Absorber material
  • trunk/source/processes/electromagnetic/lowenergy/include/G4IonParametrisedLossModel.icc

    r1007 r1055  
    3737// First implementation: 10. 11. 2008
    3838//
    39 // Modifications:
     39// Modifications: 03. 02. 2009 - Bug fix iterators (AL)
     40//                11. 03. 2009 - Introduced new table handler (G4IonDEDXHandler)
     41//                               and modified method to add/remove tables
     42//                               (tables are now built in initialisation phase),
     43//                               Minor bug fix in ComputeDEDXPerVolume (AL)
    4044//
    4145//
     
    186190                    const G4Material* material) {          // Target material
    187191
    188   LossTableList::iterator iter = lossTableList.begin();
     192  LossTableList::iterator iter = lossTableList.end();
    189193  LossTableList::iterator iterTables = lossTableList.begin();
    190194  LossTableList::iterator iterTables_end = lossTableList.end();
  • trunk/source/processes/electromagnetic/lowenergy/include/G4LinInterpolation.hh

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

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4LivermoreComptonModel.hh,v 1.1 2008/10/30 14:16:34 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4LivermoreComptonModel.hh,v 1.3 2009/04/17 10:29:20 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-00 $
    2828//
     29//
     30// Author: Sebastien Inserti
     31//         30 October 2008
     32//
     33// History:
     34// --------
    2935
    3036#ifndef G4LivermoreComptonModel_h
     
    4046#include "G4DopplerProfile.hh"
    4147#include "G4ForceCondition.hh"
     48#include "G4Gamma.hh"
    4249
    4350class G4LivermoreComptonModel : public G4VEmModel
     
    7077  G4ParticleChangeForGamma* fParticleChange;
    7178
    72   G4double GetMeanFreePath(const G4Track& track,
    73                            G4double previousStepSize,
    74                            G4ForceCondition* condition);
     79  //G4double GetMeanFreePath(const G4Track& track,
     80  //                       G4double previousStepSize,
     81  //                       G4ForceCondition* condition);
    7582private:
    7683
  • trunk/source/processes/electromagnetic/lowenergy/include/G4LivermoreGammaConversionModel.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4LivermoreGammaConversionModel.hh,v 1.1 2008/10/30 14:16:34 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4LivermoreGammaConversionModel.hh,v 1.3 2009/04/17 10:29:20 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-00 $
    2828//
    2929
     
    3838#include "G4ForceCondition.hh"
    3939#include "G4CompositeEMDataSet.hh"
     40#include "G4Gamma.hh"
    4041
    4142class G4LivermoreGammaConversionModel : public G4VEmModel
     
    4546
    4647  G4LivermoreGammaConversionModel(const G4ParticleDefinition* p = 0,
    47                      const G4String& nam = "LivermoreGammaConversion");
     48                     const G4String& nam = "LivermoreConversion");
    4849
    4950  virtual ~G4LivermoreGammaConversionModel();
  • trunk/source/processes/electromagnetic/lowenergy/include/G4LivermorePhotoElectricModel.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4LivermorePhotoElectricModel.hh,v 1.1 2008/10/30 14:16:35 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4LivermorePhotoElectricModel.hh,v 1.3 2009/04/17 10:29:20 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-00 $
    2828//
    2929
     
    4848#include "G4ProductionCutsTable.hh"
    4949#include "G4ForceCondition.hh"
    50 
     50#include "G4Gamma.hh"
    5151
    5252class G4LivermorePhotoElectricModel : public G4VEmModel
     
    5656
    5757  G4LivermorePhotoElectricModel(const G4ParticleDefinition* p = 0,
    58                      const G4String& nam = "LivermorePhotoElectric");
     58                     const G4String& nam = "LivermorePhElectric");
    5959
    6060  virtual ~G4LivermorePhotoElectricModel();
     
    8989
    9090  G4ParticleChangeForGamma* fParticleChange;
    91 
     91  /*
    9292  G4double GetMeanFreePath(const G4Track& aTrack,
    9393                           G4double previousStepSize,
    9494                           G4ForceCondition* condition);
     95  */
    9596private:
    9697
  • trunk/source/processes/electromagnetic/lowenergy/include/G4LivermorePolarizedComptonModel.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4LivermorePolarizedComptonModel.hh,v 1.1 2008/10/30 14:16:35 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4LivermorePolarizedComptonModel.hh,v 1.3 2009/05/02 15:20:52 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-00 $
    2828//
    2929
     
    4040#include "G4DopplerProfile.hh"
    4141#include "G4ForceCondition.hh"
     42#include "G4Gamma.hh"
    4243
    4344class G4LivermorePolarizedComptonModel : public G4VEmModel
     
    7172  G4ParticleChangeForGamma* fParticleChange;
    7273
     74  /*
    7375  G4double GetMeanFreePath(const G4Track& aTrack,
    7476                           G4double previousStepSize,
    7577                           G4ForceCondition* condition);
     78                           */
    7679private:
    7780
  • trunk/source/processes/electromagnetic/lowenergy/include/G4LivermorePolarizedRayleighModel.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4LivermorePolarizedRayleighModel.hh,v 1.1 2008/10/30 14:16:35 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4LivermorePolarizedRayleighModel.hh,v 1.3 2009/05/02 15:20:52 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-00 $
    2828//
    2929
     
    3636#include "G4LogLogInterpolation.hh"
    3737#include "G4CompositeEMDataSet.hh"
     38#include "G4Gamma.hh"
    3839
    3940class G4LivermorePolarizedRayleighModel : public G4VEmModel
  • trunk/source/processes/electromagnetic/lowenergy/include/G4LivermoreRayleighModel.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4LivermoreRayleighModel.hh,v 1.1 2008/10/30 14:16:35 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4LivermoreRayleighModel.hh,v 1.3 2009/04/17 10:29:20 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-00 $
    2828//
    2929
     
    3737#include "G4CompositeEMDataSet.hh"
    3838#include "G4ForceCondition.hh"
     39#include "G4Gamma.hh"
    3940
    4041class G4LivermoreRayleighModel : public G4VEmModel
     
    6869  G4ParticleChangeForGamma* fParticleChange;
    6970
    70   G4double GetMeanFreePath(const G4Track& aTrack,
    71                            G4double previousStepSize,
    72                            G4ForceCondition* condition);
    7371private:
    7472
  • trunk/source/processes/electromagnetic/lowenergy/include/G4LogLogInterpolation.hh

    r1007 r1055  
    2626//
    2727// $Id: G4LogLogInterpolation.hh,v 1.6 2008/12/09 13:28:02 sincerti Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-00 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4LowEnergyBremsstrahlung.hh

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

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

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

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

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

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

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

    r1007 r1055  
    2626//
    2727// $Id: G4LowEnergyRayleigh.hh,v 1.16 2006/06/29 19:36:09 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-00 $
    2929//
    3030//
  • trunk/source/processes/electromagnetic/lowenergy/include/G4OrlicLCrossSection.hh

    r1007 r1055  
    2525//
    2626// $Id: G4OrlicLCrossSection.hh,v 1.3 2008/06/03 07:29:15 gcosmo Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-00 $
    2828//
    2929// Author: Haifa Ben Abdelouahed
  • trunk/source/processes/electromagnetic/lowenergy/include/G4PenelopeAnnihilationModel.hh

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

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

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

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

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

    r1007 r1055  
    2525//
    2626// $Id: G4PenelopeComptonModel.hh,v 1.1 2008/10/28 08:50:21 pandola Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-00 $
    2828//
    2929// Author: Luciano Pandola
  • trunk/source/processes/electromagnetic/lowenergy/include/G4PenelopeGammaConversion.hh

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

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

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

    r1007 r1055  
    2525//
    2626// $Id: G4PenelopeIonisationModel.hh,v 1.1 2008/12/04 14:12:09 pandola Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-00 $
    2828//
    2929// Author: Luciano Pandola
  • trunk/source/processes/electromagnetic/lowenergy/include/G4PenelopePhotoElectric.hh

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

    r1007 r1055  
    2525//
    2626// $Id: G4PenelopePhotoElectricModel.hh,v 1.1 2008/10/28 08:50:21 pandola Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-00 $
    2828//
    2929// Author: Luciano Pandola
  • trunk/source/processes/electromagnetic/lowenergy/include/G4PenelopeRayleigh.hh

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

    r1007 r1055  
    2525//
    2626// $Id: G4PenelopeRayleighModel.hh,v 1.1 2008/10/28 08:50:21 pandola Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-00 $
    2828//
    2929// Author: Luciano Pandola
  • trunk/source/processes/electromagnetic/lowenergy/include/G4RangeNoTest.hh

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

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

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

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

    r1007 r1055  
    2626//
    2727// $Id: G4ShellEMDataSet.hh,v 1.12 2008/03/17 13:45:25 pia Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-00 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4ShellVacancy.hh

    r819 r1055  
    3535//  25 Mar  2002  V.Ivanchenko         Change AverageNOfIonisations int->double
    3636//  12 Apr  2003  V.Ivanchenko         Migrade to cut per region
     37//  16 Apr  2009  V.Ivanchenko         Rename "set" variable
    3738//
    3839// -------------------------------------------------------------------
     
    6566                                                   G4double eLoss) const;
    6667
    67   void AddXsiTable(G4VEMDataSet* set);
     68  void AddXsiTable(G4VEMDataSet* p);
    6869
    6970private:
  • trunk/source/processes/electromagnetic/lowenergy/include/G4VCrossSectionHandler.hh

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

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

    r1007 r1055  
    2626//
    2727// $Id: G4VEMDataSet.hh,v 1.12 2008/03/17 13:45:25 pia Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-00 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
  • trunk/source/processes/electromagnetic/lowenergy/include/G4VLowEnergyDiscretePhotonProcess.hh

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    r1007 r1055  
    2525//
    2626// $Id: G4ecpssrCrossSection.hh,v 1.3 2008/06/03 07:29:15 gcosmo Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-00 $
    2828//
    2929// Author: Haifa Ben Abdelouahed
  • trunk/source/processes/electromagnetic/lowenergy/include/G4hLowEnergyLoss.hh

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

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

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

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

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

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

    r1007 r1055  
    2626//
    2727// $Id: G4AtomicDeexcitation.cc,v 1.11
    28 // GEANT4 tag $Name: geant4-09-02 $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Authors: Elena Guardincerri (Elena.Guardincerri@ge.infn.it)
     
    111111    }
    112112 
    113   // Look this in a particular way: only one auger emitted! //
     113  // Look this in a particular way: only one auger emitted! // ????
    114114  while (provShellId > -2);
    115115 
     
    297297//            G4cout << "G4AtomicDeexcitation warning: No Auger transition found" <<  G4endl;
    298298//            G4cout << "Absorbed enrgy deposited locally" << G4endl;
    299               return 0;
    300 //            //  G4Exception("G4AtomicDeexcitation: No Auger transition found");
     299              G4Exception("G4AtomicDeexcitation: No Auger transition found");
     300              return 0;
    301301            }
    302302        }
     
    394394      // G4int augerOriginatingShellId = 0;
    395395     
    396       G4int numberOfPossibleAuger =
    397           (anAugerTransition->AugerTransitionProbabilities(transitionRandomShellId))->size();
     396      G4int numberOfPossibleAuger = 0;
     397      numberOfPossibleAuger = anAugerTransition->AugerTransitionProbabilities(transitionRandomShellId)->size();
     398
     399
    398400      G4bool foundFlag = false;
    399401
  • trunk/source/processes/electromagnetic/lowenergy/src/G4AugerData.cc

    r961 r1055  
    486486      //        G4cout << "G4AugerData for Element no. " << element << " are loaded" << G4endl;
    487487      // G4cout << "G4AugerData for Element no. " << element << " are loaded" << G4endl;
    488       G4cout << "AugerTransitionTable complete"<< G4endl;
     488      //G4cout << "AugerTransitionTable complete"<< G4endl;
    489489    }
    490490}
  • trunk/source/processes/electromagnetic/lowenergy/src/G4BremsstrahlungCrossSectionHandler.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4BremsstrahlungCrossSectionHandler.cc,v 1.9 2006/06/29 19:38:42 gunter Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4BremsstrahlungCrossSectionHandler.cc,v 1.10 2009/03/03 11:19:18 pandola Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    4141// 10.10.2001 MGP Revision to improve code quality and consistency with design
    4242// 21.01.2003 VI  cut per region
     43// 03.03.2009 LP  Added public method to make a easier migration of
     44//                G4LowEnergyBremsstrahlung to G4LivermoreBremsstrahlungModel
    4345//
    4446// -------------------------------------------------------------------
     
    5557#include "G4ProductionCutsTable.hh"
    5658
     59//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     60
    5761G4BremsstrahlungCrossSectionHandler::G4BremsstrahlungCrossSectionHandler(const G4VEnergySpectrum* spec,
    5862                                                                         G4VDataSetAlgorithm* )
     
    6266}
    6367
     68//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    6469
    6570G4BremsstrahlungCrossSectionHandler::~G4BremsstrahlungCrossSectionHandler()
     
    6873}
    6974
     75//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    7076
    7177std::vector<G4VEMDataSet*>*
     
    127133  return set;
    128134}
     135
     136//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     137
     138G4double G4BremsstrahlungCrossSectionHandler::GetCrossSectionAboveThresholdForElement(G4double energy,
     139                                                                                      G4double cutEnergy,
     140                                                                                      G4int Z)
     141{
     142  G4double value = 0.;
     143  if(energy > cutEnergy)
     144    {
     145      G4double elemCs = FindValue(Z, energy);
     146      value  = theBR->Probability(Z,cutEnergy, energy, energy);   
     147      value *= elemCs;
     148    }
     149  return value;
     150}
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionChargeDecrease.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4CrossSectionChargeDecrease.cc,v 1.4 2008/07/14 20:47:34 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4CrossSectionChargeDecrease.cc,v 1.5 2009/05/02 15:07:47 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828
    2929#include "G4CrossSectionChargeDecrease.hh"
     
    7979  }
    8080
     81   G4cout << G4endl;
     82   G4cout << "*******************************************************************************" << G4endl;
     83   G4cout << "*******************************************************************************" << G4endl;
     84   G4cout << "   The class G4CrossSectionChargeDecrease is NOT SUPPORTED ANYMORE. " << G4endl;
     85   G4cout << "   It will be REMOVED with the next major release of Geant4. " << G4endl;
     86   G4cout << "   Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl;
     87   G4cout << "*******************************************************************************" << G4endl;
     88   G4cout << "*******************************************************************************" << G4endl;
     89   G4cout << G4endl;
    8190}
    8291
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionChargeIncrease.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4CrossSectionChargeIncrease.cc,v 1.4 2008/07/14 20:47:34 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4CrossSectionChargeIncrease.cc,v 1.5 2009/05/02 15:07:47 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828
    2929#include "G4CrossSectionChargeIncrease.hh"
     
    7979  }
    8080
     81   G4cout << G4endl;
     82   G4cout << "*******************************************************************************" << G4endl;
     83   G4cout << "*******************************************************************************" << G4endl;
     84   G4cout << "   The class G4CrossSectionChargeIncrease is NOT SUPPORTED ANYMORE. " << G4endl;
     85   G4cout << "   It will be REMOVED with the next major release of Geant4. " << G4endl;
     86   G4cout << "   Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl;
     87   G4cout << "*******************************************************************************" << G4endl;
     88   G4cout << "*******************************************************************************" << G4endl;
     89   G4cout << G4endl;
    8190}
    8291
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionElasticChampion.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4CrossSectionElasticChampion.cc,v 1.4 2008/12/05 11:58:16 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4CrossSectionElasticChampion.cc,v 1.5 2009/05/02 15:07:47 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828// -------------------------------------------------------------------
    2929
     
    5757    G4Exception("G4CrossSectionElasticChampion constructor: electron is not defined");
    5858  }
     59
     60   G4cout << G4endl;
     61   G4cout << "*******************************************************************************" << G4endl;
     62   G4cout << "*******************************************************************************" << G4endl;
     63   G4cout << "   The class G4CrossSectionElasticChampion is NOT SUPPORTED ANYMORE. " << G4endl;
     64   G4cout << "   It will be REMOVED with the next major release of Geant4. " << G4endl;
     65   G4cout << "   Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl;
     66   G4cout << "*******************************************************************************" << G4endl;
     67   G4cout << "*******************************************************************************" << G4endl;
     68   G4cout << G4endl;
    5969}
    6070
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionElasticScreenedRutherfordHE.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4CrossSectionElasticScreenedRutherfordHE.cc,v 1.2 2008/07/14 20:47:34 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4CrossSectionElasticScreenedRutherfordHE.cc,v 1.3 2009/05/02 15:07:47 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828
    2929#include "G4CrossSectionElasticScreenedRutherfordHE.hh"
     
    3535  lowEnergyLimit = 200. * eV;
    3636  highEnergyLimit = 10. * MeV;
     37
     38   G4cout << G4endl;
     39   G4cout << "*******************************************************************************" << G4endl;
     40   G4cout << "*******************************************************************************" << G4endl;
     41   G4cout << "   The class G4CrossSectionElasticScreenedRutherfordHE is NOT SUPPORTED ANYMORE. " << G4endl;
     42   G4cout << "   It will be REMOVED with the next major release of Geant4. " << G4endl;
     43   G4cout << "   Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl;
     44   G4cout << "*******************************************************************************" << G4endl;
     45   G4cout << "*******************************************************************************" << G4endl;
     46   G4cout << G4endl;
    3747}
    3848
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionElasticScreenedRutherfordLE.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4CrossSectionElasticScreenedRutherfordLE.cc,v 1.2 2008/07/14 20:47:34 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4CrossSectionElasticScreenedRutherfordLE.cc,v 1.3 2009/05/02 15:07:47 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828
    2929#include "G4CrossSectionElasticScreenedRutherfordLE.hh"
     
    3535  lowEnergyLimit = 0 * eV;
    3636  highEnergyLimit = 200 * eV;
     37
     38   G4cout << G4endl;
     39   G4cout << "*******************************************************************************" << G4endl;
     40   G4cout << "*******************************************************************************" << G4endl;
     41   G4cout << "   The class G4CrossSectionElasticScreenedRutherfordLE is NOT SUPPORTED ANYMORE. " << G4endl;
     42   G4cout << "   It will be REMOVED with the next major release of Geant4. " << G4endl;
     43   G4cout << "   Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl;
     44   G4cout << "*******************************************************************************" << G4endl;
     45   G4cout << "*******************************************************************************" << G4endl;
     46   G4cout << G4endl;
    3747}
    3848
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionExcitationBorn.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4CrossSectionExcitationBorn.cc,v 1.4 2008/07/14 20:47:34 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4CrossSectionExcitationBorn.cc,v 1.5 2009/05/02 15:07:47 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828
    2929#include "G4CrossSectionExcitationBorn.hh"
     
    3636  highEnergyLimit = 10 * MeV;
    3737  table = 0;
     38
     39   G4cout << G4endl;
     40   G4cout << "*******************************************************************************" << G4endl;
     41   G4cout << "*******************************************************************************" << G4endl;
     42   G4cout << "   The class G4CrossSectionExcitationBorn is NOT SUPPORTED ANYMORE. " << G4endl;
     43   G4cout << "   It will be REMOVED with the next major release of Geant4. " << G4endl;
     44   G4cout << "   Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl;
     45   G4cout << "*******************************************************************************" << G4endl;
     46   G4cout << "*******************************************************************************" << G4endl;
     47   G4cout << G4endl;
    3848}
    3949
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionExcitationEmfietzoglou.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4CrossSectionExcitationEmfietzoglou.cc,v 1.5 2008/12/05 11:58:16 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4CrossSectionExcitationEmfietzoglou.cc,v 1.6 2009/05/02 15:07:47 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828
    2929#include "G4CrossSectionExcitationEmfietzoglou.hh"
     
    3535  lowEnergyLimit = 8.23 * eV;
    3636  highEnergyLimit = 10. * MeV;
     37
     38   G4cout << G4endl;
     39   G4cout << "*******************************************************************************" << G4endl;
     40   G4cout << "*******************************************************************************" << G4endl;
     41   G4cout << "   The class G4CrossSectionExcitationEmfietzoglou is NOT SUPPORTED ANYMORE. " << G4endl;
     42   G4cout << "   It will be REMOVED with the next major release of Geant4. " << G4endl;
     43   G4cout << "   Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl;
     44   G4cout << "*******************************************************************************" << G4endl;
     45   G4cout << "*******************************************************************************" << G4endl;
     46   G4cout << G4endl;
    3747}
    3848
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionExcitationMillerGreen.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4CrossSectionExcitationMillerGreen.cc,v 1.4 2008/07/14 20:47:34 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4CrossSectionExcitationMillerGreen.cc,v 1.5 2009/05/02 15:07:47 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828
    2929#include "G4CrossSectionExcitationMillerGreen.hh"
     
    9292  }
    9393   
     94
     95   G4cout << G4endl;
     96   G4cout << "*******************************************************************************" << G4endl;
     97   G4cout << "*******************************************************************************" << G4endl;
     98   G4cout << "   The class G4CrossSectionExcitationMillerGreen is NOT SUPPORTED ANYMORE. " << G4endl;
     99   G4cout << "   It will be REMOVED with the next major release of Geant4. " << G4endl;
     100   G4cout << "   Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl;
     101   G4cout << "*******************************************************************************" << G4endl;
     102   G4cout << "*******************************************************************************" << G4endl;
     103   G4cout << G4endl;
    94104}
    95105
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionExcitationMillerGreenPartial.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4CrossSectionExcitationMillerGreenPartial.cc,v 1.2 2008/07/14 20:47:34 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4CrossSectionExcitationMillerGreenPartial.cc,v 1.3 2009/01/20 07:40:53 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828
    2929#include "G4CrossSectionExcitationMillerGreenPartial.hh"
     
    115115  tCorrected = k * kineticEnergyCorrection[particleTypeIndex];
    116116
     117  // SI - added protection
     118  if (tCorrected < waterExcitation.ExcitationEnergy(excitationLevel)) return 0;
     119  //
     120 
    117121  G4int z = 10;
    118122
     
    158162  // ELECTRON CORRECTION
    159163 
    160   if ( particle == instance->GetIon("alpha++"))
     164  if ( particle == instance->GetIon("alpha++")||
     165       particle == G4Proton::ProtonDefinition())
     166       
    161167  {  while (i > 0)
    162168     {
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionIonisationBorn.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4CrossSectionIonisationBorn.cc,v 1.4 2008/08/20 14:51:48 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4CrossSectionIonisationBorn.cc,v 1.5 2009/05/02 15:07:47 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828
    2929#include "G4CrossSectionIonisationBorn.hh"
     
    8282    G4Exception("G4CrossSectionIonisationBorn Constructor: proton is not defined");
    8383  }
     84
     85   G4cout << G4endl;
     86   G4cout << "*******************************************************************************" << G4endl;
     87   G4cout << "*******************************************************************************" << G4endl;
     88   G4cout << "   The class G4CrossSectionIonisationBorn is NOT SUPPORTED ANYMORE. " << G4endl;
     89   G4cout << "   It will be REMOVED with the next major release of Geant4. " << G4endl;
     90   G4cout << "   Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl;
     91   G4cout << "*******************************************************************************" << G4endl;
     92   G4cout << "*******************************************************************************" << G4endl;
     93   G4cout << G4endl;
    8494}
    8595
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionIonisationBornPartial.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4CrossSectionIonisationBornPartial.cc,v 1.4 2008/07/14 20:47:34 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4CrossSectionIonisationBornPartial.cc,v 1.5 2009/01/20 07:40:53 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828
    2929#include "G4CrossSectionIonisationBornPartial.hh"
     
    3333G4CrossSectionIonisationBornPartial::G4CrossSectionIonisationBornPartial()
    3434{
    35   lowEnergyLimitDefault = 25 * eV;
     35  lowEnergyLimitDefault = 12.61 * eV;
    3636  highEnergyLimitDefault = 30 * keV;
    3737
     
    5252    tableFile[electron] = fileElectron;
    5353
    54     lowEnergyLimit[electron] = 25. * eV;
     54    lowEnergyLimit[electron] = 12.61 * eV;
    5555    highEnergyLimit[electron] = 30. * keV;
    5656
  • trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionIonisationRudd.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4CrossSectionIonisationRudd.cc,v 1.4 2008/07/14 20:47:34 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4CrossSectionIonisationRudd.cc,v 1.5 2009/05/02 15:07:47 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828
    2929#include "G4CrossSectionIonisationRudd.hh"
     
    154154    G4Exception("G4CrossSectionIonisationRudd Constructor: helium is not defined");
    155155  }
     156
     157   G4cout << G4endl;
     158   G4cout << "*******************************************************************************" << G4endl;
     159   G4cout << "*******************************************************************************" << G4endl;
     160   G4cout << "   The class G4CrossSectionIonisationRudd is NOT SUPPORTED ANYMORE. " << G4endl;
     161   G4cout << "   It will be REMOVED with the next major release of Geant4. " << G4endl;
     162   G4cout << "   Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl;
     163   G4cout << "*******************************************************************************" << G4endl;
     164   G4cout << "*******************************************************************************" << G4endl;
     165   G4cout << G4endl;
     166
    156167}
    157168
  • trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateChargeDecrease.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4FinalStateChargeDecrease.cc,v 1.3 2008/07/14 20:47:34 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4FinalStateChargeDecrease.cc,v 1.5 2009/05/02 15:07:47 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828
    2929#include "G4FinalStateChargeDecrease.hh"
     
    3535  lowEnergyLimit = 1 * keV;
    3636  highEnergyLimit = 10 * MeV;
     37
     38   G4cout << G4endl;
     39   G4cout << "*******************************************************************************" << G4endl;
     40   G4cout << "*******************************************************************************" << G4endl;
     41   G4cout << "   The class G4FinalStateChargeDecrease is NOT SUPPORTED ANYMORE. " << G4endl;
     42   G4cout << "   It will be REMOVED with the next major release of Geant4. " << G4endl;
     43   G4cout << "   Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl;
     44   G4cout << "*******************************************************************************" << G4endl;
     45   G4cout << "*******************************************************************************" << G4endl;
     46   G4cout << G4endl;
    3747}
    3848
     
    7080  }
    7181 
     82  //SI - Added protection against total energy deposit
     83  product.DoNotDepositEnergy();
     84  //
    7285  product.KillPrimaryParticle();
     86
    7387  product.AddEnergyDeposit(waterBindingEnergy);
    74  
     88
    7589  G4DynamicParticle* aSecondary = new G4DynamicParticle(OutgoingParticleDefinition(definition, finalStateIndex),
    7690                                                        track.GetDynamicParticle()->GetMomentumDirection(),
  • trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateChargeIncrease.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4FinalStateChargeIncrease.cc,v 1.3 2008/07/14 20:47:34 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4FinalStateChargeIncrease.cc,v 1.5 2009/05/02 15:07:47 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828
    2929#include "G4FinalStateChargeIncrease.hh"
     
    3535  lowEnergyLimit = 1 * keV;
    3636  highEnergyLimit = 10 * MeV;
     37
     38   G4cout << G4endl;
     39   G4cout << "*******************************************************************************" << G4endl;
     40   G4cout << "*******************************************************************************" << G4endl;
     41   G4cout << "   The class 4FinalStateChargeIncrease is NOT SUPPORTED ANYMORE. " << G4endl;
     42   G4cout << "   It will be REMOVED with the next major release of Geant4. " << G4endl;
     43   G4cout << "   Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl;
     44   G4cout << "*******************************************************************************" << G4endl;
     45   G4cout << "*******************************************************************************" << G4endl;
     46   G4cout << G4endl;
    3747}
    3848
     
    4858  product.Clear();
    4959
     60  //SI - Added protection against total energy deposit
     61  product.DoNotDepositEnergy();
     62  //
    5063  product.KillPrimaryParticle();
    5164  product.AddEnergyDeposit(0.);
     65
    5266  G4ParticleDefinition* definition = track.GetDefinition();
    5367 
  • trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateElasticBrennerZaider.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4FinalStateElasticBrennerZaider.cc,v 1.8 2008/12/05 11:58:16 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4FinalStateElasticBrennerZaider.cc,v 1.9 2009/05/02 15:07:47 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828
    2929#include "G4FinalStateElasticBrennerZaider.hh"
     
    6464  gamma100_200Coeff.push_back(-2.96264E-5);
    6565  gamma100_200Coeff.push_back(-1.20655E-7);
     66
     67   G4cout << G4endl;
     68   G4cout << "*******************************************************************************" << G4endl;
     69   G4cout << "*******************************************************************************" << G4endl;
     70   G4cout << "   The class G4FinalStateElasticBrennerZaider is NOT SUPPORTED ANYMORE. " << G4endl;
     71   G4cout << "   It will be REMOVED with the next major release of Geant4. " << G4endl;
     72   G4cout << "   Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl;
     73   G4cout << "*******************************************************************************" << G4endl;
     74   G4cout << "*******************************************************************************" << G4endl;
     75   G4cout << G4endl;
    6676}
    6777
  • trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateElasticChampion.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4FinalStateElasticChampion.cc,v 1.7 2008/12/10 18:25:28 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4FinalStateElasticChampion.cc,v 1.8 2009/05/02 15:07:47 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828// -------------------------------------------------------------------
    2929
     
    8484      G4Exception("G4FinalStateElastiChampion : constructor: electron is not defined");
    8585  }
     86
     87   G4cout << G4endl;
     88   G4cout << "*******************************************************************************" << G4endl;
     89   G4cout << "*******************************************************************************" << G4endl;
     90   G4cout << "   The class G4FinalStateElastiChampion is NOT SUPPORTED ANYMORE. " << G4endl;
     91   G4cout << "   It will be REMOVED with the next major release of Geant4. " << G4endl;
     92   G4cout << "   Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl;
     93   G4cout << "*******************************************************************************" << G4endl;
     94   G4cout << "*******************************************************************************" << G4endl;
     95   G4cout << G4endl;
    8696}
    8797
  • trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateElasticScreenedRutherford.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4FinalStateElasticScreenedRutherford.cc,v 1.4 2008/07/14 20:47:34 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4FinalStateElasticScreenedRutherford.cc,v 1.5 2009/05/02 15:07:47 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828
    2929#include "G4FinalStateElasticScreenedRutherford.hh"
     
    3535  lowEnergyLimit = 200 * eV;
    3636  highEnergyLimit = 10 * MeV;
     37
     38   G4cout << G4endl;
     39   G4cout << "*******************************************************************************" << G4endl;
     40   G4cout << "*******************************************************************************" << G4endl;
     41   G4cout << "   The class G4FinalStateElasticScreenedRutherford is NOT SUPPORTED ANYMORE. " << G4endl;
     42   G4cout << "   It will be REMOVED with the next major release of Geant4. " << G4endl;
     43   G4cout << "   Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl;
     44   G4cout << "*******************************************************************************" << G4endl;
     45   G4cout << "*******************************************************************************" << G4endl;
     46   G4cout << G4endl;
    3747}
    3848
  • trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateExcitationBorn.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4FinalStateExcitationBorn.cc,v 1.3 2008/07/14 20:47:34 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4FinalStateExcitationBorn.cc,v 1.4 2009/05/02 15:07:47 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828
    2929#include "G4FinalStateExcitationBorn.hh"
     
    3535  lowEnergyLimit = 500 * keV;
    3636  highEnergyLimit = 10 * MeV;
     37
     38   G4cout << G4endl;
     39   G4cout << "*******************************************************************************" << G4endl;
     40   G4cout << "*******************************************************************************" << G4endl;
     41   G4cout << "   The class G4FinalStateExcitationBorn is NOT SUPPORTED ANYMORE. " << G4endl;
     42   G4cout << "   It will be REMOVED with the next major release of Geant4. " << G4endl;
     43   G4cout << "   Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl;
     44   G4cout << "*******************************************************************************" << G4endl;
     45   G4cout << "*******************************************************************************" << G4endl;
     46   G4cout << G4endl;
    3747}
    3848
  • trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateExcitationEmfietzoglou.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4FinalStateExcitationEmfietzoglou.cc,v 1.5 2008/12/05 11:58:16 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4FinalStateExcitationEmfietzoglou.cc,v 1.6 2009/05/02 15:07:47 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828
    2929#include "G4FinalStateExcitationEmfietzoglou.hh"
     
    3535  lowEnergyLimit = 8.23 * eV;
    3636  highEnergyLimit = 10 * MeV;
     37
     38   G4cout << G4endl;
     39   G4cout << "*******************************************************************************" << G4endl;
     40   G4cout << "*******************************************************************************" << G4endl;
     41   G4cout << "   The class G4FinalStateExcitationEmfietzoglou is NOT SUPPORTED ANYMORE. " << G4endl;
     42   G4cout << "   It will be REMOVED with the next major release of Geant4. " << G4endl;
     43   G4cout << "   Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl;
     44   G4cout << "*******************************************************************************" << G4endl;
     45   G4cout << "*******************************************************************************" << G4endl;
     46   G4cout << G4endl;
    3747}
    3848
  • trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateExcitationMillerGreen.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4FinalStateExcitationMillerGreen.cc,v 1.3 2008/07/14 20:47:34 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4FinalStateExcitationMillerGreen.cc,v 1.4 2009/05/02 15:07:47 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828
    2929#include "G4FinalStateExcitationMillerGreen.hh"
     
    3535  lowEnergyLimit = 10 * eV;
    3636  highEnergyLimit = 10 * MeV;
     37
     38   G4cout << G4endl;
     39   G4cout << "*******************************************************************************" << G4endl;
     40   G4cout << "*******************************************************************************" << G4endl;
     41   G4cout << "   The class G4FinalStateExcitationMillerGreen is NOT SUPPORTED ANYMORE. " << G4endl;
     42   G4cout << "   It will be REMOVED with the next major release of Geant4. " << G4endl;
     43   G4cout << "   Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl;
     44   G4cout << "*******************************************************************************" << G4endl;
     45   G4cout << "*******************************************************************************" << G4endl;
     46   G4cout << G4endl;
    3747}
    3848
  • trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateIonisationBorn.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4FinalStateIonisationBorn.cc,v 1.16 2008/12/06 13:47:12 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4FinalStateIonisationBorn.cc,v 1.17 2009/05/02 15:07:47 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828
    2929#include "G4FinalStateIonisationBorn.hh"
     
    124124    G4Exception("G4FinalStateIonisationBorn Constructor: proton is not defined");
    125125  }
     126
     127   G4cout << G4endl;
     128   G4cout << "*******************************************************************************" << G4endl;
     129   G4cout << "*******************************************************************************" << G4endl;
     130   G4cout << "   The class G4FinalStateIonisationBorn is NOT SUPPORTED ANYMORE. " << G4endl;
     131   G4cout << "   It will be REMOVED with the next major release of Geant4. " << G4endl;
     132   G4cout << "   Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl;
     133   G4cout << "*******************************************************************************" << G4endl;
     134   G4cout << "*******************************************************************************" << G4endl;
     135   G4cout << G4endl;
    126136}
    127137
  • trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateIonisationRudd.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4FinalStateIonisationRudd.cc,v 1.8 2008/08/20 14:51:48 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4FinalStateIonisationRudd.cc,v 1.9 2009/05/02 15:07:47 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828
    2929#include "G4FinalStateIonisationRudd.hh"
     
    7070  lowEnergyLimit[helium] = 1. * keV;
    7171  highEnergyLimit[helium] = 10. * MeV;
     72
     73   G4cout << G4endl;
     74   G4cout << "*******************************************************************************" << G4endl;
     75   G4cout << "*******************************************************************************" << G4endl;
     76   G4cout << "   The class G4FinalStateIonisationRudd is NOT SUPPORTED ANYMORE. " << G4endl;
     77   G4cout << "   It will be REMOVED with the next major release of Geant4. " << G4endl;
     78   G4cout << "   Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl;
     79   G4cout << "*******************************************************************************" << G4endl;
     80   G4cout << "*******************************************************************************" << G4endl;
     81   G4cout << G4endl;
    7282}
    7383
  • trunk/source/processes/electromagnetic/lowenergy/src/G4FinalStateProduct.cc

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

    r1007 r1055  
    3737// First implementation: 10. 11. 2008
    3838//
    39 // Modifications:
    40 //
     39// Modifications: 03. 02. 2009 - Bug fix iterators (AL)
     40//                11. 03. 2009 - Introduced new table handler (G4IonDEDXHandler)
     41//                               and modified method to add/remove tables
     42//                               (tables are now built in initialisation phase),
     43//                               Minor bug fix in ComputeDEDXPerVolume (AL)
     44//                11. 05. 2009 - Introduced scaling algorithm for heavier ions:
     45//                               G4IonDEDXScalingICRU73 (AL)
    4146//
    4247// Class description:
     
    5560#include "G4MaterialStoppingICRU73.hh"
    5661#include "G4SimpleMaterialStoppingICRU73.hh"
     62#include "G4IronStoppingICRU73.hh"
     63#include "G4VIonDEDXTable.hh"
     64#include "G4VIonDEDXScalingAlgorithm.hh"
     65#include "G4IonDEDXScalingICRU73.hh"
    5766#include "G4BraggIonModel.hh"
    5867#include "G4BetheBlochModel.hh"
     68#include "G4ProductionCutsTable.hh"
    5969#include "G4ParticleChangeForLoss.hh"
    6070#include "G4LossTableManager.hh"
     
    6373#include "Randomize.hh"
    6474
     75//#define PRINT_TABLE_BUILT
     76
     77
     78// #########################################################################
    6579
    6680G4IonParametrisedLossModel::G4IonParametrisedLossModel(
     
    89103  betheBlochModel = new G4BetheBlochModel();
    90104
    91   // By default ICRU 73 stopping power tables are loaded
    92   AddDEDXTable<G4SimpleMaterialStoppingICRU73>();
    93   AddDEDXTable<G4MaterialStoppingICRU73>();
     105  // By default ICRU 73 stopping power tables are loaded:
     106
     107  // Ions with Z above between 19 and 21: Ar-40 data is used as basis
     108  // for stopping power scaling
     109  G4int ionZMin = 19;
     110  G4int ionZMax = 21;
     111  G4int refIonZ = 18;
     112  G4int refIonA = 40;
     113
     114  AddDEDXTable("ICRU73-elemmat",
     115           new G4SimpleMaterialStoppingICRU73,
     116           new G4IonDEDXScalingICRU73(ionZMin, ionZMax, refIonZ, refIonA));
     117
     118  // Ions with Z above 21: Fe-56 data is used as basis for stopping power
     119  // scaling
     120  ionZMin = 22;
     121  ionZMax = 102;
     122  refIonZ = 26;
     123  refIonA = 56;
     124
     125  AddDEDXTable("ICRU73-ironions",
     126               new G4IronStoppingICRU73,
     127               new G4IonDEDXScalingICRU73(ionZMin, ionZMax, refIonZ, refIonA));
     128
     129  // Compound materials: Ar-40 data is used as basis for stopping power
     130  // scaling (except for iron ions)
     131  ionZMin = 19;
     132  ionZMax = 102;
     133  refIonZ = 18;
     134  refIonA = 40;
     135
     136  G4IonDEDXScalingICRU73* scaling =
     137            new G4IonDEDXScalingICRU73(ionZMin, ionZMax, refIonZ, refIonA);
     138
     139  G4int ironIonAtomicNumber = 26;
     140  scaling -> AddException(ironIonAtomicNumber);
     141
     142  AddDEDXTable("ICRU73-compmat",
     143               new G4MaterialStoppingICRU73,
     144               scaling);
    94145
    95146  // The boundaries for the range tables are set
     
    107158  dedxCacheMaterial = 0;
    108159  dedxCacheEnergyCut = 0;
    109   dedxCacheIter = lossTableList.begin();
     160  dedxCacheIter = lossTableList.end();
    110161  dedxCacheTransitionEnergy = 0.0; 
    111162  dedxCacheTransitionFactor = 0.0;
     
    113164}
    114165
     166// #########################################################################
    115167
    116168G4IonParametrisedLossModel::~G4IonParametrisedLossModel() {
     
    142194}
    143195
     196// #########################################################################
    144197
    145198G4double G4IonParametrisedLossModel::MinEnergyCut(
     
    151204}
    152205
     206// #########################################################################
    153207
    154208void G4IonParametrisedLossModel::Initialise(
     
    166220  dedxCacheMaterial = 0;
    167221  dedxCacheEnergyCut = 0;
    168   dedxCacheIter = lossTableList.begin();
     222  dedxCacheIter = lossTableList.end();
    169223  dedxCacheTransitionEnergy = 0.0; 
    170224  dedxCacheTransitionFactor = 0.0;
     
    196250  cutEnergies.clear();
    197251  for(size_t i = 0; i < size; i++) cutEnergies.push_back(cuts[i]);
     252
     253  // All dE/dx vectors are built
     254  const G4ProductionCutsTable* coupleTable=
     255                     G4ProductionCutsTable::GetProductionCutsTable();
     256  size_t nmbCouples = coupleTable -> GetTableSize();
     257
     258#ifdef PRINT_TABLE_BUILT
     259    G4cout << "G4IonParametrisedLossModel::Initialise():"
     260           << " Building dE/dx vectors:"
     261           << G4endl;         
     262#endif
     263
     264  for (size_t i = 0; i < nmbCouples; i++) {
     265
     266    const G4MaterialCutsCouple* couple =
     267                                     coupleTable -> GetMaterialCutsCouple(i);
     268
     269    const G4Material* material = couple -> GetMaterial();
     270    //    G4ProductionCuts* productionCuts = couple -> GetProductionCuts();
     271
     272    for(G4int atomicNumberIon = 3; atomicNumberIon < 102; atomicNumberIon++) {
     273
     274       LossTableList::iterator iter = lossTableList.begin();
     275       LossTableList::iterator iter_end = lossTableList.end();
     276
     277       for(;iter != iter_end; iter++) {
     278
     279          if(*iter == 0) {
     280              G4cout << "G4IonParametrisedLossModel::Initialise():"
     281                     << " Skipping illegal table."
     282                     << G4endl;         
     283          }
     284
     285          G4bool isApplicable =
     286                    (*iter) -> BuildDEDXTable(atomicNumberIon, material);
     287          if(isApplicable) {
     288
     289#ifdef PRINT_TABLE_BUILT
     290             G4cout << "  Atomic Number Ion = " << atomicNumberIon
     291                    << ", Material = " << material -> GetName()
     292                    << ", Table = " << (*iter) -> GetName()
     293                    << G4endl;     
     294#endif
     295             break;
     296          }
     297       }
     298    }
     299  }
    198300
    199301  // The particle change object is cast to G4ParticleChangeForLoss
     
    221323}
    222324
     325// #########################################################################
    223326
    224327G4double G4IonParametrisedLossModel::ComputeCrossSectionPerAtom(
     
    285388}
    286389
     390// #########################################################################
    287391
    288392G4double G4IonParametrisedLossModel::CrossSectionPerVolume(
     
    303407}
    304408
     409// #########################################################################
    305410
    306411G4double G4IonParametrisedLossModel::ComputeDEDXPerVolume(
     
    342447  LossTableList::iterator iter = dedxCacheIter;
    343448
    344   if(iter != lossTableList.begin()) {
     449  if(iter != lossTableList.end()) {
    345450
    346451     G4double transitionEnergy = dedxCacheTransitionEnergy;
     
    369474        if(scaledTransitionEnergy >= lowEnergyLimit) {
    370475
    371            G4double factor = 1.0 + dedxCacheTransitionFactor /
    372                                                            kineticEnergy;
    373 
    374476           dEdx = betheBlochModel -> ComputeDEDXPerVolume(
    375477                                      material, genericIon,
    376478                                      scaledKineticEnergy, cutEnergy);
     479       
     480           dEdx *= chargeSquare;
     481
     482           dEdx += corrections -> ComputeIonCorrections(particle,
     483                                                 material, kineticEnergy);
     484
     485           G4double factor = 1.0 + dedxCacheTransitionFactor /
     486                                                           kineticEnergy;
     487
    377488           dEdx *= factor;
    378 
    379         }
    380         dEdx *= chargeSquare;
    381 
    382         dEdx += corrections -> ComputeIonCorrections(particle,
    383                                                  material, kineticEnergy);
     489        }
    384490     }
    385491  }
     
    446552  if (dEdx < 0.0) dEdx = 0.0;
    447553
    448 #ifdef PRINT_DEBUG
    449 
    450   G4cout << "########################################################"
    451          << G4endl
    452          << "# G4IonParametrisedLossModel::ComputeDEDXPerVolume"
    453          << G4endl
    454          << "# Material =" << material -> GetName()
    455          << G4endl
    456          << "# Particle = " << particle -> GetParticleName()           
    457          << G4endl;
    458          << "# Cut energy (MeV) = " << cutEnergy/MeV 
    459          << G4endl;
    460  
    461   G4cout << "#"
    462          << std::setw(13) << std::right << "E(MeV)"
    463          << std::setw(14) << "dE/dx(keV/um)"
    464          << std::setw(14) << "d:dE/dx(keV/um)"
    465          << std::setw(14) << "(d:dE/dx)/dE/dx"
    466          << G4endl
    467          << "# ------------------------------------------------------"
    468          << G4endl;
    469 
    470   G4cout << std::setw(14) << std::right << kineticEnergy / MeV
    471          << std::setw(14) << (dEdx + dEdXDeltaRays) / keV * um
    472          << std::setw(14) << dEdXDeltaRays / keV * um
    473          << std::setw(14) << dEdXDeltaRays / (dEdx + dEdXDeltaRays) * 100.0
    474          << G4endl;
    475 #endif
    476 
    477554  return dEdx;
    478555}
    479556
     557// #########################################################################
    480558
    481559void G4IonParametrisedLossModel::PrintDEDXTable(
     
    508586         << std::setw(13) << std::right << "(MeV)"
    509587         << std::setw(14) << "(MeV)"
    510          << std::setw(14) << "(MeV/mm)"
     588         << std::setw(14) << "(MeV/cm)"
    511589         << std::setw(14) << "(MeV*cm2/mg)"
    512590         << G4endl
     
    535613      G4cout << std::setw(14) << std::right << energy / MeV
    536614             << std::setw(14) << energy / atomicMassNumber / MeV
    537              << std::setw(14) << dedx / MeV * mm
     615             << std::setw(14) << dedx / MeV * cm
    538616             << std::setw(14) << dedx / materialDensity / (MeV*cm2/(0.001*g))
    539617             << G4endl;
     
    541619}
    542620
     621// #########################################################################
     622
     623void G4IonParametrisedLossModel::PrintDEDXTableHandlers(
     624                   const G4ParticleDefinition* particle,  // Projectile (ion)
     625                   const G4Material* material,  // Absorber material
     626                   G4double lowerBoundary,      // Minimum energy per nucleon
     627                   G4double upperBoundary,      // Maximum energy per nucleon
     628                   G4int nmbBins,               // Number of bins
     629                   G4bool logScaleEnergy) {     // Logarithmic scaling of energy
     630
     631  LossTableList::iterator iter = lossTableList.begin();
     632  LossTableList::iterator iter_end = lossTableList.end();
     633
     634  for(;iter != iter_end; iter++) {
     635      G4bool isApplicable =  (*iter) -> IsApplicable(particle, material);
     636      if(isApplicable) { 
     637        (*iter) -> PrintDEDXTable(particle, material,
     638                                  lowerBoundary, upperBoundary,
     639                                  nmbBins,logScaleEnergy);
     640        break;
     641      }
     642  }
     643}
     644
     645// #########################################################################
    543646
    544647void G4IonParametrisedLossModel::SampleSecondaries(
     
    641744}
    642745
     746// #########################################################################
    643747
    644748void G4IonParametrisedLossModel::UpdateDEDXCache(
     
    672776
    673777     // If any table is applicable, the transition factor is computed:
    674      if(iter != lossTableList.begin()) {
     778     if(iter != lossTableList.end()) {
    675779
    676780        // Retrieving the transition energy from the parameterisation table
     
    740844}
    741845
     846// #########################################################################
    742847
    743848void G4IonParametrisedLossModel::CorrectionsAlongStep(
     
    767872  G4double kineticEnergy = dynamicParticle -> GetKineticEnergy();
    768873
     874  if(kineticEnergy == eloss) { return; }
     875
    769876  G4double cutEnergy = DBL_MAX;
    770877  size_t cutIndex = couple -> GetIndex();
     
    777884  // If parameterization for ions is available the electronic energy loss
    778885  // is overwritten
    779   if(iter != lossTableList.begin()) {
     886  if(iter != lossTableList.end()) {
    780887
    781888     // The energy loss is calculated using the ComputeDEDXPerVolume function
     
    832939
    833940     }
    834 
    835941  }
    836942
     
    854960  G4double transitionEnergy = dedxCacheTransitionEnergy;
    855961
    856   if(iter != lossTableList.begin() && transitionEnergy < kineticEnergy) {
     962  if(iter != lossTableList.end() && transitionEnergy < kineticEnergy) {
    857963     chargeSquareRatio *= corrections -> EffectiveChargeCorrection(particle,
    858964                                                                material,
     
    862968     eloss *= chargeSquareRatioCorr;
    863969  }
    864   else if (iter == lossTableList.begin()) {
     970  else if (iter == lossTableList.end()) {
    865971
    866972     chargeSquareRatio *= corrections -> EffectiveChargeCorrection(particle,
     
    875981  // overwrite the energy loss (i.e. when the effective charge approach is
    876982  // used)
    877   if(iter == lossTableList.begin()) {
     983  if(iter == lossTableList.end()) {
    878984
    879985     G4double scaledKineticEnergy = kineticEnergy * dedxCacheGenIonMassRatio;
     
    9061012     particleChangeLoss -> ProposeNonIonizingEnergyDeposit(nloss);
    9071013  }
    908 
    909 }
    910 
     1014}
     1015
     1016// #########################################################################
    9111017
    9121018void G4IonParametrisedLossModel::BuildRangeVector(
     
    10181124
    10191125  IonMatCouple ionMatCouple = std::make_pair(particle, material);
    1020  
     1126
    10211127  E[ionMatCouple] = energyRangeVector;
    10221128  r[ionMatCouple] = rangeEnergyVector;
    10231129}
    10241130
     1131// #########################################################################
     1132
     1133G4double G4IonParametrisedLossModel::GetRange(
     1134                  const G4ParticleDefinition* particle, // Projectile
     1135                  const G4Material* material,           // Target Material
     1136                  G4double kineticEnergy) {
     1137
     1138  G4double range = 0.0;
     1139
     1140  IonMatCouple couple = std::make_pair(particle, material);
     1141
     1142  EnergyRangeTable::iterator iter = E.find(couple);
     1143
     1144  if(iter == E.end()) {
     1145     G4cerr << "G4IonParametrisedLossModel::GetRange() No range vector found."
     1146            << G4endl;
     1147
     1148     G4cout << "   Ion-material pair: " << particle ->GetParticleName()
     1149            << "  " << material -> GetName()
     1150            << G4endl
     1151            << "   Available couples:"
     1152            << G4endl;
     1153
     1154     EnergyRangeTable::iterator iter_beg = E.begin();
     1155     EnergyRangeTable::iterator iter_end = E.end();
     1156
     1157     for(;iter_beg != iter_end; iter_beg++) {
     1158         IonMatCouple key = (*iter_beg).first;
     1159 
     1160         G4cout << "           " << (key.first) -> GetParticleName()
     1161                << "  " << (key.second) -> GetName()
     1162                << G4endl;
     1163     }
     1164  }
     1165  else {
     1166     G4PhysicsVector* energyRange = (*iter).second;
     1167
     1168     if(energyRange != 0) {
     1169        G4bool b;
     1170
     1171        // Computing range for kinetic energy:
     1172        range = energyRange -> GetValue(kineticEnergy, b);
     1173     }
     1174  }
     1175
     1176  return range;
     1177}
     1178
     1179// #########################################################################
    10251180
    10261181G4double G4IonParametrisedLossModel::ComputeLossForStep(
     
    10611216        if(loss < 0.0) loss = 0.0;
    10621217     }
    1063 
    1064 #ifdef PRINT_DEBUG
    1065      G4cout << "G4IonParametrisedLossModel::ComputeLossForStep() E = "
    1066             << kineticEnergy / MeV << " MeV * "
    1067             << value.energyScaling << " = "
    1068             << kineticEnergy * value.energyScaling / MeV
    1069             << " MeV, dE/dx = " << dedx / MeV * cm << " MeV/cm = "
    1070             << dedx/factor/MeV*cm << " * " << factor << " MeV/cm; index = "
    1071             << value.dEdxIndex << ", material = " << material -> GetName()
    1072             << G4endl;
    1073 #endif
    1074 
    10751218  }
    10761219
    10771220  return loss;
    10781221}
     1222
     1223// #########################################################################
     1224
     1225G4bool G4IonParametrisedLossModel::AddDEDXTable(
     1226                                const G4String& name,
     1227                                G4VIonDEDXTable* table,
     1228                                G4VIonDEDXScalingAlgorithm* algorithm) {
     1229
     1230  if(table == 0) {
     1231     G4cerr << "G4IonParametrisedLossModel::AddDEDXTable() Cannot "
     1232            << " add table: Invalid pointer."
     1233            << G4endl;     
     1234
     1235     return false;
     1236  }
     1237
     1238  // Checking uniqueness of name
     1239  LossTableList::iterator iter = lossTableList.begin();
     1240  LossTableList::iterator iter_end = lossTableList.end();
     1241 
     1242  for(;iter != iter_end; iter++) {
     1243     G4String tableName = (*iter) -> GetName();
     1244
     1245     if(tableName == name) {
     1246        G4cerr << "G4IonParametrisedLossModel::AddDEDXTable() Cannot "
     1247               << " add table: Name already exists."     
     1248               << G4endl;
     1249
     1250        return false;
     1251     }
     1252  }
     1253
     1254  G4VIonDEDXScalingAlgorithm* scalingAlgorithm = algorithm;
     1255  if(scalingAlgorithm == 0)
     1256     scalingAlgorithm = new G4VIonDEDXScalingAlgorithm;
     1257 
     1258  G4IonDEDXHandler* handler =
     1259                      new G4IonDEDXHandler(table, scalingAlgorithm, name);
     1260
     1261  lossTableList.push_front(handler);
     1262
     1263  return true;
     1264}
     1265
     1266// #########################################################################
     1267
     1268G4bool G4IonParametrisedLossModel::RemoveDEDXTable(
     1269                                 const G4String& name) {
     1270
     1271  LossTableList::iterator iter = lossTableList.begin();
     1272  LossTableList::iterator iter_end = lossTableList.end();
     1273 
     1274  for(;iter != iter_end; iter++) {
     1275     G4String tableName = (*iter) -> GetName();
     1276
     1277     if(tableName == name) {
     1278        delete (*iter);
     1279
     1280        lossTableList.erase(iter);
     1281        return true;
     1282     }
     1283  }
     1284
     1285  return false;
     1286}
     1287
     1288// #########################################################################
     1289
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LivermoreComptonModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4LivermoreComptonModel.cc,v 1.1 2008/10/30 14:17:46 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
    28 //
     26// $Id: G4LivermoreComptonModel.cc,v 1.6 2009/04/18 18:29:34 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     28//
     29//
     30// Author: Sebastien Inserti
     31//         30 October 2008
     32//
     33// History:
     34// --------
     35// 18 Apr 2009   V Ivanchenko Cleanup initialisation and generation of secondaries:
     36//                  - apply internal high-energy limit only in constructor
     37//                  - do not apply low-energy limit (default is 0)
     38//                  - remove GetMeanFreePath method and table
     39//                  - added protection against numerical problem in energy sampling
     40//                  - use G4ElementSelector
    2941
    3042#include "G4LivermoreComptonModel.hh"
     
    3749
    3850G4LivermoreComptonModel::G4LivermoreComptonModel(const G4ParticleDefinition*,
    39                                              const G4String& nam)
    40 :G4VEmModel(nam),isInitialised(false)
     51                                                 const G4String& nam)
     52  :G4VEmModel(nam),isInitialised(false),meanFreePathTable(0),
     53   scatterFunctionData(0),crossSectionHandler(0)
    4154{
    42   lowEnergyLimit = 250 * eV; // SI - Could be 10 eV ?
     55  lowEnergyLimit = 250 * eV;
    4356  highEnergyLimit = 100 * GeV;
    44   SetLowEnergyLimit(lowEnergyLimit);
     57  //  SetLowEnergyLimit(lowEnergyLimit);
    4558  SetHighEnergyLimit(highEnergyLimit);
    4659
    47   verboseLevel= 0;
     60  verboseLevel=0 ;
    4861  // Verbosity scale:
    4962  // 0 = nothing
     
    5265  // 3 = calculation of cross sections, file openings, sampling of atoms
    5366  // 4 = entering in methods
    54  
    55   G4cout << "Livermore Compton model is constructed " << G4endl
    56          << "Energy range: "
    57          << lowEnergyLimit / keV << " keV - "
    58          << highEnergyLimit / GeV << " GeV"
    59          << G4endl;
    60  
     67
     68  if(  verboseLevel>0 ) {
     69    G4cout << "Livermore Compton model is constructed " << G4endl
     70           << "Energy range: "
     71           << lowEnergyLimit / eV << " eV - "
     72           << highEnergyLimit / GeV << " GeV"
     73           << G4endl;
     74  }
    6175}
    6276
     
    6579G4LivermoreComptonModel::~G4LivermoreComptonModel()
    6680
    67   delete meanFreePathTable;
    68   delete crossSectionHandler;
    69   delete scatterFunctionData;
     81  if (crossSectionHandler) delete crossSectionHandler;
     82  if (scatterFunctionData) delete scatterFunctionData;
    7083}
    7184
     
    7386
    7487void G4LivermoreComptonModel::Initialise(const G4ParticleDefinition* particle,
    75                                       const G4DataVector& cuts)
     88                                        const G4DataVector& cuts)
    7689{
    7790  if (verboseLevel > 3)
    7891    G4cout << "Calling G4LivermoreComptonModel::Initialise()" << G4endl;
    7992
    80   InitialiseElementSelectors(particle,cuts);
    81 
    82   // Energy limits
    83  
    84   if (LowEnergyLimit() < lowEnergyLimit)
    85     {
    86       G4cout << "G4LivermoreComptonModel: low energy limit increased from " <<
    87         LowEnergyLimit()/eV << " eV to " << lowEnergyLimit << " eV" << G4endl;
    88       SetLowEnergyLimit(lowEnergyLimit);
    89     }
    90 
    91   if (HighEnergyLimit() > highEnergyLimit)
    92     {
    93       G4cout << "G4LivermoreComptonModel: high energy limit decreased from " <<
    94         HighEnergyLimit()/GeV << " GeV to " << highEnergyLimit << " GeV" << G4endl;
    95       SetHighEnergyLimit(highEnergyLimit);
    96     }
    97 
     93  if (crossSectionHandler)
     94  {
     95    crossSectionHandler->Clear();
     96    delete crossSectionHandler;
     97  }
     98 
    9899  // Reading of data files - all materials are read
    99100 
     
    113114  shellData.LoadData(file);
    114115
    115   meanFreePathTable = 0;
    116   meanFreePathTable = crossSectionHandler->BuildMeanFreePathForMaterials();
    117  
    118116  if (verboseLevel > 2)
    119117    G4cout << "Loaded cross section files for Livermore Compton model" << G4endl;
    120118
    121   G4cout << "Livermore Compton model is initialized " << G4endl
    122          << "Energy range: "
    123          << LowEnergyLimit() / keV << " keV - "
    124          << HighEnergyLimit() / GeV << " GeV"
    125          << G4endl;
    126 
    127   //
    128  
     119  InitialiseElementSelectors(particle,cuts);
     120
     121  if(  verboseLevel>0 ) {
     122    G4cout << "Livermore Compton model is initialized " << G4endl
     123           << "Energy range: "
     124           << LowEnergyLimit() / eV << " eV - "
     125           << HighEnergyLimit() / GeV << " GeV"
     126           << G4endl;
     127  }
     128  // 
    129129  if(isInitialised) return;
    130 
    131   if(pParticleChange)
    132     fParticleChange = reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange);
    133   else
    134     fParticleChange = new G4ParticleChangeForGamma();
    135    
     130  fParticleChange = GetParticleChangeForGamma();
    136131  isInitialised = true;
    137132}
     
    148143    G4cout << "Calling ComputeCrossSectionPerAtom() of G4LivermoreComptonModel" << G4endl;
    149144
    150   G4double cs = crossSectionHandler->FindValue(G4int(Z), GammaEnergy);
     145  if (GammaEnergy < lowEnergyLimit || GammaEnergy > highEnergyLimit) return 0.0;
     146   
     147  G4double cs = crossSectionHandler->FindValue(G4int(Z), GammaEnergy); 
    151148  return cs;
    152149}
     
    155152
    156153void G4LivermoreComptonModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fvect,
    157                                               const G4MaterialCutsCouple* couple,
    158                                               const G4DynamicParticle* aDynamicGamma,
    159                                               G4double,
    160                                               G4double)
     154                                                const G4MaterialCutsCouple* couple,
     155                                                const G4DynamicParticle* aDynamicGamma,
     156                                                G4double, G4double)
    161157{
     158
    162159  // The scattered gamma energy is sampled according to Klein - Nishina formula.
    163160  // then accepted or rejected depending on the Scattering Function multiplied
     
    174171  // (Nucl Phys 20(1960),15).
    175172
    176   if (verboseLevel > 3)
    177     G4cout << "Calling SampleSecondaries() of G4LivermoreComptonModel" << G4endl;
    178 
    179173  G4double photonEnergy0 = aDynamicGamma->GetKineticEnergy();
    180  
    181   if (photonEnergy0 <= lowEnergyLimit)
    182   {
     174
     175  if (verboseLevel > 3) {
     176    G4cout << "G4LivermoreComptonModel::SampleSecondaries() E(MeV)= "
     177           << photonEnergy0/MeV << " in " << couple->GetMaterial()->GetName()
     178           << G4endl;
     179  }
     180 
     181  // low-energy gamma is absorpted by this process
     182  if (photonEnergy0 <= lowEnergyLimit)
     183    {
    183184      fParticleChange->ProposeTrackStatus(fStopAndKill);
    184185      fParticleChange->SetProposedKineticEnergy(0.);
    185186      fParticleChange->ProposeLocalEnergyDeposit(photonEnergy0);
    186       // SI - IS THE FOLLOWING RETURN NECESSARY ?
    187187      return ;
    188   }
     188    }
    189189
    190190  G4double e0m = photonEnergy0 / electron_mass_c2 ;
     
    192192
    193193  // Select randomly one element in the current material
    194   G4int Z = crossSectionHandler->SelectRandomAtom(couple,photonEnergy0);
     194  //  G4int Z = crossSectionHandler->SelectRandomAtom(couple,photonEnergy0);
     195  const G4ParticleDefinition* particle =  aDynamicGamma->GetDefinition();
     196  const G4Element* elm = SelectRandomAtom(couple,particle,photonEnergy0);
     197  G4int Z = (G4int)elm->GetZ();
    195198
    196199  G4double epsilon0 = 1. / (1. + 2. * e0m);
     
    212215      if ( alpha1/(alpha1+alpha2) > G4UniformRand())
    213216      {
    214         epsilon = std::exp(-alpha1 * G4UniformRand());  // std::pow(epsilon0,G4UniformRand())
     217        // std::pow(epsilon0,G4UniformRand())
     218        epsilon = std::exp(-alpha1 * G4UniformRand()); 
    215219        epsilonSq = epsilon * epsilon;
    216220      }
     
    238242  // Doppler broadening -  Method based on:
    239243  // Y. Namito, S. Ban and H. Hirayama,
    240   // "Implementation of the Doppler Broadening of a Compton-Scattered Photon Into the EGS4 Code"
    241   // NIM A 349, pp. 489-494, 1994
     244  // "Implementation of the Doppler Broadening of a Compton-Scattered Photon
     245  // into the EGS4 Code", NIM A 349, pp. 489-494, 1994
    242246 
    243247  // Maximum number of sampling iterations
     
    257261      eMax = photonEnergy0 - bindingE;
    258262     
    259       // Randomly sample bound electron momentum (memento: the data set is in Atomic Units)
     263      // Randomly sample bound electron momentum
     264      // (memento: the data set is in Atomic Units)
    260265      G4double pSample = profileData.RandomSelectMomentum(Z,shell);
    261266      // Rescale from atomic units
     
    299304
    300305  if (photonEnergy1 > 0.)
    301   {
    302     fParticleChange->SetProposedKineticEnergy(photonEnergy1) ;
    303   }
     306    {
     307      fParticleChange->SetProposedKineticEnergy(photonEnergy1) ;
     308    }
    304309  else
    305   {
    306     fParticleChange->SetProposedKineticEnergy(0.) ;
    307     fParticleChange->ProposeTrackStatus(fStopAndKill);
    308   }
     310    {
     311      photonEnergy1 = 0.;
     312      fParticleChange->SetProposedKineticEnergy(0.) ;
     313      fParticleChange->ProposeTrackStatus(fStopAndKill);   
     314    }
    309315
    310316  // Kinematics of the scattered electron
    311317  G4double eKineticEnergy = photonEnergy0 - photonEnergy1 - bindingE;
     318
     319  // protection against negative final energy: no e- is created
     320  if(eKineticEnergy < 0.0) {
     321    fParticleChange->ProposeLocalEnergyDeposit(photonEnergy0 - photonEnergy1);
     322    return;
     323  }
    312324  G4double eTotalEnergy = eKineticEnergy + electron_mass_c2;
    313325
     
    329341  eDirection.rotateUz(photonDirection0);
    330342
    331 // SI - The range test has been removed wrt original G4LowEnergyCompton class
     343  // SI - The range test has been removed wrt original G4LowEnergyCompton class
    332344
    333345  fParticleChange->ProposeLocalEnergyDeposit(bindingE);
    334346 
    335   G4DynamicParticle* dp = new G4DynamicParticle (G4Electron::Electron(),eDirection,eKineticEnergy) ;
     347  G4DynamicParticle* dp = new G4DynamicParticle (G4Electron::Electron(),
     348                                                 eDirection,eKineticEnergy) ;
    336349  fvect->push_back(dp);
    337350}
    338351
    339 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    340 
    341 G4double G4LivermoreComptonModel::GetMeanFreePath(const G4Track& track,
    342                                              G4double, // previousStepSize
    343                                              G4ForceCondition*)
    344 {
    345   const G4DynamicParticle* photon = track.GetDynamicParticle();
    346   G4double energy = photon->GetKineticEnergy();
    347   const G4MaterialCutsCouple* couple = track.GetMaterialCutsCouple();
    348   size_t materialIndex = couple->GetIndex();
    349 
    350   G4double meanFreePath;
    351   if (energy > highEnergyLimit) meanFreePath = meanFreePathTable->FindValue(highEnergyLimit,materialIndex);
    352   else if (energy < lowEnergyLimit) meanFreePath = DBL_MAX;
    353   else meanFreePath = meanFreePathTable->FindValue(energy,materialIndex);
    354   return meanFreePath;
    355 }
    356 
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LivermoreGammaConversionModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4LivermoreGammaConversionModel.cc,v 1.1 2008/10/30 14:16:35 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
    28 //
     26// $Id: G4LivermoreGammaConversionModel.cc,v 1.6 2009/05/02 09:14:43 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     28//
     29//
     30// Author: Sebastien Inserti
     31//         30 October 2008
     32//
     33// History:
     34// --------
     35// 12 Apr 2009   V Ivanchenko Cleanup initialisation and generation of secondaries:
     36//                  - apply internal high-energy limit only in constructor
     37//                  - do not apply low-energy limit (default is 0)
     38//                  - use CLHEP electron mass for low-enegry limit
     39//                  - remove MeanFreePath method and table
     40
    2941
    3042#include "G4LivermoreGammaConversionModel.hh"
     
    3749
    3850G4LivermoreGammaConversionModel::G4LivermoreGammaConversionModel(const G4ParticleDefinition*,
    39                                              const G4String& nam)
    40 :G4VEmModel(nam),smallEnergy(2.*MeV),isInitialised(false)
    41 {
    42   lowEnergyLimit = 1.022000 * MeV;
     51                                                                 const G4String& nam)
     52  :G4VEmModel(nam),smallEnergy(2.*MeV),isInitialised(false),
     53   crossSectionHandler(0),meanFreePathTable(0)
     54{
     55  lowEnergyLimit = 2.0*electron_mass_c2;
    4356  highEnergyLimit = 100 * GeV;
    44  
    45   G4cout << "Livermore Gamma conversion is constructed " << G4endl
    46          << "Energy range: "
    47          << lowEnergyLimit / keV << " keV - "
    48          << highEnergyLimit / GeV << " GeV"
    49          << G4endl;
    50          
     57  SetHighEnergyLimit(highEnergyLimit);
     58         
    5159  verboseLevel= 0;
    5260  // Verbosity scale:
     
    5765  // 4 = entering in methods
    5866
     67  if(verboseLevel > 0) {
     68    G4cout << "Livermore Gamma conversion is constructed " << G4endl
     69           << "Energy range: "
     70           << lowEnergyLimit / MeV << " MeV - "
     71           << highEnergyLimit / GeV << " GeV"
     72           << G4endl;
     73  }
    5974}
    6075
     
    6378G4LivermoreGammaConversionModel::~G4LivermoreGammaConversionModel()
    6479
    65   delete meanFreePathTable;
    66   delete crossSectionHandler;
    67 }
    68 
    69 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    70 
    71 void G4LivermoreGammaConversionModel::Initialise(const G4ParticleDefinition* particle,
    72                                        const G4DataVector& cuts)
     80  if (crossSectionHandler) delete crossSectionHandler;
     81}
     82
     83//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     84
     85void
     86G4LivermoreGammaConversionModel::Initialise(const G4ParticleDefinition*,
     87                                            const G4DataVector&)
    7388{
    7489  if (verboseLevel > 3)
    7590    G4cout << "Calling G4LivermoreGammaConversionModel::Initialise()" << G4endl;
    7691
    77   InitialiseElementSelectors(particle,cuts);
    78 
    79   // Energy limits
    80  
    81   if (LowEnergyLimit() < lowEnergyLimit)
     92  if (crossSectionHandler)
    8293  {
    83     G4cout << "G4LivermoreGammaConversionModel: low energy limit increased from " <<
    84         LowEnergyLimit()/eV << " eV to " << lowEnergyLimit << " eV" << G4endl;
    85     SetLowEnergyLimit(lowEnergyLimit);
     94    crossSectionHandler->Clear();
     95    delete crossSectionHandler;
    8696  }
    8797
    88   if (HighEnergyLimit() > highEnergyLimit)
    89   {
    90     G4cout << "G4LivermoreGammaConversionModel: high energy limit decreased from " <<
    91         HighEnergyLimit()/GeV << " GeV to " << highEnergyLimit << " GeV" << G4endl;
    92     SetHighEnergyLimit(highEnergyLimit);
    93   }
    94 
    9598  // Read data tables for all materials
    9699 
    97100  crossSectionHandler = new G4CrossSectionHandler();
    98   crossSectionHandler->Initialise(0,1.0220*MeV,100.*GeV,400);
     101  crossSectionHandler->Initialise(0,lowEnergyLimit,100.*GeV,400);
    99102  G4String crossSectionFile = "pair/pp-cs-";
    100103  crossSectionHandler->LoadData(crossSectionFile);
    101104
    102   meanFreePathTable = 0;
    103   meanFreePathTable = crossSectionHandler->BuildMeanFreePathForMaterials();
    104 
    105105  //
    106106 
     
    108108    G4cout << "Loaded cross section files for PenelopeGammaConversion" << G4endl;
    109109
    110   G4cout << "Livermore Gamma Conversion model is initialized " << G4endl
    111          << "Energy range: "
    112          << LowEnergyLimit() / MeV << " MeV - "
    113          << HighEnergyLimit() / GeV << " GeV"
    114          << G4endl;
     110  if (verboseLevel > 0) {
     111    G4cout << "Livermore Gamma Conversion model is initialized " << G4endl
     112           << "Energy range: "
     113           << LowEnergyLimit() / MeV << " MeV - "
     114           << HighEnergyLimit() / GeV << " GeV"
     115           << G4endl;
     116  }
    115117
    116118  if(isInitialised) return;
    117 
    118   if(pParticleChange)
    119     fParticleChange = reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange);
    120   else
    121     fParticleChange = new G4ParticleChangeForGamma();
    122   isInitialised = true;}
    123 
    124 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    125 
    126 G4double G4LivermoreGammaConversionModel::ComputeCrossSectionPerAtom(
    127                                        const G4ParticleDefinition*,
    128                                              G4double GammaEnergy,
    129                                              G4double Z, G4double,
    130                                              G4double, G4double)
    131 {
    132   if (verboseLevel > 3)
    133     G4cout << "Calling ComputeCrossSectionPerAtom() of G4LivermoreGammaConversionModel" << G4endl;
     119  fParticleChange = GetParticleChangeForGamma();
     120  isInitialised = true;
     121}
     122
     123//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     124
     125G4double
     126G4LivermoreGammaConversionModel::ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
     127                                                            G4double GammaEnergy,
     128                                                            G4double Z, G4double,
     129                                                            G4double, G4double)
     130{
     131  if (verboseLevel > 3) {
     132    G4cout << "Calling ComputeCrossSectionPerAtom() of G4LivermoreGammaConversionModel"
     133           << G4endl;
     134  }
     135  if (GammaEnergy < lowEnergyLimit || GammaEnergy > highEnergyLimit) return 0;
    134136
    135137  G4double cs = crossSectionHandler->FindValue(G4int(Z), GammaEnergy);
     
    173175    {
    174176      // Select randomly one element in the current material
    175       const G4Element* element = crossSectionHandler->SelectRandomElement(couple,photonEnergy);
     177      //const G4Element* element = crossSectionHandler->SelectRandomElement(couple,photonEnergy);
     178      const G4ParticleDefinition* particle =  aDynamicGamma->GetDefinition();
     179      const G4Element* element = SelectRandomAtom(couple,particle,photonEnergy);
    176180
    177181      if (element == 0)
    178182        {
    179           G4cout << "G4LivermoreGammaConversionModel::SampleSecondaries - element = 0" << G4endl;
     183          G4cout << "G4LivermoreGammaConversionModel::SampleSecondaries - element = 0"
     184                 << G4endl;
     185          return;
    180186        }
    181187      G4IonisParamElm* ionisation = element->GetIonisation();
    182        if (ionisation == 0)
     188      if (ionisation == 0)
    183189        {
    184           G4cout << "G4LivermoreGammaConversionModel::SampleSecondaries - ionisation = 0" << G4endl;
     190          G4cout << "G4LivermoreGammaConversionModel::SampleSecondaries - ionisation = 0"
     191                 << G4endl;
     192          return;
    185193        }
    186194
     
    272280  // distribution with respect to the Z axis along the parent photon
    273281 
    274 //  aParticleChange.SetNumberOfSecondaries(2) ;
    275282  G4double electronKineEnergy = std::max(0.,electronTotEnergy - electron_mass_c2) ;
    276283 
    277 // SI - The range test has been removed wrt original G4LowEnergyGammaconversion class
     284  // SI - The range test has been removed wrt original G4LowEnergyGammaconversion class
    278285
    279286  G4ThreeVector electronDirection (dxEle, dyEle, dzEle);
     
    287294  G4double positronKineEnergy = std::max(0.,positronTotEnergy - electron_mass_c2) ;
    288295
    289 // SI - The range test has been removed wrt original G4LowEnergyGammaconversion class
     296  // SI - The range test has been removed wrt original G4LowEnergyGammaconversion class
    290297
    291298  G4ThreeVector positronDirection (dxPos, dyPos, dzPos);
     
    337344}
    338345
    339 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    340 
    341 G4double G4LivermoreGammaConversionModel::GetMeanFreePath(const G4Track& track,
    342                                                      G4double, // previousStepSize
    343                                                      G4ForceCondition*)
    344 {
    345   const G4DynamicParticle* photon = track.GetDynamicParticle();
    346   G4double energy = photon->GetKineticEnergy();
    347   const G4MaterialCutsCouple* couple = track.GetMaterialCutsCouple();
    348   size_t materialIndex = couple->GetIndex();
    349 
    350   G4double meanFreePath;
    351   if (energy > highEnergyLimit) meanFreePath = meanFreePathTable->FindValue(highEnergyLimit,materialIndex);
    352   else if (energy < lowEnergyLimit) meanFreePath = DBL_MAX;
    353   else meanFreePath = meanFreePathTable->FindValue(energy,materialIndex);
    354   return meanFreePath;
    355 }
    356 
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LivermorePhotoElectricModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4LivermorePhotoElectricModel.cc,v 1.1 2008/10/30 14:16:35 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
    28 //
     26// $Id: G4LivermorePhotoElectricModel.cc,v 1.7 2009/04/18 18:29:34 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     28//
     29//
     30// Author: Sebastien Inserti
     31//         30 October 2008
     32//
     33// History:
     34// --------
     35// 15 Apr 2009   V Ivanchenko Cleanup initialisation and generation of secondaries:
     36//                  - apply internal high-energy limit only in constructor
     37//                  - do not apply low-energy limit (default is 0)
     38//                  - remove GetMeanFreePath method and table
     39//                  - simplify sampling of deexcitation by using cut in energy
     40//                  - added protection against numerical problem in energy sampling
     41//                  - use G4ElementSelector
    2942
    3043#include "G4LivermorePhotoElectricModel.hh"
     
    3851G4LivermorePhotoElectricModel::G4LivermorePhotoElectricModel(const G4ParticleDefinition*,
    3952                                             const G4String& nam)
    40 :G4VEmModel(nam),isInitialised(false)
    41 {
    42   lowEnergyLimit = 250 * eV; // SI - Could be 10 eV ?
     53:G4VEmModel(nam),isInitialised(false),meanFreePathTable(0),
     54 crossSectionHandler(0),shellCrossSectionHandler(0),ElectronAngularGenerator(0)
     55{
     56  lowEnergyLimit = 250 * eV;
    4357  highEnergyLimit = 100 * GeV;
    44   SetLowEnergyLimit(lowEnergyLimit);
     58  //  SetLowEnergyLimit(lowEnergyLimit);
    4559  SetHighEnergyLimit(highEnergyLimit);
    46  
    47   G4cout << "Livermore Compton is constructed " << G4endl
    48          << "Energy range: "
    49          << lowEnergyLimit / keV << " keV - "
    50          << highEnergyLimit / GeV << " GeV"
    51          << G4endl;
    52  
     60
     61  ActivateAuger(false);
     62   
    5363  verboseLevel= 0;
    5464  // Verbosity scale:
     
    5868  // 3 = calculation of cross sections, file openings, sampling of atoms
    5969  // 4 = entering in methods
     70  if(verboseLevel>0) {
     71    G4cout << "Livermore PhotoElectric is constructed " << G4endl
     72           << "Energy range: "
     73           << lowEnergyLimit / eV << " eV - "
     74           << highEnergyLimit / GeV << " GeV"
     75           << G4endl;
     76  }
    6077}
    6178
     
    6481G4LivermorePhotoElectricModel::~G4LivermorePhotoElectricModel()
    6582
    66   delete meanFreePathTable;
    67   delete crossSectionHandler;
    68   delete shellCrossSectionHandler;
    69   delete ElectronAngularGenerator;
    70 }
    71 
    72 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    73 
    74 void G4LivermorePhotoElectricModel::Initialise(const G4ParticleDefinition* particle,
    75                                        const G4DataVector& cuts)
     83  if (crossSectionHandler) delete crossSectionHandler;
     84  if (shellCrossSectionHandler) delete shellCrossSectionHandler;
     85  if (ElectronAngularGenerator) delete ElectronAngularGenerator;
     86}
     87
     88//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     89
     90void
     91G4LivermorePhotoElectricModel::Initialise(const G4ParticleDefinition*,
     92                                          const G4DataVector&)
    7693{
    7794  if (verboseLevel > 3)
    7895    G4cout << "Calling G4LivermorePhotoElectricModel::Initialise()" << G4endl;
    7996
    80   InitialiseElementSelectors(particle,cuts);
    81 
    82   // Energy limits
    83  
    84   if (LowEnergyLimit() < lowEnergyLimit)
     97  if (crossSectionHandler)
    8598  {
    86       G4cout << "G4LivermorePhotoElectricModel: low energy limit increased from " <<
    87         LowEnergyLimit()/eV << " eV to " << lowEnergyLimit << " eV" <<
    88         G4endl;
    89       SetLowEnergyLimit(lowEnergyLimit);
    90   }
    91  
    92   if (HighEnergyLimit() > highEnergyLimit)
     99    crossSectionHandler->Clear();
     100    delete crossSectionHandler;
     101  }
     102 
     103  if (shellCrossSectionHandler)
    93104  {
    94       G4cout << "G4LivermorePhotoElectricModel: high energy limit decreased from " <<
    95         HighEnergyLimit()/GeV << " GeV to " << highEnergyLimit << " GeV"
    96              << G4endl;
    97       SetHighEnergyLimit(highEnergyLimit);
    98   }
    99 
     105    shellCrossSectionHandler->Clear();
     106    delete shellCrossSectionHandler;
     107  }
     108 
    100109  // Read data tables for all materials
    101110 
     
    105114  crossSectionHandler->LoadData(crossSectionFile);
    106115
    107   meanFreePathTable = 0;
    108   meanFreePathTable = crossSectionHandler->BuildMeanFreePathForMaterials();
    109 
    110116  shellCrossSectionHandler = new G4CrossSectionHandler();
    111117  shellCrossSectionHandler->Clear();
     
    113119  shellCrossSectionHandler->LoadShellData(shellCrossSectionFile);
    114120 
    115   // SI - Buggy default ?
     121  // SI - Simple generator is buggy
    116122  //generatorName = "geant4.6.2";
    117123  //ElectronAngularGenerator = new G4PhotoElectricAngularGeneratorSimple("GEANTSimpleGenerator");              // default generator
    118 
    119   //
    120  
     124  ElectronAngularGenerator =
     125    new G4PhotoElectricAngularGeneratorSauterGavrila("GEANTSauterGavrilaGenerator");       
     126
     127  // 
    121128  if (verboseLevel > 2)
    122129    G4cout << "Loaded cross section files for Livermore PhotoElectric model" << G4endl;
    123130
    124   G4cout << "Livermore PhotoElectric model is initialized " << G4endl
    125          << "Energy range: "
    126          << LowEnergyLimit() / keV << " keV - "
    127          << HighEnergyLimit() / GeV << " GeV"
    128          << G4endl;
     131  //  InitialiseElementSelectors(particle,cuts);
     132
     133  if (verboseLevel > 0) {
     134    G4cout << "Livermore PhotoElectric model is initialized " << G4endl
     135           << "Energy range: "
     136           << LowEnergyLimit() / eV << " eV - "
     137           << HighEnergyLimit() / GeV << " GeV"
     138           << G4endl;
     139  }
    129140
    130141  if(isInitialised) return;
    131 
    132   if(pParticleChange)
    133     fParticleChange = reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange);
    134   else
    135     fParticleChange = new G4ParticleChangeForGamma();
    136 
     142  fParticleChange = GetParticleChangeForGamma();
    137143  isInitialised = true;
    138144}
     
    147153{
    148154  if (verboseLevel > 3)
    149     G4cout << "Calling ComputeCrossSectionPerAtom() of G4LivermorePhotoElectricModel" << G4endl;
     155    G4cout << "Calling ComputeCrossSectionPerAtom() of G4LivermorePhotoElectricModel"
     156           << G4endl;
     157
     158  if (GammaEnergy < lowEnergyLimit || GammaEnergy > highEnergyLimit)
     159    return 0;
    150160
    151161  G4double cs = crossSectionHandler->FindValue(G4int(Z), GammaEnergy);
     
    155165//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    156166
    157 void G4LivermorePhotoElectricModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fvect,
    158                                               const G4MaterialCutsCouple* couple,
    159                                               const G4DynamicParticle* aDynamicGamma,
    160                                               G4double,
    161                                               G4double)
     167void
     168G4LivermorePhotoElectricModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fvect,
     169                                                 const G4MaterialCutsCouple* couple,
     170                                                 const G4DynamicParticle* aDynamicGamma,
     171                                                 G4double,
     172                                                 G4double)
    162173{
    163174
     
    172183  G4double photonEnergy = aDynamicGamma->GetKineticEnergy();
    173184 
     185  // kill incident photon
     186  fParticleChange->SetProposedKineticEnergy(0.);
     187  fParticleChange->ProposeTrackStatus(fStopAndKill);   
     188
     189  // low-energy gamma is absorpted by this process
    174190  if (photonEnergy <= lowEnergyLimit)
    175191    {
    176       fParticleChange->ProposeTrackStatus(fStopAndKill);
    177       fParticleChange->SetProposedKineticEnergy(0.);
    178192      fParticleChange->ProposeLocalEnergyDeposit(photonEnergy);
    179       // SI - IS THE FOLLOWING RETURN NECESSARY ?
    180       return ;
     193      return;
    181194    }
    182195 
    183   G4ThreeVector photonDirection = aDynamicGamma->GetMomentumDirection(); // Returns the normalized direction of the momentum
     196  // Returns the normalized direction of the momentum
     197  G4ThreeVector photonDirection = aDynamicGamma->GetMomentumDirection();
    184198
    185199  // Select randomly one element in the current material
    186   G4int Z = crossSectionHandler->SelectRandomAtom(couple,photonEnergy);
     200  //  G4int Z = crossSectionHandler->SelectRandomAtom(couple,photonEnergy);
     201  const G4ParticleDefinition* particle =  aDynamicGamma->GetDefinition();
     202  const G4Element* elm = SelectRandomAtom(couple->GetMaterial(),particle,photonEnergy);
     203  G4int Z = (G4int)elm->GetZ();
    187204
    188205  // Select the ionised shell in the current atom according to shell cross sections
     
    195212  G4int shellId = shell->ShellId();
    196213
    197   // Create lists of pointers to DynamicParticles (photons and electrons)
    198   // (Is the electron vector necessary? To be checked)
    199   std::vector<G4DynamicParticle*>* photonVector = 0;
    200   std::vector<G4DynamicParticle*> electronVector;
    201 
    202   G4double energyDeposit = 0.0;
    203 
    204214  // Primary outcoming electron
    205215  G4double eKineticEnergy = photonEnergy - bindingEnergy;
     
    209219  if (eKineticEnergy > 0.)
    210220    {
    211       // SI - Removed safety
    212      
    213       // Generate the electron only if with large enough range w.r.t. cuts and safety
    214       //G4double safety = aStep.GetPostStepPoint()->GetSafety();
    215 
    216       //if (rangeTest->Escape(G4Electron::Electron(),couple,eKineticEnergy,safety))
    217         {
    218 
    219           // Calculate direction of the photoelectron
    220           G4ThreeVector gammaPolarization = aDynamicGamma->GetPolarization();
    221           G4ThreeVector electronDirection = ElectronAngularGenerator->GetPhotoElectronDirection(photonDirection,eKineticEnergy,gammaPolarization,shellId);
    222 
    223           // The electron is created ...
    224           G4DynamicParticle* electron = new G4DynamicParticle (G4Electron::Electron(),
    225                                                                electronDirection,
    226                                                                eKineticEnergy);
    227           electronVector.push_back(electron);
    228         }
    229       /*else
    230         {
    231           energyDeposit += eKineticEnergy;
    232         }*/
     221      // Calculate direction of the photoelectron
     222      G4ThreeVector gammaPolarization = aDynamicGamma->GetPolarization();
     223      G4ThreeVector electronDirection =
     224        ElectronAngularGenerator->GetPhotoElectronDirection(photonDirection,
     225                                                            eKineticEnergy,
     226                                                            gammaPolarization,
     227                                                            shellId);
     228
     229      // The electron is created ...
     230      G4DynamicParticle* electron = new G4DynamicParticle (G4Electron::Electron(),
     231                                                           electronDirection,
     232                                                           eKineticEnergy);
     233      fvect->push_back(electron);
    233234    }
    234235  else
     
    237238    }
    238239
    239   G4int nElectrons = electronVector.size();
    240   size_t nTotPhotons = 0;
    241   G4int nPhotons=0;
    242   const G4ProductionCutsTable* theCoupleTable=
    243         G4ProductionCutsTable::GetProductionCutsTable();
    244 
    245   size_t index = couple->GetIndex();
    246   G4double cutg = (*(theCoupleTable->GetEnergyCutsVector(0)))[index];
    247   cutg = std::min(cutForLowEnergySecondaryPhotons,cutg);
    248  
    249   G4double cute = (*(theCoupleTable->GetEnergyCutsVector(1)))[index];
    250   cute = std::min(cutForLowEnergySecondaryPhotons,cute);
    251 
    252   G4DynamicParticle* aPhoton;
    253 
    254   // Generation of fluorescence
    255   // Data in EADL are available only for Z > 5
    256   // Protection to avoid generating photons in the unphysical case of
    257   // shell binding energy > photon energy
    258   if (Z > 5  && (bindingEnergy > cutg || bindingEnergy > cute))
    259     {
    260       photonVector = deexcitationManager.GenerateParticles(Z,shellId);
    261       nTotPhotons = photonVector->size();
    262       for (size_t k=0; k<nTotPhotons; k++)
    263         {
    264           aPhoton = (*photonVector)[k];
    265           if (aPhoton)
    266             {
    267               G4double itsCut = cutg;
    268               if(aPhoton->GetDefinition() == G4Electron::Electron()) itsCut = cute;
    269               G4double itsEnergy = aPhoton->GetKineticEnergy();
    270 
    271               if (itsEnergy > itsCut && itsEnergy <= bindingEnergy)
    272                 {
    273                   nPhotons++;
    274                   // Local energy deposit is given as the sum of the
    275                   // energies of incident photons minus the energies
    276                   // of the outcoming fluorescence photons
    277                   bindingEnergy -= itsEnergy;
    278 
    279                 }
    280               else
    281                 {
    282                   delete aPhoton;
    283                   (*photonVector)[k] = 0;
    284                 }
    285             }
    286         }
    287     }
    288 
    289   energyDeposit += bindingEnergy;
    290 
    291   // Final state
    292  
    293   for (G4int l = 0; l<nElectrons; l++ )
    294     {
    295       aPhoton = electronVector[l];
    296       if(aPhoton) {
    297         fvect->push_back(aPhoton);
     240  // deexcitation
     241  if(DeexcitationFlag() && Z > 5) {
     242
     243    const G4ProductionCutsTable* theCoupleTable=
     244      G4ProductionCutsTable::GetProductionCutsTable();
     245
     246    size_t index = couple->GetIndex();
     247    G4double cutg = (*(theCoupleTable->GetEnergyCutsVector(0)))[index];
     248    G4double cute = (*(theCoupleTable->GetEnergyCutsVector(1)))[index];
     249
     250    // Generation of fluorescence
     251    // Data in EADL are available only for Z > 5
     252    // Protection to avoid generating photons in the unphysical case of
     253    // shell binding energy > photon energy
     254    if (bindingEnergy > cutg || bindingEnergy > cute)
     255      {
     256        G4DynamicParticle* aPhoton;
     257        deexcitationManager.SetCutForSecondaryPhotons(cutg);
     258        deexcitationManager.SetCutForAugerElectrons(cute);
     259 
     260        std::vector<G4DynamicParticle*>* photonVector =
     261          deexcitationManager.GenerateParticles(Z,shellId);
     262        size_t nTotPhotons = photonVector->size();
     263        for (size_t k=0; k<nTotPhotons; k++)
     264          {
     265            aPhoton = (*photonVector)[k];
     266            if (aPhoton)
     267              {
     268                G4double itsEnergy = aPhoton->GetKineticEnergy();
     269                if (itsEnergy <= bindingEnergy)
     270                  {
     271                    // Local energy deposit is given as the sum of the
     272                    // energies of incident photons minus the energies
     273                    // of the outcoming fluorescence photons
     274                    bindingEnergy -= itsEnergy;
     275                    fvect->push_back(aPhoton);
     276                  }
     277                else
     278                  {
     279                    // abnormal case of energy non-conservation
     280                    delete aPhoton;
     281                    (*photonVector)[k] = 0;
     282                  }
     283              }
     284          }
     285        delete photonVector;
    298286      }
    299     }
    300   for ( size_t ll = 0; ll < nTotPhotons; ll++)
    301     {
    302       aPhoton = (*photonVector)[ll];
    303       if(aPhoton) {
    304         fvect->push_back(aPhoton);
    305       }
    306     }
    307 
    308   delete photonVector;
    309 
    310   if (energyDeposit < 0)
    311     {
    312       G4cout << "WARNING - "
    313              << "G4LowEnergyPhotoElectric::PostStepDoIt - Negative energy deposit"
    314              << G4endl;
    315       energyDeposit = 0;
    316     }
    317 
    318   // kill incident photon
    319   fParticleChange->ProposeMomentumDirection( 0., 0., 0. );
    320   fParticleChange->SetProposedKineticEnergy(0.);
    321   fParticleChange->ProposeTrackStatus(fStopAndKill);   
    322   fParticleChange->ProposeLocalEnergyDeposit(energyDeposit);
     287  }
     288  // excitation energy left
     289  fParticleChange->ProposeLocalEnergyDeposit(bindingEnergy);
    323290}
    324291
     
    348315//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    349316
    350 void G4LivermorePhotoElectricModel::SetAngularGenerator(G4VPhotoElectricAngularDistribution* distribution)
    351 {
    352   ElectronAngularGenerator = distribution;
     317void
     318G4LivermorePhotoElectricModel::SetAngularGenerator(G4VPhotoElectricAngularDistribution* dist)
     319{
     320  ElectronAngularGenerator = dist;
    353321  ElectronAngularGenerator->PrintGeneratorInformation();
    354322}
     
    361329    {
    362330      delete ElectronAngularGenerator;
    363       ElectronAngularGenerator = new G4PhotoElectricAngularGeneratorSimple("GEANT4LowEnergySimpleGenerator");
     331      ElectronAngularGenerator =
     332        new G4PhotoElectricAngularGeneratorSimple("GEANT4LowEnergySimpleGenerator");
    364333      generatorName = name;
    365334    }
     
    367336    {
    368337      delete ElectronAngularGenerator;
    369       ElectronAngularGenerator = new G4PhotoElectricAngularGeneratorSauterGavrila("GEANT4SauterGavrilaGenerator");
     338      ElectronAngularGenerator =
     339        new G4PhotoElectricAngularGeneratorSauterGavrila("GEANT4SauterGavrilaGenerator");
    370340      generatorName = name;
    371341    }
     
    373343    {
    374344      delete ElectronAngularGenerator;
    375       ElectronAngularGenerator = new G4PhotoElectricAngularGeneratorPolarized("GEANT4LowEnergyPolarizedGenerator");
     345      ElectronAngularGenerator =
     346        new G4PhotoElectricAngularGeneratorPolarized("GEANT4LowEnergyPolarizedGenerator");
    376347      generatorName = name;
    377348    }
     
    384355}
    385356
    386 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    387 
    388 G4double G4LivermorePhotoElectricModel::GetMeanFreePath(const G4Track& track,
    389                                                    G4double, // previousStepSize
    390                                                G4ForceCondition*)
    391 {
    392   const G4DynamicParticle* photon = track.GetDynamicParticle();
    393   G4double energy = photon->GetKineticEnergy();
    394   G4Material* material = track.GetMaterial();
    395   //  size_t materialIndex = material->GetIndex();
    396 
    397   G4double meanFreePath = DBL_MAX;
    398 
    399   //  if (energy > highEnergyLimit)
    400   //    meanFreePath = meanFreePathTable->FindValue(highEnergyLimit,materialIndex);
    401   //  else if (energy < lowEnergyLimit) meanFreePath = DBL_MAX;
    402   //  else meanFreePath = meanFreePathTable->FindValue(energy,materialIndex);
    403 
    404   G4double cross = shellCrossSectionHandler->ValueForMaterial(material,energy);
    405   if(cross > 0.0) meanFreePath = 1.0/cross;
    406 
    407   return meanFreePath;
    408 }
    409 
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LivermorePolarizedComptonModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4LivermorePolarizedComptonModel.cc,v 1.1 2008/10/30 14:16:35 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4LivermorePolarizedComptonModel.cc,v 1.6 2009/05/03 08:29:55 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
     29// History:
     30// --------
     31// 02 May 2009   S Incerti as V. Ivanchenko proposed in G4LivermoreComptonModel.cc
     32//
     33// Cleanup initialisation and generation of secondaries:
     34//                  - apply internal high-energy limit only in constructor
     35//                  - do not apply low-energy limit (default is 0)
     36//                  - remove GetMeanFreePath method and table
     37//                  - added protection against numerical problem in energy sampling
     38//                  - use G4ElementSelector
    2939
    3040#include "G4LivermorePolarizedComptonModel.hh"
     
    3848G4LivermorePolarizedComptonModel::G4LivermorePolarizedComptonModel(const G4ParticleDefinition*,
    3949                                             const G4String& nam)
    40 :G4VEmModel(nam),isInitialised(false)
    41 {
    42   lowEnergyLimit = 250 * eV; // SI - Could be 10 eV ?
     50:G4VEmModel(nam),isInitialised(false),meanFreePathTable(0),scatterFunctionData(0),crossSectionHandler(0)
     51{
     52  lowEnergyLimit = 250 * eV;
    4353  highEnergyLimit = 100 * GeV;
    44   SetLowEnergyLimit(lowEnergyLimit);
     54  //SetLowEnergyLimit(lowEnergyLimit);
    4555  SetHighEnergyLimit(highEnergyLimit);
    4656 
     
    5363  // 4 = entering in methods
    5464
     65  if( verboseLevel>0 ) {
    5566  G4cout << "Livermore Polarized Compton is constructed " << G4endl
    5667         << "Energy range: "
    57          << lowEnergyLimit / keV << " keV - "
     68         << lowEnergyLimit / eV << " eV - "
    5869         << highEnergyLimit / GeV << " GeV"
    5970         << G4endl;
    60 
     71  }
    6172}
    6273
     
    6576G4LivermorePolarizedComptonModel::~G4LivermorePolarizedComptonModel()
    6677
    67   delete meanFreePathTable;
    68   delete crossSectionHandler;
    69   delete scatterFunctionData;
     78  if (meanFreePathTable)   delete meanFreePathTable;
     79  if (crossSectionHandler) delete crossSectionHandler;
     80  if (scatterFunctionData) delete scatterFunctionData;
    7081}
    7182
     
    7889    G4cout << "Calling G4LivermorePolarizedComptonModel::Initialise()" << G4endl;
    7990
    80   InitialiseElementSelectors(particle,cuts);
    81 
    82   // Energy limits
    83  
    84   if (LowEnergyLimit() < lowEnergyLimit)
    85     {
    86       G4cout << "G4LivermorePolarizedComptonModel: low energy limit increased from " <<
    87         LowEnergyLimit()/eV << " eV to " << lowEnergyLimit << " eV" << G4endl;
    88       SetLowEnergyLimit(lowEnergyLimit);
    89     }
    90 
    91   if (HighEnergyLimit() > highEnergyLimit)
    92     {
    93       G4cout << "G4LivermorePolarizedComptonModel: high energy limit decreased from " <<
    94         HighEnergyLimit()/GeV << " GeV to " << highEnergyLimit << " GeV" << G4endl;
    95       SetHighEnergyLimit(highEnergyLimit);
    96     }
     91  if (crossSectionHandler)
     92  {
     93    crossSectionHandler->Clear();
     94    delete crossSectionHandler;
     95  }
    9796
    9897  // Reading of data files - all materials are read
     
    116115  shellData.LoadData(file);
    117116
    118   //
    119117  if (verboseLevel > 2)
    120118    G4cout << "Loaded cross section files for Livermore Polarized Compton model" << G4endl;
    121119
    122   G4cout << "Livermore Polarized Compton model is initialized " << G4endl
     120  InitialiseElementSelectors(particle,cuts);
     121
     122  if(  verboseLevel>0 ) {
     123    G4cout << "Livermore Polarized Compton model is initialized " << G4endl
    123124         << "Energy range: "
    124          << LowEnergyLimit() / keV << " keV - "
     125         << LowEnergyLimit() / eV << " eV - "
    125126         << HighEnergyLimit() / GeV << " GeV"
    126127         << G4endl;
    127 
     128  }
     129 
    128130  //
    129131   
    130132  if(isInitialised) return;
    131 
    132   if(pParticleChange)
    133     fParticleChange = reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange);
    134   else
    135     fParticleChange = new G4ParticleChangeForGamma();
    136    
     133  fParticleChange = GetParticleChangeForGamma();
    137134  isInitialised = true;
    138135}
     
    149146    G4cout << "Calling ComputeCrossSectionPerAtom() of G4LivermorePolarizedComptonModel" << G4endl;
    150147
     148  if (GammaEnergy < lowEnergyLimit || GammaEnergy > highEnergyLimit) return 0.0;
     149
    151150  G4double cs = crossSectionHandler->FindValue(G4int(Z), GammaEnergy);
    152151  return cs;
     
    203202      fParticleChange->SetProposedKineticEnergy(0.);
    204203      fParticleChange->ProposeLocalEnergyDeposit(gammaEnergy0);
    205       // SI - IS THE FOLLOWING RETURN NECESSARY ?
    206204      return;
    207205    }
     
    210208
    211209  // Select randomly one element in the current material
    212 
    213   G4int Z = crossSectionHandler->SelectRandomAtom(couple,gammaEnergy0);
     210  //G4int Z = crossSectionHandler->SelectRandomAtom(couple,gammaEnergy0);
     211  const G4ParticleDefinition* particle =  aDynamicGamma->GetDefinition();
     212  const G4Element* elm = SelectRandomAtom(couple,particle,gammaEnergy0);
     213  G4int Z = (G4int)elm->GetZ();
    214214
    215215  // Sample the energy and the polarization of the scattered photon
     
    429429  else
    430430    {
     431      gammaEnergy1 = 0.;
    431432      fParticleChange->SetProposedKineticEnergy(0.) ;
    432433      fParticleChange->ProposeTrackStatus(fStopAndKill);
     
    439440  G4double ElecKineEnergy = gammaEnergy0 - gammaEnergy1 -bindingE;
    440441
     442  // SI -protection against negative final energy: no e- is created
     443  // like in G4LivermoreComptonModel.cc
     444  if(ElecKineEnergy < 0.0) {
     445    fParticleChange->ProposeLocalEnergyDeposit(gammaEnergy0 - gammaEnergy1);
     446    return;
     447  }
     448 
    441449  // SI - Removed range test
    442450 
     
    664672}
    665673
    666 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    667 
    668 G4double G4LivermorePolarizedComptonModel::GetMeanFreePath(const G4Track& track,
    669                                                       G4double,
    670                                                       G4ForceCondition*)
    671 {
    672   const G4DynamicParticle* photon = track.GetDynamicParticle();
    673   G4double energy = photon->GetKineticEnergy();
    674   const G4MaterialCutsCouple* couple = track.GetMaterialCutsCouple();
    675   size_t materialIndex = couple->GetIndex();
    676   G4double meanFreePath;
    677   if (energy > highEnergyLimit) meanFreePath = meanFreePathTable->FindValue(highEnergyLimit,materialIndex);
    678   else if (energy < lowEnergyLimit) meanFreePath = DBL_MAX;
    679   else meanFreePath = meanFreePathTable->FindValue(energy,materialIndex);
    680   return meanFreePath;
    681 }
    682 
    683 
     674
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LivermorePolarizedRayleighModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4LivermorePolarizedRayleighModel.cc,v 1.1 2008/10/30 14:16:35 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4LivermorePolarizedRayleighModel.cc,v 1.5 2009/05/02 15:20:53 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
     29// History:
     30// --------
     31// 02 May 2009   S Incerti as V. Ivanchenko proposed in G4LivermoreRayleighModel.cc
     32//
     33// Cleanup initialisation and generation of secondaries:
     34//                  - apply internal high-energy limit only in constructor
     35//                  - do not apply low-energy limit (default is 0)
     36//                  - remove GetMeanFreePath method and table
     37//                  - remove initialisation of element selector
     38//                  - use G4ElementSelector
    2939
    3040#include "G4LivermorePolarizedRayleighModel.hh"
     
    3848G4LivermorePolarizedRayleighModel::G4LivermorePolarizedRayleighModel(const G4ParticleDefinition*,
    3949                                             const G4String& nam)
    40 :G4VEmModel(nam),isInitialised(false)
    41 {
    42   lowEnergyLimit = 250 * eV; // SI - Could be 10 eV ?
     50:G4VEmModel(nam),isInitialised(false),crossSectionHandler(0),formFactorData(0)
     51{
     52  lowEnergyLimit = 250 * eV;
    4353  highEnergyLimit = 100 * GeV;
    4454 
    45   SetLowEnergyLimit(lowEnergyLimit);
     55  //SetLowEnergyLimit(lowEnergyLimit);
    4656  SetHighEnergyLimit(highEnergyLimit);
    4757  //
     
    5464  // 4 = entering in methods
    5565
    56   G4cout << "Livermore Polarized Rayleigh is constructed " << G4endl
     66  if(verboseLevel > 0) {
     67    G4cout << "Livermore Polarized Rayleigh is constructed " << G4endl
    5768         << "Energy range: "
    58          << lowEnergyLimit / keV << " keV - "
     69         << lowEnergyLimit / eV << " eV - "
    5970         << highEnergyLimit / GeV << " GeV"
    6071         << G4endl;
     72  }
    6173}
    6274
     
    6577G4LivermorePolarizedRayleighModel::~G4LivermorePolarizedRayleighModel()
    6678
    67   delete crossSectionHandler;
    68   delete formFactorData;
     79  if (crossSectionHandler) delete crossSectionHandler;
     80  if (formFactorData) delete formFactorData;
    6981}
    7082
     
    8496    G4cout << "Calling G4LivermorePolarizedRayleighModel::Initialise()" << G4endl;
    8597
    86   InitialiseElementSelectors(particle,cuts);
    87 
    88   // Energy limits
    89  
    90   if (LowEnergyLimit() < lowEnergyLimit)
    91     {
    92       G4cout << "G4LivermorePolarizedRayleighModel: low energy limit increased from " <<
    93         LowEnergyLimit()/eV << " eV to " << lowEnergyLimit << " eV" << G4endl;
    94       SetLowEnergyLimit(lowEnergyLimit);
    95     }
    96   if (HighEnergyLimit() > highEnergyLimit)
    97     {
    98       G4cout << "G4LivermorePolarizedRayleighModel: high energy limit decreased from " <<
    99         HighEnergyLimit()/GeV << " GeV to " << highEnergyLimit << " GeV" << G4endl;
    100       SetHighEnergyLimit(highEnergyLimit);
    101     }
    102    
     98  if (crossSectionHandler)
     99  {
     100    crossSectionHandler->Clear();
     101    delete crossSectionHandler;
     102  }
     103 
    103104  // Read data files for all materials
    104105
     
    113114  formFactorData->LoadData(formFactorFile);
    114115
     116  InitialiseElementSelectors(particle,cuts);
     117
    115118  //
    116119  if (verboseLevel > 2)
    117120    G4cout << "Loaded cross section files for Livermore Polarized Rayleigh model" << G4endl;
    118121
    119   G4cout << "Livermore Polarized Rayleigh model is initialized " << G4endl
     122  InitialiseElementSelectors(particle,cuts);
     123
     124  if (verboseLevel > 0) {
     125    G4cout << "Livermore Polarized Rayleigh model is initialized " << G4endl
    120126         << "Energy range: "
    121          << LowEnergyLimit() / keV << " keV - "
     127         << LowEnergyLimit() / eV << " eV - "
    122128         << HighEnergyLimit() / GeV << " GeV"
    123129         << G4endl;
     130         }
    124131
    125132  if(isInitialised) return;
    126 
    127   if(pParticleChange)
    128     fParticleChange = reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange);
    129   else
    130     fParticleChange = new G4ParticleChangeForGamma();
    131    
     133  fParticleChange = GetParticleChangeForGamma();
    132134  isInitialised = true;
    133135}
     
    144146    G4cout << "Calling CrossSectionPerAtom() of G4LivermorePolarizedRayleighModel" << G4endl;
    145147
     148  if (GammaEnergy < lowEnergyLimit || GammaEnergy > highEnergyLimit) return 0.0;
     149
    146150  G4double cs = crossSectionHandler->FindValue(G4int(Z), GammaEnergy);
    147151  return cs;
     
    166170      fParticleChange->SetProposedKineticEnergy(0.);
    167171      fParticleChange->ProposeLocalEnergyDeposit(photonEnergy0);
    168       // SI - IS THE FOLLOWING RETURN NECESSARY ?
    169172      return ;
    170173  }
     
    173176
    174177  // Select randomly one element in the current material
    175   G4int Z = crossSectionHandler->SelectRandomAtom(couple,photonEnergy0);
     178  // G4int Z = crossSectionHandler->SelectRandomAtom(couple,photonEnergy0);
     179  const G4ParticleDefinition* particle =  aDynamicGamma->GetDefinition();
     180  const G4Element* elm = SelectRandomAtom(couple,particle,photonEnergy0);
     181  G4int Z = (G4int)elm->GetZ();
    176182
    177183  G4double outcomingPhotonCosTheta = GenerateCosTheta(photonEnergy0, Z);
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LivermoreRayleighModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4LivermoreRayleighModel.cc,v 1.1 2008/10/30 14:16:35 sincerti Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
    28 //
     26// $Id: G4LivermoreRayleighModel.cc,v 1.6 2009/04/18 18:29:34 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     28//
     29// Author: Sebastien Inserti
     30//         30 October 2008
     31//
     32// History:
     33// --------
     34// 18 Apr 2009   V Ivanchenko Cleanup initialisation and generation of secondaries:
     35//                  - apply internal high-energy limit only in constructor
     36//                  - do not apply low-energy limit (default is 0)
     37//                  - remove GetMeanFreePath method and table
     38//                  - remove initialisation of element selector
     39//                  - use G4ElementSelector
    2940
    3041#include "G4LivermoreRayleighModel.hh"
     
    3748
    3849G4LivermoreRayleighModel::G4LivermoreRayleighModel(const G4ParticleDefinition*,
    39                                              const G4String& nam)
    40 :G4VEmModel(nam),isInitialised(false)
    41 {
    42   lowEnergyLimit = 250 * eV; // SI - Could be 10 eV ?
     50                                                   const G4String& nam)
     51  :G4VEmModel(nam),isInitialised(false),meanFreePathTable(0),
     52   formFactorData(0),crossSectionHandler(0)
     53{
     54  lowEnergyLimit = 250 * eV;
    4355  highEnergyLimit = 100 * GeV;
    4456 
    45   SetLowEnergyLimit(lowEnergyLimit);
     57  //  SetLowEnergyLimit(lowEnergyLimit);
    4658  SetHighEnergyLimit(highEnergyLimit);
    4759  //
     
    5466  // 4 = entering in methods
    5567
    56   G4cout << "Livermore Rayleigh is constructed " << G4endl
    57          << "Energy range: "
    58          << lowEnergyLimit / keV << " keV - "
    59          << highEnergyLimit / GeV << " GeV"
    60          << G4endl;
     68  if(verboseLevel > 0) {
     69    G4cout << "Livermore Rayleigh is constructed " << G4endl
     70           << "Energy range: "
     71           << lowEnergyLimit / eV << " eV - "
     72           << highEnergyLimit / GeV << " GeV"
     73           << G4endl;
     74  }
    6175}
    6276
     
    6579G4LivermoreRayleighModel::~G4LivermoreRayleighModel()
    6680
    67   delete meanFreePathTable;
    68   delete crossSectionHandler;
    69   delete formFactorData;
     81  if (crossSectionHandler) delete crossSectionHandler;
     82  if (formFactorData) delete formFactorData;
    7083}
    7184
     
    7386
    7487void G4LivermoreRayleighModel::Initialise(const G4ParticleDefinition* particle,
    75                                        const G4DataVector& cuts)
     88                                          const G4DataVector& cuts)
    7689{
    7790  if (verboseLevel > 3)
    7891    G4cout << "Calling G4LivermoreRayleighModel::Initialise()" << G4endl;
    7992
    80   InitialiseElementSelectors(particle,cuts);
    81 
    82   // Energy limits
     93  if (crossSectionHandler)
     94  {
     95    crossSectionHandler->Clear();
     96    delete crossSectionHandler;
     97  }
    8398 
    84   if (LowEnergyLimit() < lowEnergyLimit)
    85   {
    86     G4cout << "G4LivermoreRayleighModel: low energy limit increased from " <<
    87         LowEnergyLimit()/eV << " eV to " << lowEnergyLimit << " eV" << G4endl;
    88     SetLowEnergyLimit(lowEnergyLimit);
    89   }
    90 
    91   if (HighEnergyLimit() > highEnergyLimit)
    92   {
    93     G4cout << "G4LivermoreRayleighModel: high energy limit decreased from " <<
    94         HighEnergyLimit()/GeV << " GeV to " << highEnergyLimit << " GeV" << G4endl;
    95     SetHighEnergyLimit(highEnergyLimit);
    96   }
    97 
    9899  // Data are read for all materials
    99100 
     
    103104  crossSectionHandler->LoadData(crossSectionFile);
    104105
    105   meanFreePathTable = 0;
    106   meanFreePathTable = crossSectionHandler->BuildMeanFreePathForMaterials();
    107 
    108106  G4VDataSetAlgorithm* ffInterpolation = new G4LogLogInterpolation;
    109107  G4String formFactorFile = "rayl/re-ff-";
     
    111109  formFactorData->LoadData(formFactorFile);
    112110
    113   //
    114  
     111  InitialiseElementSelectors(particle,cuts);
     112
     113  // 
    115114  if (verboseLevel > 2)
    116115    G4cout << "Loaded cross section files for Livermore Rayleigh model" << G4endl;
    117116
    118   G4cout << "Livermore Rayleigh model is initialized " << G4endl
    119          << "Energy range: "
    120          << LowEnergyLimit() / keV << " keV - "
    121          << HighEnergyLimit() / GeV << " GeV"
    122          << G4endl;
     117  if (verboseLevel > 0) {
     118    G4cout << "Livermore Rayleigh model is initialized " << G4endl
     119           << "Energy range: "
     120           << LowEnergyLimit() / eV << " eV - "
     121           << HighEnergyLimit() / GeV << " GeV"
     122           << G4endl;
     123  }
    123124
    124125  if(isInitialised) return;
    125 
    126   if(pParticleChange)
    127     fParticleChange = reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange);
    128   else
    129     fParticleChange = new G4ParticleChangeForGamma();
    130 
     126  fParticleChange = GetParticleChangeForGamma();
    131127  isInitialised = true;
    132128
     
    144140    G4cout << "Calling CrossSectionPerAtom() of G4LivermoreRayleighModel" << G4endl;
    145141
     142  if (GammaEnergy < lowEnergyLimit || GammaEnergy > highEnergyLimit)
     143    return 0.0;
     144
    146145  G4double cs = crossSectionHandler->FindValue(G4int(Z), GammaEnergy);
    147146  return cs;
     
    160159
    161160  G4double photonEnergy0 = aDynamicGamma->GetKineticEnergy();
    162  
     161
     162  // absorption of low-energy gamma 
    163163  if (photonEnergy0 <= lowEnergyLimit)
    164   {
     164    {
    165165      fParticleChange->ProposeTrackStatus(fStopAndKill);
    166166      fParticleChange->SetProposedKineticEnergy(0.);
    167167      fParticleChange->ProposeLocalEnergyDeposit(photonEnergy0);
    168       // SI - IS THE FOLLOWING RETURN NECESSARY ?
    169168      return ;
    170   }
     169    }
    171170
    172171  G4ParticleMomentum photonDirection0 = aDynamicGamma->GetMomentumDirection();
    173172
    174173  // Select randomly one element in the current material
    175   G4int Z = crossSectionHandler->SelectRandomAtom(couple,photonEnergy0);
     174  //  G4int Z = crossSectionHandler->SelectRandomAtom(couple,photonEnergy0);
     175  const G4ParticleDefinition* particle =  aDynamicGamma->GetDefinition();
     176  const G4Element* elm = SelectRandomAtom(couple,particle,photonEnergy0);
     177  G4int Z = (G4int)elm->GetZ();
    176178
    177179  // Sample the angle of the scattered photon
     
    188190    {
    189191      do
    190       {
    191       cosTheta = 2. * G4UniformRand() - 1.;
    192       fcostheta = ( 1. + cosTheta*cosTheta)/2.;
    193       } while (fcostheta < G4UniformRand());
     192        {
     193          cosTheta = 2. * G4UniformRand() - 1.;
     194          fcostheta = ( 1. + cosTheta*cosTheta)/2.;
     195        } while (fcostheta < G4UniformRand());
    194196
    195197      G4double sinThetaHalf = std::sqrt((1. - cosTheta) / 2.);
    196198      x = sinThetaHalf / (wlPhoton/cm);
    197199      if (x > 1.e+005)
    198          dataFormFactor = formFactorData->FindValue(x,Z-1);
     200        {
     201          dataFormFactor = formFactorData->FindValue(x,Z-1);
     202        }
    199203      else
    200          dataFormFactor = formFactorData->FindValue(0.,Z-1);
     204        {
     205          dataFormFactor = formFactorData->FindValue(0.,Z-1);
     206        }
    201207      randomFormFactor = G4UniformRand() * Z * Z;
    202208      sinTheta = std::sqrt(1. - cosTheta*cosTheta);
     
    219225}
    220226
    221 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    222 
    223 G4double G4LivermoreRayleighModel::GetMeanFreePath(const G4Track& track,
    224                                               G4double, // previousStepSize
    225                                               G4ForceCondition*)
    226 {
    227   const G4DynamicParticle* photon = track.GetDynamicParticle();
    228   G4double energy = photon->GetKineticEnergy();
    229   const G4MaterialCutsCouple* couple = track.GetMaterialCutsCouple();
    230   size_t materialIndex = couple->GetIndex();
    231 
    232   G4double meanFreePath;
    233   if (energy > highEnergyLimit) meanFreePath = meanFreePathTable->FindValue(highEnergyLimit,materialIndex);
    234   else if (energy < lowEnergyLimit) meanFreePath = DBL_MAX;
    235   else meanFreePath = meanFreePathTable->FindValue(energy,materialIndex);
    236   return meanFreePath;
    237 }
    238 
     227
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LowEnergyBremsstrahlung.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4LowEnergyBremsstrahlung.cc,v 1.71 2006/06/29 19:40:13 gunter Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4LowEnergyBremsstrahlung.cc,v 1.72 2009/05/02 09:59:16 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// --------------------------------------------------------------
     
    9393//  angularDistribution->PrintGeneratorInformation();
    9494  TsaiAngularDistribution = new G4ModifiedTsai("TsaiGenerator");
     95
     96
     97   G4cout << G4endl;
     98   G4cout << "*******************************************************************************" << G4endl;
     99   G4cout << "*******************************************************************************" << G4endl;
     100   G4cout << "   The class G4LowEnergyBremsstrahlung is NOT SUPPORTED ANYMORE. " << G4endl;
     101   G4cout << "   It will be REMOVED with the next major release of Geant4. " << G4endl;
     102   G4cout << "   Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl;
     103   G4cout << "*******************************************************************************" << G4endl;
     104   G4cout << "*******************************************************************************" << G4endl;
     105   G4cout << G4endl;
    95106}
    96107
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LowEnergyCompton.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4LowEnergyCompton.cc,v 1.47 2008/12/18 13:01:28 gunter Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4LowEnergyCompton.cc,v 1.48 2009/05/02 09:59:16 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// Author: A. Forti
     
    104104              << G4endl;
    105105     }
     106
     107   G4cout << G4endl;
     108   G4cout << "*******************************************************************************" << G4endl;
     109   G4cout << "*******************************************************************************" << G4endl;
     110   G4cout << "   The class G4LowEnergyCompton is NOT SUPPORTED ANYMORE. " << G4endl;
     111   G4cout << "   It will be REMOVED with the next major release of Geant4. " << G4endl;
     112   G4cout << "   Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl;
     113   G4cout << "*******************************************************************************" << G4endl;
     114   G4cout << "*******************************************************************************" << G4endl;
     115   G4cout << G4endl;
    106116}
    107117
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LowEnergyGammaConversion.cc

    r1007 r1055  
    2626// --------------------------------------------------------------------
    2727///
    28 // $Id: G4LowEnergyGammaConversion.cc,v 1.36 2006/06/29 19:40:17 gunter Exp $
    29 // GEANT4 tag $Name: geant4-09-02 $
     28// $Id: G4LowEnergyGammaConversion.cc,v 1.37 2009/05/02 09:59:16 sincerti Exp $
     29// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    3030//
    3131//
     
    104104              << G4endl;
    105105     }
     106
     107   G4cout << G4endl;
     108   G4cout << "*******************************************************************************" << G4endl;
     109   G4cout << "*******************************************************************************" << G4endl;
     110   G4cout << "   The class G4LowEnergyGammaConversion is NOT SUPPORTED ANYMORE. " << G4endl;
     111   G4cout << "   It will be REMOVED with the next major release of Geant4. " << G4endl;
     112   G4cout << "   Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl;
     113   G4cout << "*******************************************************************************" << G4endl;
     114   G4cout << "*******************************************************************************" << G4endl;
     115   G4cout << G4endl;
    106116}
    107117 
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LowEnergyIonisation.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4LowEnergyIonisation.cc,v 1.103 2008/05/02 19:23:38 pia Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4LowEnergyIonisation.cc,v 1.104 2009/05/02 09:59:16 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// --------------------------------------------------------------
     
    131131  cutForElectrons = 250.0*eV;
    132132  verboseLevel = 0;
     133
     134   G4cout << G4endl;
     135   G4cout << "*******************************************************************************" << G4endl;
     136   G4cout << "*******************************************************************************" << G4endl;
     137   G4cout << "   The class G4LowEnergyIonisation is NOT SUPPORTED ANYMORE. " << G4endl;
     138   G4cout << "   It will be REMOVED with the next major release of Geant4. " << G4endl;
     139   G4cout << "   Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl;
     140   G4cout << "*******************************************************************************" << G4endl;
     141   G4cout << "*******************************************************************************" << G4endl;
     142   G4cout << G4endl;
    133143}
    134144
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LowEnergyPhotoElectric.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4LowEnergyPhotoElectric.cc,v 1.56 2006/06/29 19:40:23 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4LowEnergyPhotoElectric.cc,v 1.57 2009/05/02 09:59:16 sincerti Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Author: A. Forti
     
    122122             << G4endl;
    123123    }
     124
     125   G4cout << G4endl;
     126   G4cout << "*******************************************************************************" << G4endl;
     127   G4cout << "*******************************************************************************" << G4endl;
     128   G4cout << "   The class G4LowEnergyPhotoElectric is NOT SUPPORTED ANYMORE. " << G4endl;
     129   G4cout << "   It will be REMOVED with the next major release of Geant4. " << G4endl;
     130   G4cout << "   Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl;
     131   G4cout << "*******************************************************************************" << G4endl;
     132   G4cout << "*******************************************************************************" << G4endl;
     133   G4cout << G4endl;
    124134}
    125135
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LowEnergyPolarizedCompton.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4LowEnergyPolarizedCompton.cc,v 1.25 2008/05/02 19:23:38 pia Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4LowEnergyPolarizedCompton.cc,v 1.26 2009/05/02 09:59:16 sincerti Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// ------------------------------------------------------------
     
    122122              << G4endl;
    123123     }
     124
     125   G4cout << G4endl;
     126   G4cout << "*******************************************************************************" << G4endl;
     127   G4cout << "*******************************************************************************" << G4endl;
     128   G4cout << "   The class G4LowEnergyPolarizedCompton is NOT SUPPORTED ANYMORE. " << G4endl;
     129   G4cout << "   It will be REMOVED with the next major release of Geant4. " << G4endl;
     130   G4cout << "   Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl;
     131   G4cout << "*******************************************************************************" << G4endl;
     132   G4cout << "*******************************************************************************" << G4endl;
     133   G4cout << G4endl;
    124134}
    125135
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LowEnergyPolarizedRayleigh.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4LowEnergyPolarizedRayleigh.cc,v 1.7 2006/06/29 19:40:27 gunter Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4LowEnergyPolarizedRayleigh.cc,v 1.8 2009/05/02 09:59:16 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// --------------------------------------------------------------
     
    6363 
    6464 
     65   G4cout << G4endl;
     66   G4cout << "*******************************************************************************" << G4endl;
     67   G4cout << "*******************************************************************************" << G4endl;
     68   G4cout << "   The class G4LowEnergyPolarizedRayleigh is NOT SUPPORTED ANYMORE. " << G4endl;
     69   G4cout << "   It will be REMOVED with the next major release of Geant4. " << G4endl;
     70   G4cout << "   Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl;
     71   G4cout << "*******************************************************************************" << G4endl;
     72   G4cout << "*******************************************************************************" << G4endl;
     73   G4cout << G4endl;
    6574}
    6675
  • trunk/source/processes/electromagnetic/lowenergy/src/G4LowEnergyRayleigh.cc

    r1007 r1055  
    2626// --------------------------------------------------------------------
    2727//
    28 // $Id: G4LowEnergyRayleigh.cc,v 1.37 2006/06/29 19:40:29 gunter Exp $
    29 // GEANT4 tag $Name: geant4-09-02 $
     28// $Id: G4LowEnergyRayleigh.cc,v 1.38 2009/05/02 09:59:16 sincerti Exp $
     29// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    3030//
    3131// Author: A. Forti
     
    9999              << G4endl;
    100100     }
     101
     102   G4cout << G4endl;
     103   G4cout << "*******************************************************************************" << G4endl;
     104   G4cout << "*******************************************************************************" << G4endl;
     105   G4cout << "   The class G4LowEnergyRayleigh is NOT SUPPORTED ANYMORE. " << G4endl;
     106   G4cout << "   It will be REMOVED with the next major release of Geant4. " << G4endl;
     107   G4cout << "   Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl;
     108   G4cout << "*******************************************************************************" << G4endl;
     109   G4cout << "*******************************************************************************" << G4endl;
     110   G4cout << G4endl;
    101111}
    102112
  • trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeAnnihilation.cc

    r819 r1055  
    6464             << G4endl;
    6565    }
     66
     67   G4cout << G4endl;
     68   G4cout << "*******************************************************************************" << G4endl;
     69   G4cout << "*******************************************************************************" << G4endl;
     70   G4cout << "   The class G4PenelopeAnnihilation is NOT SUPPORTED ANYMORE. " << G4endl;
     71   G4cout << "   It will be REMOVED with the next major release of Geant4. " << G4endl;
     72   G4cout << "   Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl;
     73   G4cout << "*******************************************************************************" << G4endl;
     74   G4cout << "*******************************************************************************" << G4endl;
     75   G4cout << G4endl;
    6676}
    6777
  • trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeAnnihilationModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PenelopeAnnihilationModel.cc,v 1.2 2008/12/04 14:09:36 pandola Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4PenelopeAnnihilationModel.cc,v 1.3 2009/04/17 10:29:20 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// Author: Luciano Pandola
     
    3232// --------
    3333// 29 Oct 2008   L Pandola    Migration from process to model
    34 //
     34// 15 Apr 2009   V Ivanchenko Cleanup initialisation and generation of secondaries:
     35//                  - apply internal high-energy limit only in constructor
     36//                  - do not apply low-energy limit (default is 0)
     37//                  - do not use G4ElementSelector
    3538
    3639#include "G4PenelopeAnnihilationModel.hh"
     
    4851  :G4VEmModel(nam),isInitialised(false)
    4952{
    50   fIntrinsicLowEnergyLimit = 0.0*eV;
     53  fIntrinsicLowEnergyLimit = 0.0;
    5154  fIntrinsicHighEnergyLimit = 100.0*GeV;
    52   SetLowEnergyLimit(fIntrinsicLowEnergyLimit);
     55  //  SetLowEnergyLimit(fIntrinsicLowEnergyLimit);
    5356  SetHighEnergyLimit(fIntrinsicHighEnergyLimit);
    5457 
     
    7376//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    7477
    75 void G4PenelopeAnnihilationModel::Initialise(const G4ParticleDefinition* particle,
    76                                        const G4DataVector& cuts)
     78void G4PenelopeAnnihilationModel::Initialise(const G4ParticleDefinition*,
     79                                             const G4DataVector&)
    7780{
    7881  if (verboseLevel > 3)
    7982    G4cout << "Calling G4PenelopeAnnihilationModel::Initialise()" << G4endl;
    8083
    81   InitialiseElementSelectors(particle,cuts);
    82   if (LowEnergyLimit() < fIntrinsicLowEnergyLimit)
    83     {
    84       G4cout << "G4PenelopeAnnihilationModel: low energy limit increased from " <<
    85         LowEnergyLimit()/eV << " eV to " << fIntrinsicLowEnergyLimit/eV << " eV" << G4endl;
    86       SetLowEnergyLimit(fIntrinsicLowEnergyLimit);
    87     }
    88   if (HighEnergyLimit() > fIntrinsicHighEnergyLimit)
    89     {
    90       G4cout << "G4PenelopeAnnihilationModel: high energy limit decreased from " <<
    91         HighEnergyLimit()/GeV << " GeV to " << fIntrinsicHighEnergyLimit/GeV << " GeV" << G4endl;
    92       SetHighEnergyLimit(fIntrinsicHighEnergyLimit);
    93     }
    94 
    95   G4cout << "Penelope Annihilation model is initialized " << G4endl
    96          << "Energy range: "
    97          << LowEnergyLimit() / keV << " keV - "
    98          << HighEnergyLimit() / GeV << " GeV"
    99          << G4endl;
     84  if(verboseLevel > 0) {
     85    G4cout << "Penelope Annihilation model is initialized " << G4endl
     86           << "Energy range: "
     87           << LowEnergyLimit() / keV << " keV - "
     88           << HighEnergyLimit() / GeV << " GeV"
     89           << G4endl;
     90  }
    10091
    10192  if(isInitialised) return;
    102 
    103   if(pParticleChange)
    104     fParticleChange = reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange);
    105   else
    106     fParticleChange = new G4ParticleChangeForGamma();
     93  fParticleChange = GetParticleChangeForGamma();
    10794  isInitialised = true;
    10895}
     
    155142
    156143  G4double kineticEnergy = aDynamicPositron->GetKineticEnergy();
    157  
    158   if (kineticEnergy == 0)
     144
     145  // kill primary
     146  fParticleChange->SetProposedKineticEnergy(0.);
     147  fParticleChange->ProposeTrackStatus(fStopAndKill);
     148 
     149  if (kineticEnergy == 0.0)
    159150    {
    160151      //Old AtRestDoIt
     
    170161      fvect->push_back(firstGamma);
    171162      fvect->push_back(secondGamma);
    172       fParticleChange->SetProposedKineticEnergy(0.);
    173       fParticleChange->ProposeTrackStatus(fStopAndKill);
    174163      return;
    175164    }
     
    227216                                                           photon2Energy);
    228217  fvect->push_back(aParticle2);
    229   fParticleChange->SetProposedKineticEnergy(0.);
    230   fParticleChange->ProposeTrackStatus(fStopAndKill);
    231218
    232219  if (verboseLevel > 1)
     
    244231    }
    245232  if (verboseLevel > 0)
    246     {
    247      
     233    {     
    248234      G4double energyDiff = std::fabs(totalAvailableEnergy-photon1Energy-photon2Energy);
    249235      if (energyDiff > 0.05*keV)
  • trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeBremsstrahlung.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PenelopeBremsstrahlung.cc,v 1.18 2006/06/29 19:40:35 gunter Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4PenelopeBremsstrahlung.cc,v 1.19 2009/05/02 09:59:16 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// --------------------------------------------------------------
     
    7171  cutForPhotons = 0.;
    7272  verboseLevel = 0;
     73
     74   G4cout << G4endl;
     75   G4cout << "*******************************************************************************" << G4endl;
     76   G4cout << "*******************************************************************************" << G4endl;
     77   G4cout << "   The class G4PenelopeBremsstrahlung is NOT SUPPORTED ANYMORE. " << G4endl;
     78   G4cout << "   It will be REMOVED with the next major release of Geant4. " << G4endl;
     79   G4cout << "   Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl;
     80   G4cout << "*******************************************************************************" << G4endl;
     81   G4cout << "*******************************************************************************" << G4endl;
     82   G4cout << G4endl;
     83
    7384}
    7485
  • trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeBremsstrahlungContinuous.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PenelopeBremsstrahlungContinuous.cc,v 1.10 2008/12/09 15:08:13 pandola Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4PenelopeBremsstrahlungContinuous.cc,v 1.11 2008/12/15 09:23:06 pandola Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// --------------------------------------------------------------
     
    9797 G4String dirFile = pathString + "/penelope/" + name;
    9898 std::ifstream file(dirFile);
    99  std::filebuf* lsdp = file.rdbuf();
    100  if (!(lsdp->is_open()))
     99 if (!file.is_open())
    101100     {
    102101      G4String excep = "G4PenelopeBremsstrahlungContinuous - data file " + name + " not found!";
     
    112111     for (size_t j=0;j<NumberofKPoints;j++){
    113112       file >> a1;
    114        ReducedCS[i][j]=a1*cm2; //coversion present in Penelope source
     113       ReducedCS[i][j]=a1*cm2;
    115114     }
    116115     //3) read the total cross section, in cm2
    117116     file >> a1;
    118      TotalCS[i]=a1*cm2; //conversion present in Penelope source
     117     TotalCS[i]=a1*cm2;
    119118     // Check closing item
    120119     file >> a1;
    121120     if (a1 != ((G4double) -1))
    122121       {
    123          G4String excep = "G4PenelopeBremsstrahlungContinuous - Check the bremms data file " + name;
     122         G4String excep = "G4PenelopeBremsstrahlungContinuous - Check the bremms data file "
     123           + name;
    124124         G4Exception(excep);
    125125       }
     
    229229 
    230230  //Global x-section factor
    231   G4double Fact=Zmat*Zmat*(energy+electron_mass_c2)*(energy+electron_mass_c2)/(energy*(energy+2.0*electron_mass_c2));
     231  G4double Fact=Zmat*Zmat*(energy+electron_mass_c2)*(energy+electron_mass_c2)/
     232    (energy*(energy+2.0*electron_mass_c2));
    232233  Fact *= PositronCorrection(energy);
    233234
  • trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeCompton.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PenelopeCompton.cc,v 1.33 2008/06/03 15:44:25 pandola Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4PenelopeCompton.cc,v 1.34 2009/05/02 09:59:16 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// Author: Luciano Pandola
     
    120120             << G4endl;
    121121    }
     122
     123
     124   G4cout << G4endl;
     125   G4cout << "*******************************************************************************" << G4endl;
     126   G4cout << "*******************************************************************************" << G4endl;
     127   G4cout << "   The class G4PenelopeCompton is NOT SUPPORTED ANYMORE. " << G4endl;
     128   G4cout << "   It will be REMOVED with the next major release of Geant4. " << G4endl;
     129   G4cout << "   Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl;
     130   G4cout << "*******************************************************************************" << G4endl;
     131   G4cout << "*******************************************************************************" << G4endl;
     132   G4cout << G4endl;
     133
    122134}
    123135
  • trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeComptonModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PenelopeComptonModel.cc,v 1.2 2008/12/04 14:11:21 pandola Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4PenelopeComptonModel.cc,v 1.4 2009/04/18 18:29:34 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// Author: Luciano Pandola
     
    4040//                            that are read from the external files.
    4141// 24 Nov 2008   L Pandola    Find a cleaner way to delete vectors.
     42// 16 Apr 2009   V Ivanchenko Cleanup initialisation and generation of secondaries:
     43//                  - apply internal high-energy limit only in constructor
     44//                  - do not apply low-energy limit (default is 0)
     45//                  - do not apply production threshold on level of the model
    4246//
    4347
     
    6973  fIntrinsicLowEnergyLimit = 100.0*eV;
    7074  fIntrinsicHighEnergyLimit = 100.0*GeV;
    71   SetLowEnergyLimit(fIntrinsicLowEnergyLimit);
     75  //  SetLowEnergyLimit(fIntrinsicLowEnergyLimit);
    7276  SetHighEnergyLimit(fIntrinsicHighEnergyLimit);
    7377  //
     
    118122
    119123void G4PenelopeComptonModel::Initialise(const G4ParticleDefinition* particle,
    120                                        const G4DataVector& cuts)
     124                                        const G4DataVector& cuts)
    121125{
    122126  if (verboseLevel > 3)
     
    124128
    125129  InitialiseElementSelectors(particle,cuts);
    126   if (LowEnergyLimit() < fIntrinsicLowEnergyLimit)
    127     {
    128       G4cout << "G4PenelopeComptonModel: low energy limit increased from " <<
    129         LowEnergyLimit()/eV << " eV to " << fIntrinsicLowEnergyLimit/eV << " eV" << G4endl;
    130       SetLowEnergyLimit(fIntrinsicLowEnergyLimit);
    131     }
    132   if (HighEnergyLimit() > fIntrinsicHighEnergyLimit)
    133     {
    134       G4cout << "G4PenelopeComptonModel: high energy limit decreased from " <<
    135         HighEnergyLimit()/GeV << " GeV to " << fIntrinsicHighEnergyLimit/GeV << " GeV" << G4endl;
    136       SetHighEnergyLimit(fIntrinsicHighEnergyLimit);
    137     }
    138 
    139   G4cout << "Penelope Compton model is initialized " << G4endl
    140          << "Energy range: "
    141          << LowEnergyLimit() / keV << " keV - "
    142          << HighEnergyLimit() / GeV << " GeV"
    143          << G4endl;
     130
     131  if (verboseLevel > 0) {
     132    G4cout << "Penelope Compton model is initialized " << G4endl
     133           << "Energy range: "
     134           << LowEnergyLimit() / keV << " keV - "
     135           << HighEnergyLimit() / GeV << " GeV"
     136           << G4endl;
     137  }
    144138
    145139  if(isInitialised) return;
    146 
    147   if(pParticleChange)
    148     fParticleChange = reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange);
    149   else
    150     fParticleChange = new G4ParticleChangeForGamma();
     140  fParticleChange = GetParticleChangeForGamma();
    151141  isInitialised = true;
    152142}
     
    249239  G4double photonEnergy0 = aDynamicGamma->GetKineticEnergy();
    250240
    251   if (photonEnergy0 <= LowEnergyLimit())
    252   {
     241  if (photonEnergy0 <= fIntrinsicLowEnergyLimit)
     242    {
    253243      fParticleChange->ProposeTrackStatus(fStopAndKill);
    254244      fParticleChange->SetProposedKineticEnergy(0.);
    255245      fParticleChange->ProposeLocalEnergyDeposit(photonEnergy0);
    256246      return ;
    257   }
     247    }
    258248
    259249  G4ParticleMomentum photonDirection0 = aDynamicGamma->GetMomentumDirection();
     
    263253    G4cout << "Going to select element in " << couple->GetMaterial()->GetName() << G4endl;
    264254  // atom can be selected effitiantly if element selectors are initialised
    265   const G4Element* anElement = SelectRandomAtom(couple,G4Gamma::GammaDefinition(),photonEnergy0);
     255  const G4Element* anElement =
     256    SelectRandomAtom(couple,G4Gamma::GammaDefinition(),photonEnergy0);
    266257  G4int Z = (G4int) anElement->GetZ();
    267258  if (verboseLevel > 2)
     
    320311      }while((epsilon*photonEnergy0-photonEnergy0+ionEnergy) >0);
    321312    }
    322   else //photonEnergy0<5 MeV
     313  else //photonEnergy0 < 5 MeV
    323314    {
    324315      //Incoherent scattering function for theta=PI
     
    472463  }
    473464 
    474 
    475465  //Create scattered electron
    476466  G4double diffEnergy = photonEnergy0*(1-epsilon);
    477467  ionEnergy = (*(ionizationEnergy->find(Z)->second))[iosc];
    478   G4double Q2 = photonEnergy0*photonEnergy0+photonEnergy1*(photonEnergy1-2.0*photonEnergy0*cosTheta);
     468  G4double Q2 =
     469    photonEnergy0*photonEnergy0+photonEnergy1*(photonEnergy1-2.0*photonEnergy0*cosTheta);
    479470  G4double cosThetaE; //scattering angle for the electron
    480471  if (Q2 > 1.0e-12)
     
    496487  G4int shellId = shell->ShellId();
    497488  G4double ionEnergyInPenelopeDatabase = ionEnergy;
    498   ionEnergy = std::max(bindingEnergy,ionEnergyInPenelopeDatabase); //protection against energy non-conservation
    499 
    500   G4double eKineticEnergy = diffEnergy - ionEnergy; //subtract the excitation energy. If not emitted by fluorescence,
     489  //protection against energy non-conservation
     490  ionEnergy = std::max(bindingEnergy,ionEnergyInPenelopeDatabase); 
     491
     492  //subtract the excitation energy. If not emitted by fluorescence
    501493  //the ionization energy is deposited as local energy deposition
     494  G4double eKineticEnergy = diffEnergy - ionEnergy;
    502495  G4double localEnergyDeposit = ionEnergy;
    503496  G4double energyInFluorescence = 0.; //testing purposes only
     
    505498  if (eKineticEnergy < 0)
    506499    {
    507       //It means that there was some problem/mismatch between the two databases. Try to make it work
     500      //It means that there was some problem/mismatch between the two databases.
     501      //Try to make it work
    508502      //In this case available Energy (diffEnergy) < ionEnergy
    509503      //Full residual energy is deposited locally
     
    511505      eKineticEnergy = 0.0;
    512506    }
    513   G4double cutForLowEnergySecondaryPhotons = 250.0*eV;
    514 
    515   //Get the cut for electrons
    516   const G4ProductionCutsTable* theCoupleTable=
    517     G4ProductionCutsTable::GetProductionCutsTable();
    518   size_t indx = couple->GetIndex();
    519   G4double cutE = (*(theCoupleTable->GetEnergyCutsVector(1)))[indx];
    520   cutE = std::max(cutForLowEnergySecondaryPhotons,cutE);
    521507     
    522508  //the local energy deposit is what remains: part of this may be spent for fluorescence.
    523   if (fUseAtomicDeexcitation)
    524     {
    525       G4int nPhotons=0;
    526 
    527       G4double cutg = (*(theCoupleTable->GetEnergyCutsVector(0)))[indx];
    528       cutg = std::max(cutForLowEnergySecondaryPhotons,cutg);
    529 
    530       G4DynamicParticle* aPhoton;
    531       G4AtomicDeexcitation deexcitationManager;
     509  if(DeexcitationFlag() && Z > 5) {
     510
     511    const G4ProductionCutsTable* theCoupleTable=
     512      G4ProductionCutsTable::GetProductionCutsTable();
     513
     514    size_t index = couple->GetIndex();
     515    G4double cutg = (*(theCoupleTable->GetEnergyCutsVector(0)))[index];
     516    G4double cute = (*(theCoupleTable->GetEnergyCutsVector(1)))[index];
     517
     518    // Generation of fluorescence
     519    // Data in EADL are available only for Z > 5
     520    // Protection to avoid generating photons in the unphysical case of
     521    // shell binding energy > photon energy
     522    if (localEnergyDeposit > cutg || localEnergyDeposit > cute)
     523      {
     524        G4DynamicParticle* aPhoton;
     525        G4AtomicDeexcitation deexcitationManager;
     526        deexcitationManager.SetCutForSecondaryPhotons(cutg);
     527        deexcitationManager.SetCutForAugerElectrons(cute);
     528        deexcitationManager.ActivateAugerElectronProduction(false);
    532529     
    533       if (Z>5 && (localEnergyDeposit > cutg || localEnergyDeposit > cutE))
    534         {
    535           photonVector = deexcitationManager.GenerateParticles(Z,shellId);
    536           for (size_t k=0;k<photonVector->size();k++){
    537             aPhoton = (*photonVector)[k];
    538             if (aPhoton)
     530        photonVector = deexcitationManager.GenerateParticles(Z,shellId);
     531        if(photonVector)
     532          {
     533            size_t nPhotons = photonVector->size();
     534            for (size_t k=0; k<nPhotons; k++)
    539535              {
    540                 G4double itsCut = cutg;
    541                 if (aPhoton->GetDefinition() == G4Electron::Electron()) itsCut = cutE;
    542                 G4double itsEnergy = aPhoton->GetKineticEnergy();
    543                 if (itsEnergy > itsCut && itsEnergy <= localEnergyDeposit)
     536                aPhoton = (*photonVector)[k];
     537                if (aPhoton)
    544538                  {
    545                     nPhotons++;
    546                     localEnergyDeposit -= itsEnergy;
    547                     energyInFluorescence += itsEnergy;
    548                   }
    549                 else
    550                   {
    551                     delete aPhoton;
    552                     (*photonVector)[k]=0;
     539                    G4double itsEnergy = aPhoton->GetKineticEnergy();
     540                    if (itsEnergy <= localEnergyDeposit)
     541                      {
     542                        localEnergyDeposit -= itsEnergy;
     543                        if (aPhoton->GetDefinition() == G4Gamma::Gamma())
     544                          energyInFluorescence += itsEnergy;;
     545                        fvect->push_back(aPhoton);                 
     546                      }
     547                    else
     548                      {
     549                        delete aPhoton;
     550                        (*photonVector)[k]=0;
     551                      }
    553552                  }
    554553              }
    555           }
    556         }
    557     }
     554            delete photonVector;
     555          }
     556      }
     557  }
    558558
    559559  //Produce explicitely the electron only if its proposed kinetic energy is
    560560  //above the cut, otherwise add local energy deposition
    561561  G4DynamicParticle* electron = 0;
    562   if (eKineticEnergy > cutE)
     562  //  if (eKineticEnergy > cutE) // VI: may be consistency problem if cut is applied here
     563  if (eKineticEnergy > 0.0)
    563564    {
    564565      G4double xEl = sinThetaE * std::cos(phi+pi);
     
    576577    }
    577578
    578   //This block below is executed only if there is at least one secondary photon produced by
    579   //AtomicDeexcitation
    580   if (photonVector)
    581     {
    582       for (size_t ll=0;ll<photonVector->size();ll++)
    583         {
    584           if ((*photonVector)[ll])
    585             {
    586               G4DynamicParticle* aFluorescencePhoton = (*photonVector)[ll];
    587               fvect->push_back(aFluorescencePhoton);
    588             }
    589         }
    590     }
    591   delete photonVector;
    592579  if (localEnergyDeposit < 0)
    593580    {
  • trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeGammaConversion.cc

    r819 r1055  
    9797              << G4endl;
    9898     }
     99
     100   G4cout << G4endl;
     101   G4cout << "*******************************************************************************" << G4endl;
     102   G4cout << "*******************************************************************************" << G4endl;
     103   G4cout << "   The class G4PenelopeGammaConversion is NOT SUPPORTED ANYMORE. " << G4endl;
     104   G4cout << "   It will be REMOVED with the next major release of Geant4. " << G4endl;
     105   G4cout << "   Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl;
     106   G4cout << "*******************************************************************************" << G4endl;
     107   G4cout << "*******************************************************************************" << G4endl;
     108   G4cout << G4endl;
    99109}
    100110 
  • trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeGammaConversionModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PenelopeGammaConversionModel.cc,v 1.2 2008/12/04 14:09:36 pandola Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4PenelopeGammaConversionModel.cc,v 1.4 2009/05/19 14:57:01 pandola Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// Author: Luciano Pandola
     
    3232// --------
    3333// 06 Oct 2008   L Pandola    Migration from process to model
     34// 17 Apr 2009   V Ivanchenko Cleanup initialisation and generation of secondaries:
     35//                  - apply internal high-energy limit only in constructor
     36//                  - do not apply low-energy limit (default is 0)
     37//                  - do not apply production threshold on level of the model
     38// 19 May 2009   L Pandola    Explicitely set to zero pointers deleted in
     39//                            Initialise(), since they might be checked later on
    3440//
    3541
     
    5662  fSmallEnergy = 1.1*MeV;
    5763
    58   SetLowEnergyLimit(fIntrinsicLowEnergyLimit);
     64  //  SetLowEnergyLimit(fIntrinsicLowEnergyLimit);
    5965  SetHighEnergyLimit(fIntrinsicHighEnergyLimit);
    6066  //
     
    8995      crossSectionHandler->Clear();
    9096      delete crossSectionHandler;
     97      crossSectionHandler = 0;
    9198    }
    9299 
    93   //Check energy limits
    94   if (LowEnergyLimit() < fIntrinsicLowEnergyLimit)
    95     {
    96       G4cout << "G4PenelopeGammaConversionModel: low energy limit increased from " <<
    97         LowEnergyLimit()/eV << " eV to " << fIntrinsicLowEnergyLimit/eV << " eV" << G4endl;
    98       SetLowEnergyLimit(fIntrinsicLowEnergyLimit);
    99     }
    100   if (HighEnergyLimit() > fIntrinsicHighEnergyLimit)
    101     {
    102       G4cout << "G4PenelopeGammaConversionModel: high energy limit decreased from " <<
    103         HighEnergyLimit()/GeV << " GeV to " << fIntrinsicHighEnergyLimit/GeV << " GeV" << G4endl;
    104       SetHighEnergyLimit(fIntrinsicHighEnergyLimit);
    105     }
    106 
    107100  //Re-initialize cross section handler
    108101  crossSectionHandler = new G4CrossSectionHandler();
    109   crossSectionHandler->Initialise(0,LowEnergyLimit(),HighEnergyLimit(),400);
     102  crossSectionHandler->Initialise(0,fIntrinsicLowEnergyLimit,HighEnergyLimit(),400);
    110103  crossSectionHandler->Clear();
    111104  G4String crossSectionFile = "penelope/pp-cs-pen-";
     
    117110    G4cout << "Loaded cross section files for PenelopeGammaConversion" << G4endl;
    118111
    119   G4cout << "Penelope Gamma Conversion model is initialized " << G4endl
    120          << "Energy range: "
    121          << LowEnergyLimit() / MeV << " MeV - "
    122          << HighEnergyLimit() / GeV << " GeV"
    123          << G4endl;
     112  if (verboseLevel > 0) {
     113    G4cout << "Penelope Gamma Conversion model is initialized " << G4endl
     114           << "Energy range: "
     115           << LowEnergyLimit() / MeV << " MeV - "
     116           << HighEnergyLimit() / GeV << " GeV"
     117           << G4endl;
     118  }
    124119
    125120  if(isInitialised) return;
    126 
    127   if(pParticleChange)
    128     fParticleChange = reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange);
    129   else
    130     fParticleChange = new G4ParticleChangeForGamma();
     121  fParticleChange = GetParticleChangeForGamma();
    131122  isInitialised = true;
    132123}
     
    151142
    152143  G4int iZ = (G4int) Z;
    153   if (!crossSectionHandler)
    154     {
    155       G4cout << "G4PenelopeGammaConversionModel::ComputeCrossSectionPerAtom" << G4endl;
    156       G4cout << "The cross section handler is not correctly initialized" << G4endl;
    157       G4Exception();
    158     }
     144  //  if (!crossSectionHandler) //VI: should not be checked in run time
     145  //  {
     146  //    G4cout << "G4PenelopeGammaConversionModel::ComputeCrossSectionPerAtom" << G4endl;
     147  //    G4cout << "The cross section handler is not correctly initialized" << G4endl;
     148  //    G4Exception();
     149  //  }
    159150  G4double cs = crossSectionHandler->FindValue(iZ,energy);
    160151
     
    167158//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    168159
    169 void G4PenelopeGammaConversionModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fvect,
    170                                               const G4MaterialCutsCouple* couple,
    171                                               const G4DynamicParticle* aDynamicGamma,
    172                                               G4double,
    173                                               G4double)
     160void
     161G4PenelopeGammaConversionModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fvect,
     162                                                  const G4MaterialCutsCouple* couple,
     163                                                  const G4DynamicParticle* aDynamicGamma,
     164                                                  G4double,
     165                                                  G4double)
    174166{
    175167  //
     
    191183  G4double photonEnergy = aDynamicGamma->GetKineticEnergy();
    192184
    193   if (photonEnergy <= LowEnergyLimit())
    194   {
    195       fParticleChange->ProposeTrackStatus(fStopAndKill);
    196       fParticleChange->SetProposedKineticEnergy(0.);
     185  // Always kill primary
     186  fParticleChange->ProposeTrackStatus(fStopAndKill);
     187  fParticleChange->SetProposedKineticEnergy(0.);
     188
     189  if (photonEnergy <= fIntrinsicLowEnergyLimit)
     190    {
    197191      fParticleChange->ProposeLocalEnergyDeposit(photonEnergy);
    198192      return ;
    199   }
     193    }
    200194
    201195  G4ParticleMomentum photonDirection = aDynamicGamma->GetMomentumDirection();
     
    310304
    311305  //Generate explicitely the electron in the pair, only if it is > threshold
    312   const G4ProductionCutsTable* theCoupleTable=
    313     G4ProductionCutsTable::GetProductionCutsTable();
    314   size_t indx = couple->GetIndex();
    315   G4double cutE = (*(theCoupleTable->GetEnergyCutsVector(1)))[indx];
    316   //G4double cutP = (*(theCoupleTable->GetEnergyCutsVector(2)))[indx];
    317 
    318   if (electronKineEnergy > cutE)
     306  //VI: applying cut here provides inconsistency
     307
     308  if (electronKineEnergy > 0.0)
    319309    {
    320310      G4ThreeVector electronDirection ( dirX_el, dirY_el, dirZ_el);
     
    333323  //Generate the positron. Real particle in any case, because it will annihilate. If below
    334324  //threshold, produce it at rest
    335   if (positronKineEnergy < cutE)
     325  // VI: here there was a bug - positron and electron cuts are different
     326  if (positronKineEnergy < 0.0)
    336327    {
    337328      localEnergyDeposit += positronKineEnergy;
     
    344335  fvect->push_back(positron);
    345336
    346   //Update the status of the primary gamma (kill it)
    347   fParticleChange->SetProposedKineticEnergy(0.);
     337  //Add rest of energy to the local energy deposit
    348338  fParticleChange->ProposeLocalEnergyDeposit(localEnergyDeposit);
    349   fParticleChange->ProposeTrackStatus(fStopAndKill);
    350 
    351339 
    352  if (verboseLevel > 1)
     340  if (verboseLevel > 1)
    353341    {
    354342      G4cout << "-----------------------------------------------------------" << G4endl;
     
    357345      G4cout << "-----------------------------------------------------------" << G4endl;
    358346      if (electronKineEnergy)
    359         G4cout << "Electron (explicitely produced) " << electronKineEnergy/keV << " keV" << G4endl;
     347        G4cout << "Electron (explicitely produced) " << electronKineEnergy/keV << " keV"
     348               << G4endl;
    360349      if (positronKineEnergy)
    361350        G4cout << "Positron (not at rest) " << positronKineEnergy/keV << " keV" << G4endl;
     
    373362                                      localEnergyDeposit+2.0*electron_mass_c2-photonEnergy);
    374363      if (energyDiff > 0.05*keV)
    375         G4cout << "Warning from G4PenelopeGammaConversion: problem with energy conservation: " <<
    376           (electronKineEnergy+positronKineEnergy+
    377            localEnergyDeposit+2.0*electron_mass_c2)/keV << " keV (final) vs. " <<
    378           photonEnergy/keV << " keV (initial)" << G4endl;
    379     }
    380  
     364        G4cout << "Warning from G4PenelopeGammaConversion: problem with energy conservation: "
     365               << (electronKineEnergy+positronKineEnergy+
     366                   localEnergyDeposit+2.0*electron_mass_c2)/keV
     367               << " keV (final) vs. " << photonEnergy/keV << " keV (initial)" << G4endl;
     368    }
    381369}
    382370
  • trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeIonisation.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PenelopeIonisation.cc,v 1.19 2006/06/29 19:40:49 gunter Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4PenelopeIonisation.cc,v 1.20 2009/05/02 09:59:16 sincerti Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// --------------------------------------------------------------
     
    9393  ReadData(); //Read data from file
    9494 
     95   G4cout << G4endl;
     96   G4cout << "*******************************************************************************" << G4endl;
     97   G4cout << "*******************************************************************************" << G4endl;
     98   G4cout << "   The class G4PenelopeIonisation is NOT SUPPORTED ANYMORE. " << G4endl;
     99   G4cout << "   It will be REMOVED with the next major release of Geant4. " << G4endl;
     100   G4cout << "   Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl;
     101   G4cout << "*******************************************************************************" << G4endl;
     102   G4cout << "*******************************************************************************" << G4endl;
     103   G4cout << G4endl;
     104
    95105}
    96106
  • trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeIonisationModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PenelopeIonisationModel.cc,v 1.2 2008/12/05 09:15:43 pandola Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4PenelopeIonisationModel.cc,v 1.5 2009/05/19 14:57:01 pandola Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// Author: Luciano Pandola
     
    3232// --------
    3333// 26 Nov 2008   L Pandola    Migration from process to model
     34// 17 Apr 2009   V Ivanchenko Cleanup initialisation and generation of secondaries:
     35//                  - apply internal high-energy limit only in constructor
     36//                  - do not apply low-energy limit (default is 0)
     37//                  - added MinEnergyCut method
     38//                  - do not change track status
     39// 19 May 2009   L Pandola    Explicitely set to zero pointers deleted in
     40//                            Initialise(), since they might be checked later on
    3441//
    3542
     
    4855#include "G4CrossSectionHandler.hh"
    4956#include "G4AtomicDeexcitation.hh"
    50 #include "G4ProcessManager.hh"
    5157#include "G4VEMDataSet.hh"
    5258
     
    6874  fIntrinsicLowEnergyLimit = 100.0*eV;
    6975  fIntrinsicHighEnergyLimit = 100.0*GeV;
    70   SetLowEnergyLimit(fIntrinsicLowEnergyLimit);
     76  //  SetLowEnergyLimit(fIntrinsicLowEnergyLimit);
    7177  SetHighEnergyLimit(fIntrinsicHighEnergyLimit);
    7278  //
     
    136142    G4cout << "Calling G4PenelopeIonisationModel::Initialise()" << G4endl;
    137143
    138   InitialiseElementSelectors(particle,cuts);
    139 
    140144  //Delete and re-initialize the cross section handler
    141145  if (crossSectionHandler)
     
    143147      crossSectionHandler->Clear();
    144148      delete crossSectionHandler;
     149      crossSectionHandler = 0;
    145150    }
    146151
     
    148153    {
    149154      for (size_t i=0; i<theXSTable->size(); i++)
    150         delete (*theXSTable)[i];
     155        {
     156          delete (*theXSTable)[i];
     157          (*theXSTable)[i] = 0;
     158        }
    151159      delete theXSTable;
     160      theXSTable = 0;
    152161     }
    153 
    154 
    155   if (LowEnergyLimit() < fIntrinsicLowEnergyLimit)
    156     {
    157       G4cout << "G4PenelopeIonisationModel: low energy limit increased from " <<
    158         LowEnergyLimit()/eV << " eV to " << fIntrinsicLowEnergyLimit/eV << " eV" << G4endl;
    159       SetLowEnergyLimit(fIntrinsicLowEnergyLimit);
    160     }
    161   if (HighEnergyLimit() > fIntrinsicHighEnergyLimit)
    162     {
    163       G4cout << "G4PenelopeIonisationModel: high energy limit decreased from " <<
    164         HighEnergyLimit()/GeV << " GeV to " << fIntrinsicHighEnergyLimit/GeV << " GeV" << G4endl;
    165       SetHighEnergyLimit(fIntrinsicHighEnergyLimit);
    166     }
    167162
    168163  crossSectionHandler = new G4CrossSectionHandler();
     
    177172  //This is used to retrieve cross section values later on
    178173  crossSectionHandler->BuildMeanFreePathForMaterials();
    179  
    180  if (verboseLevel > 2)
     174
     175  InitialiseElementSelectors(particle,cuts);
     176 
     177  if (verboseLevel > 2)
    181178    G4cout << "Loaded cross section files for PenelopeIonisationModel" << G4endl;
    182179
    183 
    184   G4cout << "Penelope Ionisation model is initialized " << G4endl
    185          << "Energy range: "
    186          << LowEnergyLimit() / keV << " keV - "
    187          << HighEnergyLimit() / GeV << " GeV"
    188          << G4endl;
     180  if (verboseLevel > 2) {
     181    G4cout << "Penelope Ionisation model is initialized " << G4endl
     182           << "Energy range: "
     183           << LowEnergyLimit() / keV << " keV - "
     184           << HighEnergyLimit() / GeV << " GeV"
     185           << G4endl;
     186  }
    189187
    190188  if(isInitialised) return;
    191 
    192   if(pParticleChange)
    193     fParticleChange = reinterpret_cast<G4ParticleChangeForLoss*>(pParticleChange);
    194   else
    195     fParticleChange = new G4ParticleChangeForLoss();
     189  fParticleChange = GetParticleChangeForLoss();
    196190  isInitialised = true;
    197191}
     
    227221  SetupForMaterial(theParticle, material, energy);
    228222
     223  // VI - should be check at initialisation not in run time
     224  /*
    229225  if (!crossSectionHandler)
    230226    {
     
    233229      G4Exception();
    234230    }
    235  
     231  */ 
    236232  if (!theXSTable)
    237233    {
     
    244240      theXSTable = BuildCrossSectionTable(theParticle);
    245241    }
    246 
     242 
    247243  G4double totalCross = 0.0;
    248244  G4double cross = 0.0;
     
    356352                                              const G4MaterialCutsCouple* couple,
    357353                                              const G4DynamicParticle* aDynamicParticle,
    358                                               G4double,
    359                                               G4double)
     354                                              G4double cutE, G4double)
    360355{
    361356  // Penelope model to sample the final state following an hard inelastic interaction.
     
    397392  const G4ParticleDefinition* theParticle = aDynamicParticle->GetDefinition();
    398393
    399   if (kineticEnergy0 <= LowEnergyLimit())
     394  if (kineticEnergy0 <= fIntrinsicLowEnergyLimit)
    400395  {
    401396    fParticleChange->SetProposedKineticEnergy(0.);
    402397    fParticleChange->ProposeLocalEnergyDeposit(kineticEnergy0);
    403     //Check if there are AtRest processes
    404     if (theParticle->GetProcessManager()->GetAtRestProcessVector()->size())
    405       //In this case there is at least one AtRest process
    406       fParticleChange->ProposeTrackStatus(fStopButAlive);
    407     else
    408       fParticleChange->ProposeTrackStatus(fStopAndKill);
    409398    return ;
    410399  }
     
    430419  G4int iZ = SampleRandomAtom(couple,kineticEnergy0);
    431420 
    432   G4double cutForLowEnergySecondaryParticles = 250.0*eV;
    433421  const G4ProductionCutsTable* theCoupleTable=
    434422    G4ProductionCutsTable::GetProductionCutsTable();
    435423  size_t indx = couple->GetIndex();
    436   G4double cutE = (*(theCoupleTable->GetEnergyCutsVector(1)))[indx];
    437424  G4double cutG = (*(theCoupleTable->GetEnergyCutsVector(0)))[indx];
    438 
    439   //Production cut for delta-rays (electrons)
    440   cutE = std::max(cutForLowEnergySecondaryParticles,cutE);
    441   //Production cut for gamma (fluorescence)
    442   cutG = std::max(cutForLowEnergySecondaryParticles,cutG);
    443425 
    444426  if (verboseLevel > 2)
     
    474456  else
    475457    {
    476       fParticleChange->ProposeMomentumDirection(electronDirection1);
    477       fParticleChange->SetProposedKineticEnergy(0.*eV);
    478       if (theParticle->GetProcessManager()->GetAtRestProcessVector()->size())
    479         //In this case there is at least one AtRest process
    480         fParticleChange->ProposeTrackStatus(fStopButAlive);
    481       else
    482         fParticleChange->ProposeTrackStatus(fStopAndKill);
     458      fParticleChange->SetProposedKineticEnergy(0.);
    483459    }
    484460 
     
    517493    //Penelope subtracted the fluorescence, but one has to match the databases
    518494    eKineticEnergy = energySecondary+ioniEnergy-bindingEnergy;
    519    
    520   //VERIFICA QUI LA STORIA DEL LOCAL ENERGY DEPOSIT!
    521 
     495 
    522496  G4double localEnergyDeposit = ionEnergy;
    523497  G4double energyInFluorescence = 0.0*eV;
    524498
    525    std::vector<G4DynamicParticle*> *photonVector = 0;
    526   if (fUseAtomicDeexcitation)
    527     {
    528       if (iZ>5 && (ionEnergy > cutG || ionEnergy > cutE))
     499  if(DeexcitationFlag() && iZ > 5)
     500    {
     501      if (ionEnergy > cutG || ionEnergy > cutE)
    529502        {
    530           photonVector = deexcitationManager.GenerateParticles(iZ,shellId);
    531           //Check for single photons if they are above threshold
    532           for (size_t k=0;k<photonVector->size();k++)
     503          deexcitationManager.SetCutForSecondaryPhotons(cutG);
     504          deexcitationManager.SetCutForAugerElectrons(cutE);
     505          std::vector<G4DynamicParticle*> *photonVector =
     506            deexcitationManager.GenerateParticles(iZ,shellId);
     507          //Check for secondaries
     508          if(photonVector)
    533509            {
    534               G4DynamicParticle* aPhoton = (*photonVector)[k];
    535               if (aPhoton)
     510              for (size_t k=0;k<photonVector->size();k++)
    536511                {
    537                   G4double itsCut = cutG;
    538                   if (aPhoton->GetDefinition() == G4Electron::Electron()) itsCut = cutE;
    539                   G4double itsEnergy = aPhoton->GetKineticEnergy();
    540                   if (itsEnergy > itsCut && itsEnergy <= ionEnergy)
     512                  G4DynamicParticle* aPhoton = (*photonVector)[k];
     513                  if (aPhoton)
    541514                    {
    542                       localEnergyDeposit -= itsEnergy;
    543                       energyInFluorescence += itsEnergy;
    544                     }
    545                   else
    546                     {
    547                       delete aPhoton;
    548                       (*photonVector)[k] = 0;
     515                      G4double itsEnergy = aPhoton->GetKineticEnergy();
     516                      if (itsEnergy <= localEnergyDeposit)
     517                        {
     518                          if(aPhoton->GetDefinition() == G4Gamma::Gamma())
     519                            energyInFluorescence += itsEnergy;
     520                          localEnergyDeposit -= itsEnergy;
     521                          fvect->push_back(aPhoton);
     522                        }
     523                      else
     524                        {
     525                          delete aPhoton;
     526                          (*photonVector)[k] = 0;
     527                        }
    549528                    }
    550529                }
     530              delete photonVector;
    551531            }
    552532        }
     
    567547  fvect->push_back(deltaElectron);
    568548 
    569   //Generate fluorescence, if it is the case
    570   //This block is executed only if there is at least one secondary photon produced by
    571   //G4AtomicDeexcitation
    572   if (photonVector)
    573     {
    574       for (size_t ll=0;ll<photonVector->size();ll++)
    575         if ((*photonVector)[ll])
    576           {
    577             G4DynamicParticle* aFluorescencePhoton = (*photonVector)[ll];
    578             fvect->push_back(aFluorescencePhoton);
    579           }
    580     }
    581   delete photonVector;
    582 
    583549  if (localEnergyDeposit < 0)
    584550    {
     
    753719//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    754720
    755 void G4PenelopeIonisationModel::CalculateDiscreteForElectrons(G4double kinEnergy,G4double cutoffEnergy,
    756                                                               G4int Z,G4double electronVolumeDensity)
     721void
     722G4PenelopeIonisationModel::CalculateDiscreteForElectrons(G4double kinEnergy,
     723                                                         G4double cutoffEnergy,
     724                                                         G4int Z,
     725                                                         G4double electronVolumeDensity)
    757726{
    758727  if (verboseLevel > 2)
     
    1030999//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    10311000
    1032  void G4PenelopeIonisationModel::CalculateDiscreteForPositrons(G4double kinEnergy,G4double cutoffEnergy,
    1033                                                                G4int Z,G4double electronVolumeDensity)
     1001 void
     1002G4PenelopeIonisationModel::CalculateDiscreteForPositrons(G4double kinEnergy,
     1003                                                         G4double cutoffEnergy,
     1004                                                         G4int Z,
     1005                                                         G4double electronVolumeDensity)
    10341006{
    10351007  kineticEnergy1=kinEnergy;
     
    12871259//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    12881260
    1289 G4double G4PenelopeIonisationModel::CalculateCrossSectionsRatio(G4double kinEnergy,
    1290                                                                 G4double cutoffEnergy,
    1291                                                                 G4int Z, G4double electronVolumeDensity,
    1292                                                                 const G4ParticleDefinition* theParticle)
     1261G4double
     1262G4PenelopeIonisationModel::CalculateCrossSectionsRatio(G4double kinEnergy,
     1263                                                       G4double cutoffEnergy,
     1264                                                       G4int Z, G4double electronVolumeDensity,
     1265                                                       const G4ParticleDefinition* theParticle)
    12931266{
    12941267  //Constants
     
    13201293//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    13211294
    1322 std::pair<G4double,G4double> G4PenelopeIonisationModel::CrossSectionsRatioForElectrons(G4double kineticEnergy,
    1323                                                                                        G4double resEnergy,
    1324                                                                                        G4double densityCorrection,
    1325                                                                                        G4double cutoffEnergy)
     1295std::pair<G4double,G4double>
     1296G4PenelopeIonisationModel::CrossSectionsRatioForElectrons(G4double kineticEnergy,
     1297                                                          G4double resEnergy,
     1298                                                          G4double densityCorrection,
     1299                                                          G4double cutoffEnergy)
    13261300{
    13271301  std::pair<G4double,G4double> theResult(0.,0.);
     
    14101384//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    14111385
    1412 std::pair<G4double,G4double> G4PenelopeIonisationModel::CrossSectionsRatioForPositrons(G4double kineticEnergy,
    1413                                                                                        G4double resEnergy,
    1414                                                                                        G4double densityCorrection,
    1415                                                                                        G4double cutoffEnergy)
     1386std::pair<G4double,G4double>
     1387G4PenelopeIonisationModel::CrossSectionsRatioForPositrons(G4double kineticEnergy,
     1388                                                          G4double resEnergy,
     1389                                                          G4double densityCorrection,
     1390                                                          G4double cutoffEnergy)
    14161391{
    14171392
     
    16401615#include "G4EMDataSet.hh"
    16411616
    1642 std::vector<G4VEMDataSet*>* G4PenelopeIonisationModel::BuildCrossSectionTable(const
    1643                                                                               G4ParticleDefinition* theParticle)
     1617std::vector<G4VEMDataSet*>*
     1618G4PenelopeIonisationModel::BuildCrossSectionTable(const G4ParticleDefinition* theParticle)
    16441619{
    16451620  std::vector<G4VEMDataSet*>* set = new std::vector<G4VEMDataSet*>;
  • trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopePhotoElectric.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4PenelopePhotoElectric.cc,v 1.12 2006/06/29 19:40:51 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4PenelopePhotoElectric.cc,v 1.14 2009/05/02 09:59:17 sincerti Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Author: L. Pandola
     
    3737// 31 May 2005  L. Pandola  Added Sauter formula for the sampling of
    3838//                          the electron direction
     39// 08 Jan 2009  L. Pandola  Check shell index to avoid mismatch between
     40//                          the Penelope cross section database and the
     41//                          G4AtomicTransitionManager database. It suppresses
     42//                          a warning from G4AtomicTransitionManager only.
     43//                          Results are unchanged.
    3944// --------------------------------------------------------------
    4045
     
    8994             << G4endl;
    9095    }
     96
     97   G4cout << G4endl;
     98   G4cout << "*******************************************************************************" << G4endl;
     99   G4cout << "*******************************************************************************" << G4endl;
     100   G4cout << "   The class G4PenelopePhotoElectric is NOT SUPPORTED ANYMORE. " << G4endl;
     101   G4cout << "   It will be REMOVED with the next major release of Geant4. " << G4endl;
     102   G4cout << "   Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl;
     103   G4cout << "*******************************************************************************" << G4endl;
     104   G4cout << "*******************************************************************************" << G4endl;
     105   G4cout << G4endl;
     106
    91107}
    92108
     
    146162  // Retrieve the corresponding identifier and binding energy of the selected shell
    147163  const G4AtomicTransitionManager* transitionManager = G4AtomicTransitionManager::Instance();
     164
     165  //The number of shell cross section possibly reported in the Penelope database
     166  //might be different from the number of shells in the G4AtomicTransitionManager
     167  //(namely, Penelope may contain more shell, especially for very light elements).
     168  //In order to avoid a warning message from the G4AtomicTransitionManager, I
     169  //add this protection. Results are anyway changed, because when G4AtomicTransitionManager
     170  //has a shellID>maxID, it sets the shellID to the last valid shell.
     171  size_t numberOfShells = (size_t) transitionManager->NumberOfShells(Z);
     172  if (shellIndex >= numberOfShells)
     173    shellIndex = numberOfShells-1;
     174
    148175  const G4AtomicShell* shell = transitionManager->Shell(Z,shellIndex);
    149176  G4double bindingEnergy = shell->BindingEnergy();
  • trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopePhotoElectricModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PenelopePhotoElectricModel.cc,v 1.2 2008/12/04 14:09:36 pandola Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4PenelopePhotoElectricModel.cc,v 1.6 2009/05/19 14:57:01 pandola Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// Author: Luciano Pandola
     
    3131// History:
    3232// --------
    33 // 08 Oct 2008   L Pandola    Migration from process to model
     33// 08 Oct 2008   L Pandola  Migration from process to model
     34// 08 Jan 2009   L Pandola  Check shell index to avoid mismatch between
     35//                          the Penelope cross section database and the
     36//                          G4AtomicTransitionManager database. It suppresses
     37//                          a warning from G4AtomicTransitionManager only.
     38//                          Results are unchanged.
     39// 25 Mar 2009   L Pandola  Small fix to avoid wrong energy-violation warnings
     40// 17 Apr 2009   V Ivanchenko Cleanup initialisation and generation of secondaries:
     41//                  - apply internal high-energy limit only in constructor
     42//                  - do not apply low-energy limit (default is 0)
     43//                  - do not apply production threshold on secondaries
     44// 19 May 2009   L Pandola    Explicitely set to zero pointers deleted in
     45//                            Initialise(), since they might be checked later on
    3446//
    3547
     
    5870  fIntrinsicLowEnergyLimit = 100.0*eV;
    5971  fIntrinsicHighEnergyLimit = 100.0*GeV;
    60   SetLowEnergyLimit(fIntrinsicLowEnergyLimit);
     72  //  SetLowEnergyLimit(fIntrinsicLowEnergyLimit);
    6173  SetHighEnergyLimit(fIntrinsicHighEnergyLimit);
    6274  //
     
    90102      crossSectionHandler->Clear();
    91103      delete crossSectionHandler;
     104      crossSectionHandler = 0;
    92105    }
    93106  if (shellCrossSectionHandler)
     
    95108      shellCrossSectionHandler->Clear();
    96109      delete shellCrossSectionHandler;
    97     }
    98 
    99   //Check energy limits
    100   if (LowEnergyLimit() < fIntrinsicLowEnergyLimit)
    101     {
    102       G4cout << "G4PenelopePhotoElectricModel: low energy limit increased from " <<
    103         LowEnergyLimit()/eV << " eV to " << fIntrinsicLowEnergyLimit/eV << " eV" <<
    104         G4endl;
    105       SetLowEnergyLimit(fIntrinsicLowEnergyLimit);
    106     }
    107   if (HighEnergyLimit() > fIntrinsicHighEnergyLimit)
    108     {
    109       G4cout << "G4PenelopePhotoElectricModel: high energy limit decreased from " <<
    110         HighEnergyLimit()/GeV << " GeV to " << fIntrinsicHighEnergyLimit/GeV << " GeV"
    111              << G4endl;
    112       SetHighEnergyLimit(fIntrinsicHighEnergyLimit);
    113     }
    114 
     110      shellCrossSectionHandler =0;
     111    }
    115112
    116113  //Re-initialize cross section handlers
     
    129126    G4cout << "Loaded cross section files for PenelopePhotoElectric" << G4endl;
    130127
    131   G4cout << "Penelope Photo-Electric model is initialized " << G4endl
    132          << "Energy range: "
    133          << LowEnergyLimit() / MeV << " MeV - "
    134          << HighEnergyLimit() / GeV << " GeV"
    135          << G4endl;
     128  if (verboseLevel > 0) {
     129    G4cout << "Penelope Photo-Electric model is initialized " << G4endl
     130           << "Energy range: "
     131           << LowEnergyLimit() / MeV << " MeV - "
     132           << HighEnergyLimit() / GeV << " GeV"
     133           << G4endl;
     134  }
    136135
    137136  if(isInitialised) return;
    138 
    139   if(pParticleChange)
    140     fParticleChange = reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange);
    141   else
    142     fParticleChange = new G4ParticleChangeForGamma();
     137  fParticleChange = GetParticleChangeForGamma();
    143138  isInitialised = true;
    144139}
     
    162157
    163158  G4int iZ = (G4int) Z;
    164   if (!crossSectionHandler)
    165     {
    166       G4cout << "G4PenelopePhotoElectricModel::ComputeCrossSectionPerAtom" << G4endl;
    167       G4cout << "The cross section handler is not correctly initialized" << G4endl;
    168       G4Exception();
    169     }
     159  //  if (!crossSectionHandler) // VI: should not be
     160  //  {
     161  //    G4cout << "G4PenelopePhotoElectricModel::ComputeCrossSectionPerAtom" << G4endl;
     162  //    G4cout << "The cross section handler is not correctly initialized" << G4endl;
     163  //    G4Exception();
     164  //  }
    170165  G4double cs = crossSectionHandler->FindValue(iZ,energy);
    171166 
     
    203198  G4double photonEnergy = aDynamicGamma->GetKineticEnergy();
    204199
    205   if (photonEnergy <= LowEnergyLimit())
    206   {
    207       fParticleChange->ProposeTrackStatus(fStopAndKill);
    208       fParticleChange->SetProposedKineticEnergy(0.);
     200  // always kill primary
     201  fParticleChange->ProposeTrackStatus(fStopAndKill);
     202  fParticleChange->SetProposedKineticEnergy(0.);
     203
     204  if (photonEnergy <= fIntrinsicLowEnergyLimit)
     205    {
    209206      fParticleChange->ProposeLocalEnergyDeposit(photonEnergy);
    210207      return ;
    211   }
     208    }
    212209
    213210  G4ParticleMomentum photonDirection = aDynamicGamma->GetMomentumDirection();
     
    217214    G4cout << "Going to select element in " << couple->GetMaterial()->GetName() << G4endl;
    218215  //use crossSectionHandler instead of G4EmElementSelector because in this case
    219   //the dimension of the table is equal to the dimension of the database (less interpolation errors)
     216  //the dimension of the table is equal to the dimension of the database
     217  //(less interpolation errors)
    220218  G4int Z = crossSectionHandler->SelectRandomAtom(couple,photonEnergy);
    221219  if (verboseLevel > 2)
     
    227225  // Retrieve the corresponding identifier and binding energy of the selected shell
    228226  const G4AtomicTransitionManager* transitionManager = G4AtomicTransitionManager::Instance();
     227
     228  //The number of shell cross section possibly reported in the Penelope database
     229  //might be different from the number of shells in the G4AtomicTransitionManager
     230  //(namely, Penelope may contain more shell, especially for very light elements).
     231  //In order to avoid a warning message from the G4AtomicTransitionManager, I
     232  //add this protection. Results are anyway changed, because when G4AtomicTransitionManager
     233  //has a shellID>maxID, it sets the shellID to the last valid shell.
     234  size_t numberOfShells = (size_t) transitionManager->NumberOfShells(Z);
     235  if (shellIndex >= numberOfShells)
     236    shellIndex = numberOfShells-1;
     237
    229238  const G4AtomicShell* shell = transitionManager->Shell(Z,shellIndex);
    230239  G4double bindingEnergy = shell->BindingEnergy();
     
    236245  G4double eKineticEnergy = photonEnergy - bindingEnergy;
    237246 
    238   G4double cutForLowEnergySecondaryParticles = 250.0*eV;
    239   const G4ProductionCutsTable* theCoupleTable=
    240     G4ProductionCutsTable::GetProductionCutsTable();
    241   size_t indx = couple->GetIndex();
    242   G4double cutE = (*(theCoupleTable->GetEnergyCutsVector(1)))[indx];
    243   cutE = std::max(cutForLowEnergySecondaryParticles,cutE);
    244 
    245247  // There may be cases where the binding energy of the selected shell is > photon energy
    246248  // In such cases do not generate secondaries
     
    248250    {
    249251      //Now check if the electron is above cuts: if so, it is created explicitely
    250       if (eKineticEnergy > cutE)
    251         {
    252           // The electron is created
    253           // Direction sampled from the Sauter distribution
    254           G4double cosTheta = SampleElectronDirection(eKineticEnergy);
    255           G4double sinTheta = std::sqrt(1-cosTheta*cosTheta);
    256           G4double phi = twopi * G4UniformRand() ;
    257           G4double dirx = sinTheta * std::cos(phi);
    258           G4double diry = sinTheta * std::sin(phi);
    259           G4double dirz = cosTheta ;
    260           G4ThreeVector electronDirection(dirx,diry,dirz); //electron direction
    261           electronDirection.rotateUz(photonDirection);
    262           G4DynamicParticle* electron = new G4DynamicParticle (G4Electron::Electron(),
    263                                                                electronDirection,
    264                                                                eKineticEnergy);
    265           fvect->push_back(electron);
    266         }
    267       else
    268         localEnergyDeposit += eKineticEnergy;   
    269     }
     252      //VI: checking cut here provides inconsistency in testing
     253      //      if (eKineticEnergy > cutE)
     254      // The electron is created
     255      // Direction sampled from the Sauter distribution
     256      G4double cosTheta = SampleElectronDirection(eKineticEnergy);
     257      G4double sinTheta = std::sqrt(1-cosTheta*cosTheta);
     258      G4double phi = twopi * G4UniformRand() ;
     259      G4double dirx = sinTheta * std::cos(phi);
     260      G4double diry = sinTheta * std::sin(phi);
     261      G4double dirz = cosTheta ;
     262      G4ThreeVector electronDirection(dirx,diry,dirz); //electron direction
     263      electronDirection.rotateUz(photonDirection);
     264      G4DynamicParticle* electron = new G4DynamicParticle (G4Electron::Electron(),
     265                                                           electronDirection,
     266                                                           eKineticEnergy);
     267      fvect->push_back(electron);
     268    }
     269  //  else
     270  //  {
     271  //    localEnergyDeposit += eKineticEnergy;   
     272  //    eKineticEnergy = 0;
     273  //  }
     274  //  }
    270275  else
     276    {
    271277      bindingEnergy = photonEnergy;
    272    
    273  
     278    }
    274279  G4double energyInFluorescence = 0; //testing purposes
    275280
    276281  //Now, take care of fluorescence, if required
    277   if (fUseAtomicDeexcitation)
    278     {
     282  if(DeexcitationFlag() && Z > 5)
     283    {
     284      const G4ProductionCutsTable* theCoupleTable=
     285        G4ProductionCutsTable::GetProductionCutsTable();
     286      size_t indx = couple->GetIndex();
    279287      G4double cutG = (*(theCoupleTable->GetEnergyCutsVector(0)))[indx];
    280       cutG = std::min(cutForLowEnergySecondaryParticles,cutG);
     288      G4double cutE = (*(theCoupleTable->GetEnergyCutsVector(1)))[indx];
    281289     
    282       std::vector<G4DynamicParticle*>* photonVector = 0;
    283 
    284290      // Protection to avoid generating photons in the unphysical case of
    285291      // shell binding energy > photon energy
    286       if (Z > 5  && (bindingEnergy > cutG || bindingEnergy > cutE))
     292      if (bindingEnergy > cutG || bindingEnergy > cutE)
    287293        {
    288           photonVector = deexcitationManager.GenerateParticles(Z,shellId);
    289           //Check for single photons (if they are above threshold)
    290           for (size_t k=0; k< photonVector->size(); k++)
     294          deexcitationManager.SetCutForSecondaryPhotons(cutG);
     295          deexcitationManager.SetCutForAugerElectrons(cutE);
     296          std::vector<G4DynamicParticle*>* photonVector =
     297            deexcitationManager.GenerateParticles(Z,shellId);
     298          //Check for secondaries
     299          if(photonVector)
    291300            {
    292               G4DynamicParticle* aPhoton = (*photonVector)[k];
    293               if (aPhoton)
     301              for (size_t k=0; k< photonVector->size(); k++)
    294302                {
    295                   G4double itsCut = cutG;
    296                   if(aPhoton->GetDefinition() == G4Electron::Electron()) itsCut = cutE;
    297                   G4double itsEnergy = aPhoton->GetKineticEnergy();
    298                  
    299                   if (itsEnergy > itsCut && itsEnergy <= bindingEnergy)
     303                  G4DynamicParticle* aPhoton = (*photonVector)[k];
     304                  if (aPhoton)
    300305                    {
    301                       // Local energy deposit is given as the sum of the
    302                       // energies of incident photons minus the energies
    303                       // of the outcoming fluorescence photons
    304                       bindingEnergy -= itsEnergy;
    305                      
    306                     }
    307                   else
    308                     {
    309                       (*photonVector)[k] = 0;
     306                      G4double itsEnergy = aPhoton->GetKineticEnergy();
     307                      if (itsEnergy <= bindingEnergy)
     308                        {
     309                          if(aPhoton->GetDefinition() == G4Gamma::Gamma())
     310                            energyInFluorescence += itsEnergy;
     311                          bindingEnergy -= itsEnergy;
     312                          fvect->push_back(aPhoton);
     313                        }
     314                      else
     315                        {
     316                          delete aPhoton;
     317                          (*photonVector)[k] = 0;
     318                        }
    310319                    }
    311320                }
     321              delete photonVector;
    312322            }
    313         }
    314       //Register valid secondaries
    315       if (photonVector)
    316         {
    317           for ( size_t ll = 0; ll <photonVector->size(); ll++)
    318             {
    319               G4DynamicParticle* aPhoton = (*photonVector)[ll];
    320               if (aPhoton)
    321                 {
    322                   energyInFluorescence += aPhoton->GetKineticEnergy();
    323                   fvect->push_back(aPhoton);
    324                 }
    325             }
    326           delete photonVector;
    327323        }
    328324    }
     
    330326  localEnergyDeposit += bindingEnergy;
    331327     
    332 
    333328  if (localEnergyDeposit < 0)
    334329    {
     
    339334    }
    340335
    341  //Update the status of the primary gamma (kill it)
    342   fParticleChange->SetProposedKineticEnergy(0.);
    343336  fParticleChange->ProposeLocalEnergyDeposit(localEnergyDeposit);
    344   fParticleChange->ProposeTrackStatus(fStopAndKill);
    345337
    346338  if (verboseLevel > 1)
     
    360352  if (verboseLevel > 0)
    361353    {
    362       G4double energyDiff = std::fabs(eKineticEnergy+energyInFluorescence+localEnergyDeposit-photonEnergy);
     354      G4double energyDiff =
     355        std::fabs(eKineticEnergy+energyInFluorescence+localEnergyDeposit-photonEnergy);
    363356      if (energyDiff > 0.05*keV)
    364357        G4cout << "Warning from G4PenelopePhotoElectric: problem with energy conservation: " <<
    365           (eKineticEnergy+energyInFluorescence+localEnergyDeposit)/keV << " keV (final) vs. " <<
     358          (eKineticEnergy+energyInFluorescence+localEnergyDeposit)/keV
     359               << " keV (final) vs. " <<
    366360          photonEnergy/keV << " keV (initial)" << G4endl;
    367361    }
  • trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeRayleigh.cc

    r1007 r1055  
    2626// --------------------------------------------------------------------
    2727//
    28 // $Id: G4PenelopeRayleigh.cc,v 1.15 2007/09/03 09:43:14 pandola Exp $
    29 // GEANT4 tag $Name: geant4-09-02 $
     28// $Id: G4PenelopeRayleigh.cc,v 1.17 2009/05/02 09:59:17 sincerti Exp $
     29// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    3030//
    3131// Author: L. Pandola (luciano.pandola@cern.ch)
     
    4141// 03 Sep 2007 L.Pandola      Bug fix for the filling of physics table for
    4242//                            compounds defined by the mass fraction (bug #965)
     43// 02 Apr 2009 L.Pandola      Bux fixed in the calculation of mfp for compound
     44//                            materials defined as fraction of mass
     45//                            (reported by Zhang Qiwei)
    4346// --------------------------------------------------------------------
    4447
     
    9396              << G4endl;
    9497     }
     98
     99   G4cout << G4endl;
     100   G4cout << "*******************************************************************************" << G4endl;
     101   G4cout << "*******************************************************************************" << G4endl;
     102   G4cout << "   The class G4PenelopeRayleigh is NOT SUPPORTED ANYMORE. " << G4endl;
     103   G4cout << "   It will be REMOVED with the next major release of Geant4. " << G4endl;
     104   G4cout << "   Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl;
     105   G4cout << "*******************************************************************************" << G4endl;
     106   G4cout << "*******************************************************************************" << G4endl;
     107   G4cout << G4endl;
    95108}
    96109
     
    162175          const G4double* vector_of_atoms = material->GetVecNbOfAtomsPerVolume();
    163176          const G4int* stechiometric = material->GetAtomsVector();
    164           G4double density = vector_of_atoms[iright]; //non-bound molecules (default)
     177          //cs is the cross section _per atom_ in the case of compounds, while it is
     178          //_per molecule_ in the case of molecules
     179          G4double density = material->GetTotNbOfAtomsPerVolume();  //non-bound molecules (default)
    165180          if (stechiometric)
    166181            {
  • trunk/source/processes/electromagnetic/lowenergy/src/G4PenelopeRayleighModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PenelopeRayleighModel.cc,v 1.2 2008/12/04 14:09:36 pandola Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4PenelopeRayleighModel.cc,v 1.4 2009/05/19 14:57:01 pandola Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// Author: Luciano Pandola
     
    3232// --------
    3333// 14 Oct 2008   L Pandola    Migration from process to model
     34// 17 Apr 2009   V Ivanchenko Cleanup initialisation and generation of secondaries:
     35//                  - apply internal high-energy limit only in constructor
     36//                  - do not apply low-energy limit (default is 0)
     37// 19 May 2009   L Pandola    Explicitely set to zero pointers deleted in
     38//                            PrepareConstants(), since they might be checked later on
    3439//
    3540
     
    5661  fIntrinsicLowEnergyLimit = 100.0*eV;
    5762  fIntrinsicHighEnergyLimit = 100.0*GeV;
    58   SetLowEnergyLimit(fIntrinsicLowEnergyLimit);
     63  //  SetLowEnergyLimit(fIntrinsicLowEnergyLimit);
    5964  SetHighEnergyLimit(fIntrinsicHighEnergyLimit);
    6065  //
     
    9095    G4cout << "Calling G4PenelopeRayleighModel::Initialise()" << G4endl;
    9196
    92   if (LowEnergyLimit() < fIntrinsicLowEnergyLimit)
    93     {
    94       G4cout << "G4PenelopeRayleighModel: low energy limit increased from " <<
    95         LowEnergyLimit()/eV << " eV to " << fIntrinsicLowEnergyLimit/eV << " eV" << G4endl;
    96       SetLowEnergyLimit(fIntrinsicLowEnergyLimit);
    97     }
    98   if (HighEnergyLimit() > fIntrinsicHighEnergyLimit)
    99     {
    100       G4cout << "G4PenelopeRayleighModel: high energy limit decreased from " <<
    101         HighEnergyLimit()/GeV << " GeV to " << fIntrinsicHighEnergyLimit/GeV << " GeV" << G4endl;
    102       SetHighEnergyLimit(fIntrinsicHighEnergyLimit);
    103     }
    104 
    105   G4cout << "Penelope Rayleigh model is initialized " << G4endl
    106          << "Energy range: "
    107          << LowEnergyLimit() / keV << " keV - "
    108          << HighEnergyLimit() / GeV << " GeV"
    109          << G4endl;
     97
     98  if (verboseLevel > 0) {
     99    G4cout << "Penelope Rayleigh model is initialized " << G4endl
     100           << "Energy range: "
     101           << LowEnergyLimit() / keV << " keV - "
     102           << HighEnergyLimit() / GeV << " GeV"
     103           << G4endl;
     104  }
    110105
    111106  if(isInitialised) return;
    112 
    113   if(pParticleChange)
    114     fParticleChange = reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange);
    115   else
    116     fParticleChange = new G4ParticleChangeForGamma();
     107  fParticleChange = GetParticleChangeForGamma();
    117108  isInitialised = true;
    118109}
     
    120111//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    121112
    122 G4double G4PenelopeRayleighModel::CrossSectionPerVolume(const G4Material* material,
    123                                            const G4ParticleDefinition* p,
    124                                            G4double ekin,
    125                                            G4double,
    126                                            G4double)
     113G4double
     114G4PenelopeRayleighModel::CrossSectionPerVolume(const G4Material* material,
     115                                               const G4ParticleDefinition* p,
     116                                               G4double ekin,
     117                                               G4double,
     118                                               G4double)
    127119{
    128120  // Penelope model to calculate the Rayleigh scattering inverse mean
     
    233225
    234226void G4PenelopeRayleighModel::SampleSecondaries(std::vector<G4DynamicParticle*>* ,
    235                                               const G4MaterialCutsCouple* couple,
    236                                               const G4DynamicParticle* aDynamicGamma,
    237                                               G4double,
    238                                               G4double)
     227                                                const G4MaterialCutsCouple* couple,
     228                                                const G4DynamicParticle* aDynamicGamma,
     229                                                G4double,
     230                                                G4double)
    239231{
    240232  // Penelope model to sample the Rayleigh scattering final state.
     
    249241  if (verboseLevel > 3)
    250242    G4cout << "Calling SamplingSecondaries() of G4PenelopeRayleighModel" << G4endl;
    251                                                                                                    
     243
    252244  G4double photonEnergy0 = aDynamicGamma->GetKineticEnergy();
    253245 
    254   if (photonEnergy0 <= LowEnergyLimit())
    255   {
     246  if (photonEnergy0 <= fIntrinsicLowEnergyLimit)
     247    {
    256248      fParticleChange->ProposeTrackStatus(fStopAndKill);
    257249      fParticleChange->SetProposedKineticEnergy(0.);
    258250      fParticleChange->ProposeLocalEnergyDeposit(photonEnergy0);
    259251      return ;
    260   }
     252    }
    261253
    262254  G4ParticleMomentum photonDirection0 = aDynamicGamma->GetMomentumDirection();
     
    534526  Xhigh=1e06;
    535527  if (samplingFunction_x)
    536     delete samplingFunction_x;
     528    {
     529      delete samplingFunction_x;
     530      samplingFunction_x = 0;
     531    }
    537532  if (samplingFunction_xNoLog)
    538     delete samplingFunction_xNoLog;
    539  
     533    {
     534      delete samplingFunction_xNoLog;
     535      samplingFunction_xNoLog = 0;
     536    }
     537
    540538  samplingFunction_x = new G4DataVector();
    541539  samplingFunction_xNoLog = new G4DataVector();
  • trunk/source/processes/electromagnetic/lowenergy/src/G4ShellVacancy.cc

    r819 r1055  
    5050
    5151{
     52/*
    5253  G4int size = xsis.size();
    5354  for (G4int k =0; k<size; k++)
     
    5657      xsis[k] = 0;
    5758    }
     59*/
    5860}
    5961
    60 void G4ShellVacancy::AddXsiTable(G4VEMDataSet* set)
    61 
     62void G4ShellVacancy::AddXsiTable(G4VEMDataSet* p)
    6263{
    63   xsis.push_back(set);
     64  xsis.push_back(p);
    6465}
    6566
  • trunk/source/processes/electromagnetic/lowenergy/src/G4eIonisationCrossSectionHandler.cc

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

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4eIonisationParameters.cc,v 1.23 2006/06/29 19:42:02 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4eIonisationParameters.cc,v 1.24 2009/03/23 09:13:44 pandola Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
     
    4141//                          chenged to "ion-..."
    4242// 17.02.04 V.Ivanchenko    Increase buffer size
     43// 23.03.09 L.Pandola       Updated warning message
    4344//
    4445// -------------------------------------------------------------------
     
    199200    if (! (lsdp->is_open()) ) {
    200201      G4String excep = G4String("G4IonisationParameters - data file: ")
    201       + name + G4String(" not found. The version 1.# of G4LEDATA should be used");
     202      + name + G4String(" not found. Please check and/or update G4LEDATA");
    202203      G4Exception(excep);
    203204    }
  • trunk/source/processes/electromagnetic/lowenergy/src/G4eIonisationSpectrum.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eIonisationSpectrum.cc,v 1.25 2006/06/29 19:42:04 gunter Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4eIonisationSpectrum.cc,v 1.26 2009/03/23 09:13:44 pandola Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    4646// 30.05.2002 VI            Update to 24-parameters data
    4747// 11.07.2002 VI            Fix in integration over spectrum
     48// 23.03.2009 LP            Added protection against division by zero (for
     49//                          faulty database files), Bug Report 1042
    4850//
    4951// -------------------------------------------------------------------
     
    125127  p.push_back((2.0*g - 1.0)/(g*g));
    126128 
    127   p[iMax-1] = Function(p[3], p);
     129  //Add protection against division by zero: actually in Function()
     130  //parameter p[3] appears in the denominator. Bug report 1042
     131  if (p[3] > 0)
     132    p[iMax-1] = Function(p[3], p);
     133  else
     134    {
     135      G4cout << "WARNING: G4eIonisationSpectrum::Probability "
     136             << "parameter p[3] <= 0. G4LEDATA dabatase might be corrupted for Z = "
     137             << Z << ". Please check and/or update it " << G4endl;     
     138    }
    128139
    129140  if(e >= 1. && e <= 0. && Z == 4) p.push_back(0.0);
     
    210221  p.push_back((2.0*g - 1.0)/(g*g));
    211222
    212   p[iMax-1] = Function(p[3], p);
     223 
     224  //Add protection against division by zero: actually in Function()
     225  //parameter p[3] appears in the denominator. Bug report 1042
     226  if (p[3] > 0)
     227    p[iMax-1] = Function(p[3], p);
     228  else
     229    {
     230      G4cout << "WARNING: G4eIonisationSpectrum::AverageEnergy "
     231             << "parameter p[3] <= 0. G4LEDATA dabatase might be corrupted for Z = "
     232             << Z << ". Please check and/or update it " << G4endl;     
     233    }
    213234   
    214235  G4double val = AverageValue(x1, x2, p);
     
    288309  p.push_back((2.0*g - 1.0)/(g*g));
    289310
    290   p[iMax-1] = Function(p[3], p);
     311 
     312  //Add protection against division by zero: actually in Function()
     313  //parameter p[3] appears in the denominator. Bug report 1042
     314  if (p[3] > 0)
     315    p[iMax-1] = Function(p[3], p);
     316  else
     317    {
     318      G4cout << "WARNING: G4eIonisationSpectrum::SampleSpectrum "
     319             << "parameter p[3] <= 0. G4LEDATA dabatase might be corrupted for Z = "
     320             << Z << ". Please check and/or update it " << G4endl;     
     321    }
    291322
    292323  G4double aria1 = 0.0;
  • trunk/source/processes/electromagnetic/lowenergy/src/G4hLowEnergyLoss.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4hLowEnergyLoss.cc,v 1.27 2008/06/20 19:54:03 sincerti Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4hLowEnergyLoss.cc,v 1.28 2009/02/20 10:49:54 sincerti Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// -----------------------------------------------------------
     
    145145G4double G4hLowEnergyLoss::HighestKineticEnergy= 100.*GeV;
    146146G4int    G4hLowEnergyLoss::TotBin = 360;
    147 G4double G4hLowEnergyLoss::RTable,G4hLowEnergyLoss::LOGRTable;
     147G4double G4hLowEnergyLoss::RTable =1.1;
     148G4double G4hLowEnergyLoss::LOGRTable = 1.1;
    148149
    149150//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    772773    theRangeTable = theRangepbarTable ;
    773774  }
    774  
    775775  G4double R2 = RTable*RTable ;
    776776  G4double R1 = RTable+1.;
     
    10621062{
    10631063  G4double LowEdgeRange,A,B,C,discr,KineticEnergy ;
    1064   G4double Tbin = LowestKineticEnergy/RTable ;
     1064  G4double Tbin = 0;
     1065  if (RTable !=0.) Tbin = LowestKineticEnergy/RTable ;
    10651066  G4double rangebin = 0.0 ;
    10661067  G4int binnumber = -1 ;
  • trunk/source/processes/electromagnetic/muons/History

    r1007 r1055  
    1 $Id: History,v 1.124 2008/11/13 14:14:07 vnivanch Exp $
     1$Id: History,v 1.127 2009/04/12 17:19:01 vnivanch Exp $
    22-------------------------------------------------------------------
    33
     
    1717     * Reverse chronological order (last date on top), please *
    1818     ----------------------------------------------------------
     19
     2012 April 09: V.Ivant (emmuons-V09-02-02)
     21G4MuBetheBlochModel, G4MuBremsstrahlungModel, G4MuPairProductionModel
     22  - simplified initialisation
     23
     2426 February 09: V.Ivant (emmuons-V09-02-01)
     25G4MuIonisation - fixed initialisation alowing to configure external model
     26                 of fluctuations
     27
     2820 February 09: V.Ivant (emmuons-V09-02-00)
     29- Cleanup: improved comments, move virtual methods from .hh to .cc
    1930
    203112 November 08: V.Ivant (emmuons-V09-01-15)
  • trunk/source/processes/electromagnetic/muons/include/G4MuBetheBlochModel.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4MuBetheBlochModel.hh,v 1.17 2007/05/22 17:35:58 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4MuBetheBlochModel.hh,v 1.18 2009/02/20 14:48:16 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    7676  virtual ~G4MuBetheBlochModel();
    7777
    78   void Initialise(const G4ParticleDefinition*, const G4DataVector&);
     78  virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&);
    7979
    80   G4double MinEnergyCut(const G4ParticleDefinition*,
    81                         const G4MaterialCutsCouple*);
     80  virtual G4double MinEnergyCut(const G4ParticleDefinition*,
     81                                const G4MaterialCutsCouple*);
    8282                       
    8383  virtual G4double ComputeCrossSectionPerElectron(
     
    113113protected:
    114114
    115   G4double MaxSecondaryEnergy(const G4ParticleDefinition*,
    116                                     G4double kinEnergy);
     115  virtual G4double MaxSecondaryEnergy(const G4ParticleDefinition*,
     116                                      G4double kinEnergy);
    117117
    118118private:
    119119
    120   void SetParticle(const G4ParticleDefinition* p);
     120  inline void SetParticle(const G4ParticleDefinition* p);
    121121
    122122  // hide assignment operator
     
    141141};
    142142
    143 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
     143//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    144144
    145 inline G4double G4MuBetheBlochModel::MaxSecondaryEnergy(
    146           const G4ParticleDefinition*,
    147                 G4double kinEnergy)
     145inline void G4MuBetheBlochModel::SetParticle(const G4ParticleDefinition* p)
    148146{
    149   G4double tau  = kinEnergy/mass;
    150   G4double tmax = 2.0*electron_mass_c2*tau*(tau + 2.) /
    151                   (1. + 2.0*(tau + 1.)*ratio + ratio*ratio);
    152   return tmax;
     147  if(!particle) {
     148    particle = p;
     149    mass = particle->GetPDGMass();
     150    massSquare = mass*mass;
     151    ratio = electron_mass_c2/mass;
     152  }
    153153}
    154154
  • trunk/source/processes/electromagnetic/muons/include/G4MuBremsstrahlung.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4MuBremsstrahlung.hh,v 1.30 2008/02/29 17:50:05 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4MuBremsstrahlung.hh,v 1.31 2009/02/20 14:48:16 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    8686  virtual ~G4MuBremsstrahlung();
    8787
    88   G4bool IsApplicable(const G4ParticleDefinition& p);
     88  virtual G4bool IsApplicable(const G4ParticleDefinition& p);
    8989
    90   G4double MinPrimaryEnergy(const G4ParticleDefinition* p,
    91                             const G4Material*,
    92                             G4double cut);
     90  virtual G4double MinPrimaryEnergy(const G4ParticleDefinition* p,
     91                                    const G4Material*,
     92                                    G4double cut);
    9393
    9494  // Print out of the class parameters
    95   void PrintInfo();
     95  virtual void PrintInfo();
    9696
    9797protected:
    9898
    99   void InitialiseEnergyLossProcess(const G4ParticleDefinition*,
    100                                    const G4ParticleDefinition*);
     99  virtual void InitialiseEnergyLossProcess(const G4ParticleDefinition*,
     100                                           const G4ParticleDefinition*);
    101101
    102102private:
     
    114114
    115115//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    116 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    117 
    118 inline
    119 G4bool G4MuBremsstrahlung::IsApplicable(const G4ParticleDefinition& p)
    120 {
    121   return (p.GetPDGCharge() != 0.0 && p.GetPDGMass() > 10.0*MeV);
    122 }
    123 
    124 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    125 
    126 inline
    127 G4double G4MuBremsstrahlung::MinPrimaryEnergy(const G4ParticleDefinition*,
    128                                               const G4Material*,
    129                                               G4double)
    130 {
    131   return lowestKinEnergy;
    132 }
    133 
    134 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    135116
    136117#endif
  • trunk/source/processes/electromagnetic/muons/include/G4MuBremsstrahlungModel.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4MuBremsstrahlungModel.hh,v 1.21 2008/07/22 16:11:34 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4MuBremsstrahlungModel.hh,v 1.22 2009/02/20 14:48:16 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    7878  virtual ~G4MuBremsstrahlungModel();
    7979
    80   void SetParticle(const G4ParticleDefinition*);
     80  virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&);
    8181
    82   void Initialise(const G4ParticleDefinition*, const G4DataVector&);
    83 
    84   G4double MinEnergyCut(const G4ParticleDefinition*,
    85                         const G4MaterialCutsCouple*);
     82  virtual G4double MinEnergyCut(const G4ParticleDefinition*,
     83                                const G4MaterialCutsCouple*);
    8684                             
    8785  virtual G4double ComputeCrossSectionPerAtom(
     
    9795                                G4double cutEnergy);
    9896                             
    99   void SampleSecondaries(std::vector<G4DynamicParticle*>*,
    100                         const G4MaterialCutsCouple*,
    101                         const G4DynamicParticle*,
    102                         G4double tmin,
    103                         G4double maxEnergy);
     97  virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*,
     98                                const G4MaterialCutsCouple*,
     99                                const G4DynamicParticle*,
     100                                G4double tmin,
     101                                G4double maxEnergy);
    104102
    105103  inline void SetLowestKineticEnergy(G4double e);
     
    117115                                                   G4double gammaEnergy);
    118116
    119   G4double MaxSecondaryEnergy(const G4ParticleDefinition*,
    120                               G4double kineticEnergy);
     117  inline void SetParticle(const G4ParticleDefinition*);
    121118
    122119private:
     
    160157//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    161158
    162 inline
    163 G4double G4MuBremsstrahlungModel::MaxSecondaryEnergy(const G4ParticleDefinition*,
    164                                                      G4double kineticEnergy)
    165 {
    166   return kineticEnergy;
    167 }
    168 
    169 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    170 
    171159inline void G4MuBremsstrahlungModel::SetLowestKineticEnergy(G4double e)
    172160{
    173161  lowestKinEnergy = e;
    174 }
    175 
    176 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    177 
    178 inline
    179 G4double G4MuBremsstrahlungModel::MinEnergyCut(const G4ParticleDefinition*,
    180                                                const G4MaterialCutsCouple*)
    181 {
    182   return minThreshold;
    183162}
    184163
  • trunk/source/processes/electromagnetic/muons/include/G4MuIonisation.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4MuIonisation.hh,v 1.30 2007/05/23 08:49:32 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4MuIonisation.hh,v 1.31 2009/02/20 14:48:16 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    9595  virtual ~G4MuIonisation();
    9696
    97   G4bool IsApplicable(const G4ParticleDefinition& p);
     97  virtual G4bool IsApplicable(const G4ParticleDefinition& p);
    9898
    99   G4double MinPrimaryEnergy(const G4ParticleDefinition* p,
    100                             const G4Material*, G4double cut);
     99  virtual G4double MinPrimaryEnergy(const G4ParticleDefinition* p,
     100                                    const G4Material*, G4double cut);
    101101
    102102  // Print out of the class parameters
    103   void PrintInfo();
     103  virtual void PrintInfo();
    104104
    105105protected:
     
    127127
    128128//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    129 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    130 
    131 inline G4bool G4MuIonisation::IsApplicable(const G4ParticleDefinition& p)
    132 {
    133   return (p.GetPDGCharge() != 0.0 && p.GetPDGMass() > 10.0*MeV);
    134 }
    135 
    136 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    137 
    138 inline G4double G4MuIonisation::MinPrimaryEnergy(const G4ParticleDefinition*,
    139                                                  const G4Material*,
    140                                                  G4double cut)
    141 {
    142   G4double x = 0.5*cut/electron_mass_c2;
    143   G4double g = x*ratio + std::sqrt((1. + x)*(1. + x*ratio*ratio));
    144   return mass*(g - 1.0);
    145 }
    146 
    147 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    148129
    149130#endif
  • trunk/source/processes/electromagnetic/muons/include/G4MuPairProduction.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4MuPairProduction.hh,v 1.30 2008/02/29 17:50:05 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4MuPairProduction.hh,v 1.31 2009/02/20 14:48:16 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    8484  virtual ~G4MuPairProduction();
    8585
    86   G4bool IsApplicable(const G4ParticleDefinition& p);
     86  virtual G4bool IsApplicable(const G4ParticleDefinition& p);
    8787
    88   G4double MinPrimaryEnergy(const G4ParticleDefinition* p,
    89                             const G4Material*, G4double cut);
     88  virtual G4double MinPrimaryEnergy(const G4ParticleDefinition* p,
     89                                    const G4Material*, G4double cut);
    9090
    9191  // Print out of the class parameters
    92   void PrintInfo();
     92  virtual void PrintInfo();
    9393
    9494protected:
    9595
    96   void InitialiseEnergyLossProcess(const G4ParticleDefinition*,
    97                                    const G4ParticleDefinition*);
     96  virtual void InitialiseEnergyLossProcess(const G4ParticleDefinition*,
     97                                           const G4ParticleDefinition*);
    9898
    9999private:
     
    113113
    114114//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    115 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    116 
    117 inline
    118 G4bool G4MuPairProduction::IsApplicable(const G4ParticleDefinition& p)
    119 {
    120   return (p.GetPDGCharge() != 0.0 && p.GetPDGMass() > 10.0*MeV);
    121 }
    122 
    123 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    124 
    125 inline
    126 G4double G4MuPairProduction::MinPrimaryEnergy(const G4ParticleDefinition*,
    127                                               const G4Material*,
    128                                               G4double)
    129 {
    130   return lowestKinEnergy;
    131 }
    132 
    133 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    134115
    135116#endif
  • trunk/source/processes/electromagnetic/muons/include/G4MuPairProductionModel.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4MuPairProductionModel.hh,v 1.27 2008/07/22 16:11:34 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4MuPairProductionModel.hh,v 1.28 2009/02/20 14:48:16 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    7979  virtual ~G4MuPairProductionModel();
    8080
    81   void Initialise(const G4ParticleDefinition*, const G4DataVector&);
     81  virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&);
    8282
    8383                       
     
    100100                                 G4double maxEnergy);
    101101
     102  virtual G4double MinEnergyCut(const G4ParticleDefinition*,
     103                               const G4MaterialCutsCouple*);
     104
    102105  inline void SetLowestKineticEnergy(G4double e);
    103 
    104   inline G4double MinEnergyCut(const G4ParticleDefinition*,
    105                                const G4MaterialCutsCouple*);
    106106
    107107  inline void SetParticle(const G4ParticleDefinition*);
     
    120120                                                   G4double pairEnergy);
    121121
    122   inline G4double MaxSecondaryEnergy(const G4ParticleDefinition*,
    123                                      G4double kineticEnergy);
     122  virtual G4double MaxSecondaryEnergy(const G4ParticleDefinition*,
     123                                      G4double kineticEnergy);
    124124
    125125  inline void SetCurrentElement(G4double Z);
     
    193193
    194194inline
    195 G4double G4MuPairProductionModel::MinEnergyCut(const G4ParticleDefinition*,
    196                                                const G4MaterialCutsCouple* )
    197 {
    198   return minPairEnergy;
    199 }
    200 
    201 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    202 
    203 inline
    204195void G4MuPairProductionModel::SetParticle(const G4ParticleDefinition* p)
    205196{
     
    208199    particleMass = particle->GetPDGMass();
    209200  }
    210 }
    211 
    212 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    213 
    214 inline G4double G4MuPairProductionModel::MaxSecondaryEnergy(
    215                                  const G4ParticleDefinition*,
    216                                        G4double kineticEnergy)
    217 {
    218   G4double maxPairEnergy = kineticEnergy + particleMass*(1.0 - 0.75*sqrte*z13);
    219   return maxPairEnergy;
    220201}
    221202
  • trunk/source/processes/electromagnetic/muons/src/G4MuBetheBlochModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4MuBetheBlochModel.cc,v 1.24 2008/03/25 12:31:04 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4MuBetheBlochModel.cc,v 1.26 2009/04/12 17:19:01 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    8888  theElectron = G4Electron::Electron();
    8989  corr = G4LossTableManager::Instance()->EmCorrections();
     90  fParticleChange = 0;
    9091
    9192  if(p) SetParticle(p);
     
    99100//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    100101
    101 void G4MuBetheBlochModel::SetParticle(const G4ParticleDefinition* p)
    102 {
    103   if(!particle) {
    104     particle = p;
    105     mass = particle->GetPDGMass();
    106     massSquare = mass*mass;
    107     ratio = electron_mass_c2/mass;
    108   }
    109 }
    110 
    111 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    112 
    113102G4double G4MuBetheBlochModel::MinEnergyCut(const G4ParticleDefinition*,
    114103                                           const G4MaterialCutsCouple* couple)
     
    117106}
    118107
     108//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
     109
     110G4double G4MuBetheBlochModel::MaxSecondaryEnergy(const G4ParticleDefinition*,
     111                                                 G4double kinEnergy)
     112{
     113  G4double tau  = kinEnergy/mass;
     114  G4double tmax = 2.0*electron_mass_c2*tau*(tau + 2.) /
     115                  (1. + 2.0*(tau + 1.)*ratio + ratio*ratio);
     116  return tmax;
     117}
     118
    119119//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    120120
     
    123123{
    124124  if(p) SetParticle(p);
    125 
    126   if(pParticleChange)
    127     fParticleChange = reinterpret_cast<G4ParticleChangeForLoss*>
    128                                                              (pParticleChange);
    129   else
    130     fParticleChange = new G4ParticleChangeForLoss();
     125  if(!fParticleChange) fParticleChange = GetParticleChangeForLoss();
    131126}
    132127
  • trunk/source/processes/electromagnetic/muons/src/G4MuBremsstrahlung.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4MuBremsstrahlung.cc,v 1.41 2008/10/16 13:37:04 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4MuBremsstrahlung.cc,v 1.42 2009/02/20 14:48:16 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    9393//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    9494
     95G4bool G4MuBremsstrahlung::IsApplicable(const G4ParticleDefinition& p)
     96{
     97  return (p.GetPDGCharge() != 0.0 && p.GetPDGMass() > 10.0*MeV);
     98}
     99
     100//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     101
     102G4double G4MuBremsstrahlung::MinPrimaryEnergy(const G4ParticleDefinition*,
     103                                              const G4Material*,
     104                                              G4double)
     105{
     106  return lowestKinEnergy;
     107}
     108
     109//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     110
    95111void G4MuBremsstrahlung::InitialiseEnergyLossProcess(
    96112                                 const G4ParticleDefinition* part,
  • trunk/source/processes/electromagnetic/muons/src/G4MuBremsstrahlungModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4MuBremsstrahlungModel.cc,v 1.32 2008/07/22 16:11:34 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4MuBremsstrahlungModel.cc,v 1.35 2009/04/12 17:48:45 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    111111//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    112112
     113G4double G4MuBremsstrahlungModel::MinEnergyCut(const G4ParticleDefinition*,
     114                                               const G4MaterialCutsCouple*)
     115{
     116  return minThreshold;
     117}
     118
     119//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     120
    113121void G4MuBremsstrahlungModel::Initialise(const G4ParticleDefinition* p,
    114122                                         const G4DataVector& cuts)
     
    131139    if(nn > 0) {
    132140      for (G4int ii=0; ii<nn; ii++){
    133         G4DataVector* a=partialSumSigma[ii];
     141        G4DataVector* a = partialSumSigma[ii];
    134142        if ( a )  delete a;   
    135143      }
     
    154162
    155163  // define pointer to G4ParticleChange
    156   if(!fParticleChange) {
    157     if(pParticleChange)
    158       fParticleChange =
    159         reinterpret_cast<G4ParticleChangeForLoss*>(pParticleChange);
    160     else
    161       fParticleChange = new G4ParticleChangeForLoss();
    162   }
     164  if(!fParticleChange) fParticleChange = GetParticleChangeForLoss();
    163165}
    164166
  • trunk/source/processes/electromagnetic/muons/src/G4MuIonisation.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4MuIonisation.cc,v 1.57 2008/10/27 10:55:07 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4MuIonisation.cc,v 1.59 2009/02/26 11:04:20 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    8686#include "G4MuBetheBlochModel.hh"
    8787#include "G4UniversalFluctuation.hh"
     88#include "G4IonFluctuations.hh"
    8889#include "G4BohrFluctuations.hh"
    8990#include "G4UnitsTable.hh"
     
    112113//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    113114
     115G4bool G4MuIonisation::IsApplicable(const G4ParticleDefinition& p)
     116{
     117  return (p.GetPDGCharge() != 0.0 && p.GetPDGMass() > 10.0*MeV);
     118}
     119
     120//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     121
     122G4double G4MuIonisation::MinPrimaryEnergy(const G4ParticleDefinition*,
     123                                          const G4Material*,
     124                                          G4double cut)
     125{
     126  G4double x = 0.5*cut/electron_mass_c2;
     127  G4double g = x*ratio + std::sqrt((1. + x)*(1. + x*ratio*ratio));
     128  return mass*(g - 1.0);
     129}
     130
     131//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     132
    114133void G4MuIonisation::InitialiseEnergyLossProcess(const G4ParticleDefinition* part,
    115134                                                 const G4ParticleDefinition* bpart)
     
    123142    SetSecondaryParticle(G4Electron::Electron());
    124143
    125     flucModel = new G4UniversalFluctuation();
     144    // Bragg peak model
     145    if (!EmModel(1)) SetEmModel(new G4BraggModel(),1);
     146    EmModel(1)->SetLowEnergyLimit(MinKinEnergy());
     147    EmModel(1)->SetHighEnergyLimit(0.2*MeV);
     148    AddEmModel(1, EmModel(1), new G4IonFluctuations());
    126149
    127     G4VEmModel* em = new G4BraggModel();
    128     em->SetLowEnergyLimit(MinKinEnergy());
    129     em->SetHighEnergyLimit(0.2*MeV);
    130     AddEmModel(1, em, flucModel);
    131     G4VEmModel* em1 = new G4BetheBlochModel();
    132     em1->SetLowEnergyLimit(0.2*MeV);
    133     em1->SetHighEnergyLimit(1.0*GeV);
    134     AddEmModel(2, em1, flucModel);
    135     G4VEmModel* em2 = new G4MuBetheBlochModel();
    136     em2->SetLowEnergyLimit(1.0*GeV);
    137     em2->SetHighEnergyLimit(MaxKinEnergy());
    138     AddEmModel(3, em2, flucModel);
     150    // high energy fluctuation model
     151    if (!FluctModel()) SetFluctModel(new G4UniversalFluctuation());
     152
     153    // moderate energy model
     154    if (!EmModel(2)) SetEmModel(new G4BetheBlochModel(),2);
     155    EmModel(2)->SetLowEnergyLimit(0.2*MeV);
     156    EmModel(2)->SetHighEnergyLimit(1.0*GeV);
     157    AddEmModel(2, EmModel(2), FluctModel());
     158
     159    // high energy model
     160    if (!EmModel(3)) SetEmModel(new G4MuBetheBlochModel(),3);
     161    EmModel(3)->SetLowEnergyLimit(1.0*GeV);
     162    EmModel(3)->SetHighEnergyLimit(MaxKinEnergy());
     163    AddEmModel(3, EmModel(3), FluctModel());
    139164
    140165    ratio = electron_mass_c2/mass;
  • trunk/source/processes/electromagnetic/muons/src/G4MuPairProduction.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4MuPairProduction.cc,v 1.51 2008/10/16 13:37:04 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4MuPairProduction.cc,v 1.52 2009/02/20 14:48:16 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    100100//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    101101
     102G4bool G4MuPairProduction::IsApplicable(const G4ParticleDefinition& p)
     103{
     104  return (p.GetPDGCharge() != 0.0 && p.GetPDGMass() > 10.0*MeV);
     105}
     106
     107//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     108
     109G4double G4MuPairProduction::MinPrimaryEnergy(const G4ParticleDefinition*,
     110                                              const G4Material*,
     111                                              G4double)
     112{
     113  return lowestKinEnergy;
     114}
     115
     116//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     117
    102118void G4MuPairProduction::InitialiseEnergyLossProcess(
    103119                         const G4ParticleDefinition* part,
  • trunk/source/processes/electromagnetic/muons/src/G4MuPairProductionModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4MuPairProductionModel.cc,v 1.39 2008/07/22 16:11:34 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4MuPairProductionModel.cc,v 1.41 2009/04/12 17:19:01 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    137137//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    138138
     139G4double G4MuPairProductionModel::MinEnergyCut(const G4ParticleDefinition*,
     140                                               const G4MaterialCutsCouple* )
     141{
     142  return minPairEnergy;
     143}
     144
     145//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     146
     147G4double G4MuPairProductionModel::MaxSecondaryEnergy(const G4ParticleDefinition*,
     148                                                     G4double kineticEnergy)
     149{
     150  G4double maxPairEnergy = kineticEnergy + particleMass*(1.0 - 0.75*sqrte*z13);
     151  return maxPairEnergy;
     152}
     153
     154//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     155
    139156void G4MuPairProductionModel::Initialise(const G4ParticleDefinition* p,
    140157                                         const G4DataVector&)
     
    144161    MakeSamplingTables();
    145162  }
    146   if(!fParticleChange) {
    147     if(pParticleChange)
    148       fParticleChange =
    149         reinterpret_cast<G4ParticleChangeForLoss*>(pParticleChange);
    150     else
    151       fParticleChange = new G4ParticleChangeForLoss();
    152   }
     163  if(!fParticleChange) fParticleChange = GetParticleChangeForLoss();
    153164}
    154165
  • trunk/source/processes/electromagnetic/polarisation/History

    r961 r1055  
    1 $Id: History,v 1.16 2008/10/30 22:34:23 schaelic Exp $
     1$Id: History,v 1.18 2009/04/12 17:43:35 vnivanch Exp $
    22-------------------------------------------------------------------
    33
     
    1717     * Reverse chronological order (last date on top), please *
    1818     ----------------------------------------------------------
     19
     2012 April 09: V.Ivanchenko (empolar-V09-02-00)
     21G4PolarizedAnnihilationModel - simplified initialisation
     22
    192330 October 08: A.Schaelicke (empolar-V09-01-01)
    2024   For all process classes set sub-types according to the enumeration
  • trunk/source/processes/electromagnetic/polarisation/src/G4PolarizedAnnihilationModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PolarizedAnnihilationModel.cc,v 1.6 2007/07/10 09:38:17 schaelic Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4PolarizedAnnihilationModel.cc,v 1.8 2009/04/12 17:47:58 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    8383  //  G4eeToTwoGammaModel::Initialise(part,dv);
    8484  if(gIsInitialised) return;
    85 
    86   if(pParticleChange)
    87     gParticleChange =
    88       reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange);
    89   else
    90     gParticleChange = new G4ParticleChangeForGamma();
    91 
     85  gParticleChange = GetParticleChangeForGamma();
    9286  gIsInitialised = true;
    9387}
  • 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,
  • trunk/source/processes/electromagnetic/utils/History

    r1007 r1055  
    1 $Id: History,v 1.364 2008/11/20 20:32:40 vnivanch Exp $
     1$Id: History,v 1.383 2009/05/27 11:55:02 vnivanch Exp $
    22-------------------------------------------------------------------
    33
     
    1717     * Reverse chronological order (last date on top), please *
    1818     ----------------------------------------------------------
     19
     2027 May 09: V.Ivant (emutils-V09-02-11)
     21- G4VMultipleScattering - discarded changes from the previous tag
     22
     2326 May 09: V.Ivant (emutils-V09-02-10)
     24- G4VEmModel: remove protection in  from previous tag and include protection
     25              to G4ParticleChangeForLoss;
     26              more save initialisation of G4EmElementSelectors
     27- G4VMultipleScattering - added a protection against zero kinetic energy 
     28- G4EmElementSelector - do not use spline
     29
     3022 May 09: V.Ivant (emutils-V09-02-09)
     31- Added protection into G4VEmModel for zero input energy
     32
     3315 May 09: V.Ivant (emutils-V09-02-08)
     34- Added new testG4EnergyLossTables and fixed GNUmakefile for tests
     35
     3610 May 09: V.Ivant (emutils-V09-02-07)
     37G4EmElementSelector - added protection for zero cross section at first and last
     38                      bins of physics vector
     39G4VMscModel, G4VMultipleScattering - set default Range Factor to 0.04
     40
     4117 April 09: V.Ivant (emutils-V09-02-06)
     42- G4EmModelManager - fixed energy range selection algorithm for the case of
     43                     a small intersection of model energy intervals
     44- G4VEnergyLossProcess, G4VEmProcess, G4VMultipleScattering - set high enegry
     45                     limit 10 TeV and number of bins 77
     46
     4708 April 09: V.Ivant (emutils-V09-02-05)
     48- G4LossTableManager - added G4EmConfigurator providing easier addition of
     49                       models per region
     50- G4VMultipleScattering, G4VEmProcess, G4VEnergyLossProcess: added
     51                       initialisation of the G4EmConfigurator
     52
     5308 April 09: V.Ivant (emutils-V09-02-04)
     54- G4EmModelManager - fixed energy range selection algorithm for the case
     55                     when there is an intersection of energy regions of standard
     56                     and low-energy models,
     57                   - reduce internal vectors if no model per region are initialized.
     58                   - do not initilise unused models.
     59- G4VEmModel - msc methods are moved to G4VMscModel, added protected
     60               methods for initialisation of ParticleChange             
     61- G4VMultipleScattering, G4VEmProcess, G4VEnergyLossProcess:
     62  methods for initialisations are moved from inline to source
     63
     6426 February 09: V.Ivant (emutils-V09-02-03)
     65G4EmConfigurator - fixed for the case if only fluctuation model is set
     66                   and main model is default
     67
     6822 February 09: V.Ivant (emutils-V09-02-02)
     69- G4VEmModel - make methods to access geometry protected, added new
     70               method SetSampleZ, added geommax private member
     71- G4EmCalculator - added possibility to be used by DNA processes:
     72                   take into account special DNA particles
     73
     7418 February 09: V.Ivant (emutils-V09-02-01)
     75G4VEmModel, G4VEmFluctuationModel, G4VEnegryLossProcess, G4VEmProcess,
     76G4VMultipleScattering - move all virtual methods to source, update comments
     77G4VEmModel - added flagDeexcitation and Get/Set methods
     78G4VEnegryLossProcess, G4VEmProcess - added calls to deexcitation PostStep
     79G4EmProcessOptions - added ActivateDeexcitation method
     80G4EnergyLossMessenger - added /process/em/deexcitation UI command
     81G4LossTableBuilder - added protection in BuildRangeTable against zero dedx
     82
     8327 January 09: V.Ivant (emutils-V09-02-00)
     84G4VEmModel - added method SampleDeexcitationAlongStep
     85G4VEnegryLossProcess - added deexcitation AlongStep per region
     86G4VMscModel - added methdos: InitialiseSafetyHelper, ComputeSafety,
     87              ComputeGeomLimit, ComputeDisplacement
     88G4VEmProcess - added possibility to set more than 1 model
    1989
    209020 November 08: V.Ivant (emutils-V09-01-37)
  • trunk/source/processes/electromagnetic/utils/include/G4DummyModel.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4DummyModel.hh,v 1.3 2007/05/22 17:31:57 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4DummyModel.hh,v 1.4 2009/04/07 18:39:47 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    5151
    5252#include "globals.hh"
    53 #include "G4VEmModel.hh"
     53#include "G4VMscModel.hh"
    5454
    55 class G4DummyModel :  public G4VEmModel
     55class G4DummyModel :  public G4VMscModel
    5656{
    5757
  • trunk/source/processes/electromagnetic/utils/include/G4EmElementSelector.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4EmElementSelector.hh,v 1.2 2008/07/22 15:55:15 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4EmElementSelector.hh,v 1.4 2009/05/10 18:26:43 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    8989  G4VEmModel*       model;
    9090  const G4Material* material;
     91  const G4Element*  element;
    9192  const G4ElementVector* theElementVector;
    9293
     
    107108inline const G4Element* G4EmElementSelector::SelectRandomAtom(G4double e)
    108109{
    109   const G4Element* elm = (*theElementVector)[nElmMinusOne];
    110110  if (nElmMinusOne > 0) {
    111111    G4bool b;
     
    113113    for(G4int i=0; i<nElmMinusOne; i++) {
    114114      if (x <= (xSections[i])->GetValue(e,b)) {
    115         elm = (*theElementVector)[i];
     115        element = (*theElementVector)[i];
    116116        break;
    117117      }
    118118    }
    119119  }
    120   return elm;
     120  return element;
    121121}
    122122
  • trunk/source/processes/electromagnetic/utils/include/G4EmModelManager.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4EmModelManager.hh,v 1.25 2008/10/13 14:56:56 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4EmModelManager.hh,v 1.28 2009/04/09 15:53:17 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    5353// 13-05-06 Add GetModel by index method (VI)
    5454// 15-03-07 Add maxCutInRange (V.Ivanchenko)
     55// 08-04-08 Simplify Select method for only one G4RegionModel (VI)
    5556//
    5657// Class Description:
     
    9192  ~G4RegionModels();
    9293
    93   G4int SelectIndex(G4double e) const {
     94  inline G4int SelectIndex(G4double e) const {
    9495    G4int idx = 0;
    9596    if (nModelsForRegion>1) {
     
    100101  };
    101102
    102   G4int ModelIndex(G4int n) const {
     103  inline G4int ModelIndex(G4int n) const {
    103104    return theListOfModelIndexes[n];
    104105  };
    105106
    106   G4int NumberOfModels() const {
     107  inline G4int NumberOfModels() const {
    107108    return nModelsForRegion;
    108109  };
    109110
    110   G4double LowEdgeEnergy(G4int n) const {
     111  inline G4double LowEdgeEnergy(G4int n) const {
    111112    return lowKineticEnergy[n];
    112113  };
    113114
    114   const G4Region* Region() const {
     115  inline const G4Region* Region() const {
    115116    return theRegion;
    116117  };
     
    150151                                       G4int);
    151152
    152   const G4DataVector* Cuts() const;
    153 
    154   const G4DataVector* SubCutoff() const;
    155 
    156153  void FillDEDXVector(G4PhysicsVector*, const G4MaterialCutsCouple*,
    157154                      G4EmTableType t = fRestricted);
     
    160157                        G4bool startFromNull = true, G4EmTableType t = fRestricted);
    161158
    162   G4VEmModel* SelectModel(G4double& energy, size_t& index);
    163 
    164159  G4VEmModel* GetModel(G4int, G4bool ver = false);
    165 
    166   G4int NumberOfModels() const;
    167160
    168161  void AddEmModel(G4int, G4VEmModel*, G4VEmFluctuationModel*, const G4Region*);
     
    171164
    172165  void DumpModelList(G4int verb);
     166
     167  inline G4VEmModel* SelectModel(G4double& energy, size_t& index);
     168
     169  inline const G4DataVector* Cuts() const;
     170
     171  inline const G4DataVector* SubCutoff() const;
     172
     173  inline G4int NumberOfModels() const;
    173174
    174175private:
     
    190191  std::vector<const G4Region*>            regions;
    191192  std::vector<G4int>                      orderOfModels;
     193  std::vector<G4int>                      isUsed;
    192194
    193195  G4int                       nEmModels;
     
    209211  G4int                       verboseLevel;
    210212
    211   // cash
    212   G4int                       currentIdx;
    213 
     213  // may be changed in run time
     214  G4RegionModels*             currRegionModel;
    214215};
    215216
     
    220221                                                 size_t& index)
    221222{
    222   currentIdx =
    223     (setOfRegionModels[idxOfRegionModels[index]])->SelectIndex(kinEnergy);
    224   return models[currentIdx];
     223  if(nRegions > 1) currRegionModel = setOfRegionModels[idxOfRegionModels[index]];
     224  return models[currRegionModel->SelectIndex(kinEnergy)];
    225225}
    226226
  • trunk/source/processes/electromagnetic/utils/include/G4EmProcessOptions.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4EmProcessOptions.hh,v 1.14 2008/04/17 10:33:26 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4EmProcessOptions.hh,v 1.15 2009/02/18 14:40:10 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929//
     
    107107  void SetLinearLossLimit(G4double val);
    108108
    109   void ActivateDeexcitation(G4bool val, const G4Region* r = 0);
     109  void ActivateDeexcitation(const G4String& proc, G4bool val,
     110                            const G4String& reg = "");
    110111
    111112  void SetMscStepLimitation(G4MscStepLimitType val);
  • trunk/source/processes/electromagnetic/utils/include/G4EnergyLossMessenger.hh

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4EnergyLossMessenger.hh,v 1.22 2008/10/20 13:27:45 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4EnergyLossMessenger.hh,v 1.23 2009/02/18 14:40:10 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// -------------------------------------------------------------------
     
    107107  G4UIcmdWithADouble*        MinSubSecCmd;
    108108  G4UIcommand*               StepFuncCmd;
     109  G4UIcommand*               deexCmd;
    109110  G4UIcmdWithAString*        mscCmd;
    110111  G4UIcmdWithADoubleAndUnit* MinEnCmd;
  • trunk/source/processes/electromagnetic/utils/include/G4LossTableManager.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4LossTableManager.hh,v 1.53 2008/07/15 16:56:38 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4LossTableManager.hh,v 1.54 2009/04/09 16:10:57 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929//
     
    9191class G4EmCorrections;
    9292class G4EmSaturation;
     93class G4EmConfigurator;
    9394class G4LossTableBuilder;
    9495
     
    232233
    233234  G4EmSaturation* EmSaturation();
     235
     236  G4EmConfigurator* EmConfigurator();
    234237
    235238private:
     
    304307  G4EmCorrections*            emCorrections;
    305308  G4EmSaturation*             emSaturation;
     309  G4EmConfigurator*           emConfigurator;
    306310
    307311  const G4ParticleDefinition* firstParticle;
  • trunk/source/processes/electromagnetic/utils/include/G4VEmFluctuationModel.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VEmFluctuationModel.hh,v 1.11 2008/09/12 14:47:38 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4VEmFluctuationModel.hh,v 1.12 2009/02/19 11:25:50 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    101101  //------------------------------------------------------------------------
    102102
    103   G4String GetName() const;
     103  inline G4String GetName() const;
    104104
    105105private:
     
    115115//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    116116
    117 inline void G4VEmFluctuationModel::InitialiseMe(const G4ParticleDefinition*)
    118 {}
    119 
    120 inline
    121 void G4VEmFluctuationModel::SetParticleAndCharge(const G4ParticleDefinition*,
    122                                                  G4double)
    123 {}
    124 
    125117inline G4String G4VEmFluctuationModel::GetName() const
    126118{
  • trunk/source/processes/electromagnetic/utils/include/G4VEmModel.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VEmModel.hh,v 1.59 2008/11/13 19:29:41 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4VEmModel.hh,v 1.69 2009/05/26 15:00:49 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    6565// 12-09-08 Added methods GetParticleCharge, GetChargeSquareRatio,
    6666//          CorrectionsAlongStep, ActivateNuclearStopping (VI)
     67// 16-02-09 Moved implementations of virtual methods to source (VI)
     68// 07-04-09 Moved msc methods from G4VEmModel to G4VMscModel (VI)
    6769//
    6870// Class Description:
     
    9294class G4Region;
    9395class G4VParticleChange;
     96class G4ParticleChangeForLoss;
     97class G4ParticleChangeForGamma;
    9498class G4Track;
    9599
     
    120124  //------------------------------------------------------------------------
    121125
    122   // dEdx per unit length
    123   virtual G4double ComputeDEDX(const G4MaterialCutsCouple*,
    124                                const G4ParticleDefinition*,
    125                                G4double kineticEnergy,
    126                                G4double cutEnergy = DBL_MAX);
    127 
    128126  // main method to compute dEdx
    129127  virtual G4double ComputeDEDXPerVolume(const G4Material*,
     
    131129                                        G4double kineticEnergy,
    132130                                        G4double cutEnergy = DBL_MAX);
    133 
    134   // cross section per volume
    135   virtual G4double CrossSection(const G4MaterialCutsCouple*,
    136                                 const G4ParticleDefinition*,
    137                                 G4double kineticEnergy,
    138                                 G4double cutEnergy = 0.0,
    139                                 G4double maxEnergy = DBL_MAX);
    140131
    141132  // main method to compute cross section per Volume
     
    175166                                    G4double length);
    176167
     168  // sample PIXE deexcitation
     169  virtual void SampleDeexcitationAlongStep(const G4Material*,
     170                                           const G4Track&,
     171                                           G4double& eloss);
     172
     173  // add region for the model
     174  virtual void DefineForRegion(const G4Region*);
     175
     176  // initilisation at run time for given material
     177  virtual void SetupForMaterial(const G4ParticleDefinition*,
     178                                const G4Material*,
     179                                G4double kineticEnergy);
     180
    177181protected:
     182
     183  // initialisation of the ParticleChange for the model
     184  G4ParticleChangeForLoss* GetParticleChangeForLoss();
     185
     186  // initialisation of the ParticleChange for the model
     187  G4ParticleChangeForGamma* GetParticleChangeForGamma();
    178188
    179189  // kinematically allowed max kinetic energy of a secondary
    180190  virtual G4double MaxSecondaryEnergy(const G4ParticleDefinition*,
    181191                                      G4double kineticEnergy); 
    182                                          
    183   //------------------------------------------------------------------------
    184   // Methods for msc simulation which needs to be overwritten
    185   //------------------------------------------------------------------------
    186192
    187193public:
    188 
    189   virtual void SampleScattering(const G4DynamicParticle*,
    190                                 G4double safety);
    191 
    192   virtual G4double ComputeTruePathLengthLimit(const G4Track& track,
    193                                               G4PhysicsTable* theLambdaTable,
    194                                               G4double currentMinimalStep);
    195 
    196   virtual G4double ComputeGeomPathLength(G4double truePathLength);
    197 
    198   virtual G4double ComputeTrueStepLength(G4double geomPathLength);
    199 
    200   virtual void DefineForRegion(const G4Region*);
    201 
    202   virtual void SetupForMaterial(const G4ParticleDefinition*,
    203                                 const G4Material*,
    204                                 G4double kineticEnergy);
    205194
    206195  //------------------------------------------------------------------------
     
    212201                                  const G4DataVector&);
    213202
     203  // dEdx per unit length
     204  inline G4double ComputeDEDX(const G4MaterialCutsCouple*,
     205                              const G4ParticleDefinition*,
     206                              G4double kineticEnergy,
     207                              G4double cutEnergy = DBL_MAX);
     208
     209  // cross section per volume
     210  inline G4double CrossSection(const G4MaterialCutsCouple*,
     211                                const G4ParticleDefinition*,
     212                                G4double kineticEnergy,
     213                                G4double cutEnergy = 0.0,
     214                                G4double maxEnergy = DBL_MAX);
     215
    214216  // compute mean free path via cross section per volume
    215   G4double ComputeMeanFreePath(const G4ParticleDefinition*,
    216                                G4double kineticEnergy,
    217                                const G4Material*,   
    218                                G4double cutEnergy = 0.0,
    219                                G4double maxEnergy = DBL_MAX);
     217  inline G4double ComputeMeanFreePath(const G4ParticleDefinition*,
     218                                      G4double kineticEnergy,
     219                                      const G4Material*,   
     220                                      G4double cutEnergy = 0.0,
     221                                      G4double maxEnergy = DBL_MAX);
    220222
    221223  // generic cross section per element
     
    233235                                           G4double maxEnergy = DBL_MAX);
    234236
    235   // this method can be used only in the case if generic method to compute
    236   // cross section per volume is used and not overwritten in derived class
     237  // to select atom cross section per volume is recomputed for each element
    237238  inline const G4Element* SelectRandomAtom(const G4Material*,
    238239                                           const G4ParticleDefinition*,
     
    260261  inline G4bool LPMFlag() const;
    261262
     263  inline G4bool DeexcitationFlag() const;
     264
    262265  inline void SetHighEnergyLimit(G4double);
    263266
     
    270273  inline void SetLPMFlag(G4bool val);
    271274
     275  inline void SetDeexcitationFlag(G4bool val);
     276
    272277  inline void ActivateNuclearStopping(G4bool);
    273278
     
    278283  inline void SetParticleChange(G4VParticleChange*, G4VEmFluctuationModel*);
    279284
     285  inline void SetCurrentCouple(const G4MaterialCutsCouple*);
     286
    280287protected:
    281288
     289  inline const G4MaterialCutsCouple* CurrentCouple() const;
     290
     291  inline void SetCurrentElement(const G4Element*);
     292
    282293  inline const G4Element* GetCurrentElement() const;
    283 
    284   inline void SetCurrentElement(const G4Element*);
    285294
    286295private:
     
    315324private:
    316325
    317   const G4Element* currentElement;
     326  const G4MaterialCutsCouple* currentCouple;
     327  const G4Element*            currentElement;
     328
    318329  G4int                  nsec;
     330  G4bool                 flagDeexcitation;
    319331  std::vector<G4double>  xsec;
    320332
     
    324336//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    325337
    326 inline G4double G4VEmModel::HighEnergyLimit() const
    327 {
    328   return highLimit;
    329 }
    330 
    331 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    332 
    333 inline G4double G4VEmModel::LowEnergyLimit() const
    334 {
    335   return lowLimit;
    336 }
    337 
    338 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    339 
    340 inline G4double G4VEmModel::PolarAngleLimit() const
    341 {
    342   return polarAngleLimit;
    343 }
    344 
    345 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    346 
    347 inline G4double G4VEmModel::SecondaryThreshold() const
    348 {
    349   return secondaryThreshold;
    350 }
    351 
    352 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    353 
    354 inline G4bool G4VEmModel::LPMFlag() const
    355 {
    356   return theLPMflag;
    357 }
    358 
    359 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    360 
    361 inline void G4VEmModel::SetHighEnergyLimit(G4double val)
    362 {
    363   highLimit = val;
    364 }
    365 
    366 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    367 
    368 inline void G4VEmModel::SetLowEnergyLimit(G4double val)
    369 {
    370   lowLimit = val;
    371 }
    372 
    373 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    374 
    375 inline void G4VEmModel::SetPolarAngleLimit(G4double val)
    376 {
    377   polarAngleLimit = val;
    378 }
    379 
    380 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    381 
    382 inline void G4VEmModel::SetSecondaryThreshold(G4double val)
    383 {
    384   secondaryThreshold = val;
    385 }
    386 
    387 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    388 
    389 inline void G4VEmModel::SetLPMFlag(G4bool val)
    390 {
    391   theLPMflag = val;
    392 }
    393 
    394 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    395 
    396 inline void G4VEmModel::ActivateNuclearStopping(G4bool val)
    397 {
    398   nuclearStopping = val;
     338inline G4double G4VEmModel::ComputeDEDX(const G4MaterialCutsCouple* c,
     339                                        const G4ParticleDefinition* p,
     340                                        G4double kinEnergy,
     341                                        G4double cutEnergy)
     342{
     343  currentCouple = c;
     344  return ComputeDEDXPerVolume(c->GetMaterial(),p,kinEnergy,cutEnergy);
     345}
     346
     347//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     348
     349inline G4double G4VEmModel::CrossSection(const G4MaterialCutsCouple* c,
     350                                         const G4ParticleDefinition* p,
     351                                         G4double kinEnergy,
     352                                         G4double cutEnergy,
     353                                         G4double maxEnergy)
     354{
     355  currentCouple = c;
     356  return CrossSectionPerVolume(c->GetMaterial(),p,kinEnergy,cutEnergy,maxEnergy);
     357}
     358
     359//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     360
     361inline G4double G4VEmModel::ComputeMeanFreePath(const G4ParticleDefinition* p,
     362                                                G4double ekin,
     363                                                const G4Material* material,     
     364                                                G4double emin,
     365                                                G4double emax)
     366{
     367  G4double mfp = DBL_MAX;
     368  G4double cross = CrossSectionPerVolume(material,p,ekin,emin,emax);
     369  if (cross > DBL_MIN) mfp = 1./cross;
     370  return mfp;
    399371}
    400372
     
    415387//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    416388
    417 inline void G4VEmModel::SetParticleChange(G4VParticleChange* p, 
    418                                           G4VEmFluctuationModel* f = 0)
    419 {
    420   if(p && pParticleChange != p) pParticleChange = p;
    421   fluc = f;
    422 }
    423 
    424 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    425 
    426 
    427 inline G4VEmFluctuationModel* G4VEmModel::GetModelOfFluctuations()
    428 {
    429   return fluc;
    430 }
    431 
    432 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    433 
    434 inline G4double G4VEmModel::MinEnergyCut(const G4ParticleDefinition*,
    435                                          const G4MaterialCutsCouple*)
    436 {
    437   return 0.0;
    438 }
    439 
    440 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    441 
    442 inline G4double G4VEmModel::GetChargeSquareRatio(const G4ParticleDefinition* p,
    443                                                  const G4Material*, G4double)
    444 {
    445   G4double q = p->GetPDGCharge()/CLHEP::eplus;
    446   return q*q;
    447 }
    448 
    449 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    450 
    451 inline G4double G4VEmModel::GetParticleCharge(const G4ParticleDefinition* p,
    452                                               const G4Material*, G4double)
    453 {
    454   return p->GetPDGCharge();
    455 }
    456 
    457 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    458 
    459 inline void G4VEmModel::CorrectionsAlongStep(const G4MaterialCutsCouple*,
    460                                              const G4DynamicParticle*,
    461                                              G4double&,G4double&,G4double)
    462 {}
    463 
    464 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    465 
    466 inline G4double G4VEmModel::ComputeDEDXPerVolume(const G4Material*,
    467                                                  const G4ParticleDefinition*,
    468                                                  G4double,G4double)
    469 {
    470   return 0.0;
    471 }
    472 
    473 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    474 
    475 inline G4double G4VEmModel::ComputeDEDX(const G4MaterialCutsCouple* c,
    476                                         const G4ParticleDefinition* p,
    477                                         G4double kinEnergy,
    478                                         G4double cutEnergy)
    479 {
    480   return ComputeDEDXPerVolume(c->GetMaterial(),p,kinEnergy,cutEnergy);
    481 }
    482 
    483 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    484 
    485 inline G4double G4VEmModel::CrossSection(const G4MaterialCutsCouple* c,
    486                                          const G4ParticleDefinition* p,
    487                                          G4double kinEnergy,
    488                                          G4double cutEnergy,
    489                                          G4double maxEnergy)
    490 {
    491   return CrossSectionPerVolume(c->GetMaterial(),p,
    492                                kinEnergy,cutEnergy,maxEnergy);
    493 }
    494 
    495 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    496 
    497 inline G4double G4VEmModel::ComputeCrossSectionPerAtom(
    498                                          const G4ParticleDefinition*,
    499                                          G4double, G4double, G4double,
    500                                          G4double, G4double)
    501 {
    502   return 0.0;
    503 }
    504 
    505 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    506 
    507389inline
    508390const G4Element* G4VEmModel::SelectRandomAtom(const G4MaterialCutsCouple* couple,
     
    512394                                              G4double maxEnergy)
    513395{
     396  currentCouple = couple;
    514397  if(nSelectors > 0) {
    515398    currentElement =
     
    571454//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    572455
    573 inline const G4Element* G4VEmModel::GetCurrentElement() const
    574 {
    575   return currentElement;
    576 }
    577 
    578 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    579 
    580 inline void G4VEmModel::SetCurrentElement(const G4Element* elm)
    581 {
    582   currentElement = elm;
     456inline G4VEmFluctuationModel* G4VEmModel::GetModelOfFluctuations()
     457{
     458  return fluc;
     459}
     460
     461//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     462
     463inline G4double G4VEmModel::HighEnergyLimit() const
     464{
     465  return highLimit;
     466}
     467
     468//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     469
     470inline G4double G4VEmModel::LowEnergyLimit() const
     471{
     472  return lowLimit;
     473}
     474
     475//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     476
     477inline G4double G4VEmModel::PolarAngleLimit() const
     478{
     479  return polarAngleLimit;
     480}
     481
     482//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     483
     484inline G4double G4VEmModel::SecondaryThreshold() const
     485{
     486  return secondaryThreshold;
     487}
     488
     489//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     490
     491inline G4bool G4VEmModel::LPMFlag() const
     492{
     493  return theLPMflag;
     494}
     495
     496//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     497
     498inline G4bool G4VEmModel::DeexcitationFlag() const
     499{
     500  return flagDeexcitation;
     501}
     502
     503//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     504
     505inline void G4VEmModel::SetHighEnergyLimit(G4double val)
     506{
     507  highLimit = val;
     508}
     509
     510//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     511
     512inline void G4VEmModel::SetLowEnergyLimit(G4double val)
     513{
     514  lowLimit = val;
     515}
     516
     517//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     518
     519inline void G4VEmModel::SetPolarAngleLimit(G4double val)
     520{
     521  polarAngleLimit = val;
     522}
     523
     524//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     525
     526inline void G4VEmModel::SetSecondaryThreshold(G4double val)
     527{
     528  secondaryThreshold = val;
     529}
     530
     531//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     532
     533inline void G4VEmModel::SetLPMFlag(G4bool val)
     534{
     535  theLPMflag = val;
     536}
     537
     538//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     539
     540inline void G4VEmModel::SetDeexcitationFlag(G4bool val)
     541{
     542  flagDeexcitation = val;
     543}
     544
     545//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     546
     547inline void G4VEmModel::ActivateNuclearStopping(G4bool val)
     548{
     549  nuclearStopping = val;
    583550}
    584551
     
    594561//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    595562
    596 inline G4double G4VEmModel::MaxSecondaryEnergy(const G4ParticleDefinition*,
    597                                                G4double kineticEnergy)
    598 {
    599   return kineticEnergy;
    600 }
    601 
    602 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    603 
    604563inline const G4String& G4VEmModel::GetName() const
    605564{
     
    608567
    609568//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    610 // Methods for msc simulation
    611 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    612 
    613 inline void G4VEmModel::SampleScattering(const G4DynamicParticle*, G4double)
    614 {}
    615 
    616 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    617 
    618 inline G4double G4VEmModel::ComputeTruePathLengthLimit(
    619                                 const G4Track&,
    620                                 G4PhysicsTable*,
    621                                 G4double)
    622 {
    623   return DBL_MAX;
    624 }
    625 
    626 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    627 
    628 inline G4double G4VEmModel::ComputeGeomPathLength(G4double truePathLength)
    629 {
    630   return truePathLength;
    631 }
    632 
    633 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    634 
    635 inline G4double G4VEmModel::ComputeTrueStepLength(G4double geomPathLength)
    636 {
    637   return geomPathLength;
    638 }
    639 
    640 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    641 
    642 inline void G4VEmModel::DefineForRegion(const G4Region*)
    643 {}
    644 
    645 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    646 
    647 inline void G4VEmModel::SetupForMaterial(const G4ParticleDefinition*,
    648                                          const G4Material*, G4double)
    649 {}
     569
     570inline void G4VEmModel::SetParticleChange(G4VParticleChange* p, 
     571                                          G4VEmFluctuationModel* f = 0)
     572{
     573  if(p && pParticleChange != p) pParticleChange = p;
     574  fluc = f;
     575}
     576
     577//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     578
     579inline void G4VEmModel::SetCurrentCouple(const G4MaterialCutsCouple* p)
     580{
     581  currentCouple = p;
     582}
     583
     584//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     585
     586inline const G4MaterialCutsCouple* G4VEmModel::CurrentCouple() const
     587{
     588  return currentCouple;
     589}
     590
     591//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     592
     593inline void G4VEmModel::SetCurrentElement(const G4Element* elm)
     594{
     595  currentElement = elm;
     596}
     597
     598//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     599
     600inline const G4Element* G4VEmModel::GetCurrentElement() const
     601{
     602  return currentElement;
     603}
    650604
    651605//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
  • trunk/source/processes/electromagnetic/utils/include/G4VEmProcess.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VEmProcess.hh,v 1.47 2008/07/31 13:01:26 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4VEmProcess.hh,v 1.51 2009/04/07 18:39:47 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    108108
    109109  //------------------------------------------------------------------------
    110   // Methods with standard implementation; may be overwritten if needed
    111   //------------------------------------------------------------------------
    112 
    113   inline G4double RecalculateLambda(G4double kinEnergy,
    114                                     const G4MaterialCutsCouple* couple);
    115 
    116   //------------------------------------------------------------------------
    117   // Generic methods common to all Discrete processes
     110  // Implementation of virtual methods common to all Discrete processes
    118111  //------------------------------------------------------------------------
    119112
    120113public:
    121 
    122   void PrintInfoDefinition();
    123 
    124   G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&);
    125114
    126115  // Initialise for build of tables
     
    129118  // Build physics table during initialisation
    130119  void BuildPhysicsTable(const G4ParticleDefinition&);
     120
     121  void PrintInfoDefinition();
     122
     123  // implementation of virtual method, specific for G4VEmProcess
     124  G4double PostStepGetPhysicalInteractionLength(
     125                             const G4Track& track,
     126                             G4double   previousStepSize,
     127                             G4ForceCondition* condition
     128                            );
     129
     130  // implementation of virtual method, specific for G4VEmProcess
     131  G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&);
    131132
    132133  // Store PhysicsTable in a file.
     
    145146                              G4bool ascii);
    146147
     148  // deexcitation activated per G4Region
     149  void ActivateDeexcitation(G4bool, const G4Region* r = 0);
     150
    147151  //------------------------------------------------------------------------
    148152  // Specific methods for Discrete EM post step simulation
     
    152156  G4double CrossSectionPerVolume(G4double kineticEnergy,
    153157                                 const G4MaterialCutsCouple* couple);
    154 
    155   // implementation of virtual method
    156   virtual G4double PostStepGetPhysicalInteractionLength(
    157                              const G4Track& track,
    158                              G4double   previousStepSize,
    159                              G4ForceCondition* condition
    160                             );
    161158
    162159  // It returns the cross section of the process per atom
     
    167164  inline G4double MeanFreePath(const G4Track& track);
    168165
    169   inline G4VEmModel* SelectModelForMaterial(G4double kinEnergy,
    170                                             size_t& idxRegion) const;
    171 
    172166  // It returns cross section per volume
    173167  inline G4double GetLambda(G4double& kinEnergy,
     
    203197
    204198  //------------------------------------------------------------------------
    205   // Specific methods to set, access, modify models
    206   //------------------------------------------------------------------------
    207 
    208   // Add EM model coupled for the region
    209   inline void AddEmModel(G4int, G4VEmModel*, const G4Region* region = 0);
     199  // Specific methods to set, access, modify models and basic parameters
     200  //------------------------------------------------------------------------
     201
     202protected:
     203  // Select model in run time
     204  inline void SelectModel(G4double& kinEnergy);
     205
     206public:
     207  // Select model by energy and region index
     208  inline G4VEmModel* SelectModelForMaterial(G4double kinEnergy,
     209                                            size_t& idxRegion) const;
    210210   
     211  // Add model for region, smaller value of order defines which
     212  // model will be selected for a given energy interval 
     213  void AddEmModel(G4int, G4VEmModel*, const G4Region* region = 0);
     214
    211215  // Assign a model to a process
    212   inline void SetModel(G4VEmModel*);
     216  void SetModel(G4VEmModel*, G4int index = 1);
    213217 
    214218  // return the assigned model
    215   inline G4VEmModel* Model();
     219  G4VEmModel* Model(G4int index = 1);
    216220   
    217221  // Define new energy range for the model identified by the name
    218   inline void UpdateEmModel(const G4String&, G4double, G4double);
     222  void UpdateEmModel(const G4String&, G4double, G4double);
    219223
    220224  // Access to models
    221   inline G4VEmModel* GetModelByIndex(G4int idx = 0, G4bool ver = false);
    222 
    223   //------------------------------------------------------------------------
    224   // Get/set parameters used for simulation of energy loss
    225   //------------------------------------------------------------------------
    226 
    227   inline void ActivateDeexcitation(G4bool, const G4Region* r = 0);
     225  G4VEmModel* GetModelByIndex(G4int idx = 0, G4bool ver = false);
    228226
    229227  inline void SetLambdaFactor(G4double val);
     
    233231
    234232  inline void SetApplyCuts(G4bool val);
     233
     234  //------------------------------------------------------------------------
     235  // Other generic methods
     236  //------------------------------------------------------------------------
    235237 
    236238protected:
     
    242244  G4PhysicsVector* LambdaPhysicsVector(const G4MaterialCutsCouple*);
    243245
     246  inline G4double RecalculateLambda(G4double kinEnergy,
     247                                    const G4MaterialCutsCouple* couple);
     248
    244249  inline G4ParticleChangeForGamma* GetParticleChange();
    245250
     
    248253  inline void SetSecondaryParticle(const G4ParticleDefinition* p);
    249254
    250   inline G4VEmModel* SelectModel(G4double& kinEnergy);
    251 
    252255  inline size_t CurrentMaterialCutsCoupleIndex() const;
    253256
     
    280283  inline G4double ComputeCurrentLambda(G4double kinEnergy);
    281284
    282   // hide  assignment operator
    283 
     285  // copy constructor and hide assignment operator
    284286  G4VEmProcess(G4VEmProcess &);
    285287  G4VEmProcess & operator=(const G4VEmProcess &right);
     
    297299  // ======== Parameters of the class fixed at initialisation =======
    298300
     301  std::vector<G4VEmModel*>     emModels;
     302
    299303  // tables and vectors
    300304  G4PhysicsTable*              theLambdaTable;
     
    317321  G4bool                       applyCuts;
    318322  G4bool                       startFromNull;
    319 
    320   G4int                        nRegions;
    321   std::vector<G4Region*>       regions;
    322   std::vector<G4bool>          flagsDeexcitation;
     323  G4bool                       useDeexcitation;
     324
     325  G4int                        nDERegions;
     326  std::vector<const G4Region*> deRegions;
     327  G4bool*                      idxDERegions;
    323328
    324329  // ======== Cashed values - may be state dependent ================
     
    332337  std::vector<G4DynamicParticle*> secParticles;
    333338
    334   G4VEmModel*                  selectedModel; 
     339  G4VEmModel*                  currentModel; 
    335340
    336341  const G4ParticleDefinition*  particle;
     
    348353
    349354//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     355//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     356
     357inline G4double G4VEmProcess::ComputeCrossSectionPerAtom(
     358                 G4double kineticEnergy, G4double Z, G4double A, G4double cut)
     359{
     360  SelectModel(kineticEnergy);
     361  G4double x = 0.0;
     362  if(currentModel) {
     363   x = currentModel->ComputeCrossSectionPerAtom(particle,kineticEnergy,
     364                                                 Z,A,cut);
     365  }
     366  return x;
     367}
     368
     369//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     370
     371inline G4double G4VEmProcess::MeanFreePath(const G4Track& track)
     372{
     373  DefineMaterial(track.GetMaterialCutsCouple());
     374  preStepLambda = GetCurrentLambda(track.GetKineticEnergy());
     375  G4double x = DBL_MAX;
     376  if(DBL_MIN < preStepLambda) x = 1.0/preStepLambda;
     377  return x;
     378}
     379
     380//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     381
     382inline G4double G4VEmProcess::GetLambda(G4double& kineticEnergy,
     383                                        const G4MaterialCutsCouple* couple)
     384{
     385  DefineMaterial(couple);
     386  return GetCurrentLambda(kineticEnergy);
     387}
     388
     389//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     390
     391inline void G4VEmProcess::SetLambdaBinning(G4int nbins)
     392{
     393  nLambdaBins = nbins;
     394}
     395
     396//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     397
     398inline G4int G4VEmProcess::LambdaBinning() const
     399{
     400  return nLambdaBins;
     401}
     402
     403//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     404
     405inline void G4VEmProcess::SetMinKinEnergy(G4double e)
     406{
     407  minKinEnergy = e;
     408}
     409
     410//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     411
     412inline G4double G4VEmProcess::MinKinEnergy() const
     413{
     414  return minKinEnergy;
     415}
     416
     417//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     418
     419inline void G4VEmProcess::SetMaxKinEnergy(G4double e)
     420{
     421  maxKinEnergy = e;
     422}
     423
     424//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     425
     426inline G4double G4VEmProcess::MaxKinEnergy() const
     427{
     428  return maxKinEnergy;
     429}
     430
     431//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     432
     433inline void G4VEmProcess::SetPolarAngleLimit(G4double val)
     434{
     435  if(val < 0.0)     polarAngleLimit = 0.0;
     436  else if(val > pi) polarAngleLimit = pi;
     437  else              polarAngleLimit = val;
     438}
     439
     440//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     441
     442inline G4double G4VEmProcess::PolarAngleLimit() const
     443{
     444  return polarAngleLimit;
     445}
     446
     447//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     448
     449inline const G4PhysicsTable* G4VEmProcess::LambdaTable() const
     450{
     451  return theLambdaTable;
     452}
     453
     454//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     455
     456inline const G4ParticleDefinition* G4VEmProcess::Particle() const
     457{
     458  return particle;
     459}
     460
     461//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     462
     463inline const G4ParticleDefinition* G4VEmProcess::SecondaryParticle() const
     464{
     465  return secondaryParticle;
     466}
     467
     468//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     469
     470inline void G4VEmProcess::SelectModel(G4double& kinEnergy)
     471{
     472  currentModel = modelManager->SelectModel(kinEnergy, currentMaterialIndex);
     473  currentModel->SetCurrentCouple(currentCouple);
     474}
     475
     476//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     477
     478inline G4VEmModel* G4VEmProcess::SelectModelForMaterial(
     479                                   G4double kinEnergy, size_t& idxRegion) const
     480{
     481  return modelManager->SelectModel(kinEnergy, idxRegion);
     482}
     483
     484//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     485
     486inline void G4VEmProcess::SetLambdaFactor(G4double val)
     487{
     488  if(val > 0.0 && val <= 1.0) lambdaFactor = val;
     489}
     490
     491//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     492
     493inline void G4VEmProcess::SetIntegral(G4bool val)
     494{
     495  if(particle && particle != theGamma) integral = val;
     496  if(integral) buildLambdaTable = true;
     497}
     498
     499//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     500
     501inline G4bool G4VEmProcess::IsIntegral() const
     502{
     503  return integral;
     504}
     505
     506//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     507
     508inline void G4VEmProcess::SetApplyCuts(G4bool val)
     509{
     510  applyCuts = val;
     511}
     512
     513//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     514
     515inline G4double G4VEmProcess::RecalculateLambda(G4double e,
     516                                                const G4MaterialCutsCouple* couple)
     517{
     518  DefineMaterial(couple);
     519  return ComputeCurrentLambda(e);
     520}
     521
     522//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     523
     524inline G4ParticleChangeForGamma* G4VEmProcess::GetParticleChange()
     525{
     526  return &fParticleChange;
     527}
     528
     529//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     530
     531inline void G4VEmProcess::SetParticle(const G4ParticleDefinition* p)
     532{
     533  particle = p;
     534}
     535
     536//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     537
     538inline void G4VEmProcess::SetSecondaryParticle(const G4ParticleDefinition* p)
     539{
     540  secondaryParticle = p;
     541}
     542
     543//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     544
     545inline size_t G4VEmProcess::CurrentMaterialCutsCoupleIndex() const
     546{
     547  return currentMaterialIndex;
     548}
     549
     550//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     551
     552inline G4double G4VEmProcess::GetGammaEnergyCut()
     553{
     554  return (*theCutsGamma)[currentMaterialIndex];
     555}
     556
     557//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     558
     559inline G4double G4VEmProcess::GetElectronEnergyCut()
     560{
     561  return (*theCutsElectron)[currentMaterialIndex];
     562}
     563
     564//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     565
     566inline void G4VEmProcess::SetBuildTableFlag(G4bool val)
     567{
     568  buildLambdaTable = val;
     569  if(!val) integral = false;
     570}
     571
     572//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     573
     574inline void G4VEmProcess::SetStartFromNullFlag(G4bool val)
     575{
     576  startFromNull = val;
     577}
     578
     579//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     580
     581inline void G4VEmProcess::InitialiseStep(const G4Track& track)
     582{
     583  preStepKinEnergy = track.GetKineticEnergy();
     584  DefineMaterial(track.GetMaterialCutsCouple());
     585  if (theNumberOfInteractionLengthLeft < 0.0) mfpKinEnergy = DBL_MAX;
     586}
     587
    350588//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    351589
     
    358596    mfpKinEnergy = DBL_MAX;
    359597  }
    360 }
    361 
    362 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    363 
    364 inline void G4VEmProcess::InitialiseStep(const G4Track& track)
    365 {
    366   preStepKinEnergy = track.GetKineticEnergy();
    367   DefineMaterial(track.GetMaterialCutsCouple());
    368   if (theNumberOfInteractionLengthLeft < 0.0) mfpKinEnergy = DBL_MAX;
    369 }
    370 
    371 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    372 
    373 inline G4double G4VEmProcess::GetLambda(G4double& kineticEnergy,
    374                                         const G4MaterialCutsCouple* couple)
    375 {
    376   DefineMaterial(couple);
    377   return GetCurrentLambda(kineticEnergy);
    378 }
    379 
    380 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    381 
    382 inline G4double G4VEmProcess::GetCurrentLambda(G4double e)
    383 {
    384   G4double x = 0.0;
    385   if(theLambdaTable) x = GetLambdaFromTable(e);
    386   else               x = ComputeCurrentLambda(e);
    387   return x;
    388 }
    389 
    390 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    391 
    392 inline G4double G4VEmProcess::RecalculateLambda(G4double e,
    393                                                 const G4MaterialCutsCouple* couple)
    394 {
    395   DefineMaterial(couple);
    396   return ComputeCurrentLambda(e);
    397 }
    398 
    399 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    400 
    401 inline G4double G4VEmProcess::ComputeCurrentLambda(G4double e)
    402 {
    403   G4VEmModel* currentModel = SelectModel(e);
    404   G4double x = 0.0;
    405   if(currentModel)
    406     x = currentModel->CrossSectionPerVolume(currentMaterial,particle,
    407                                             e,(*theCuts)[currentMaterialIndex]);
    408   return x;
    409 }
    410 
    411 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    412 
    413 inline G4double G4VEmProcess::GetLambdaFromTable(G4double e)
    414 {
    415   G4bool b;
    416   return (((*theLambdaTable)[currentMaterialIndex])->GetValue(e, b));
    417598}
    418599
     
    442623//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    443624
    444 inline G4double G4VEmProcess::MeanFreePath(const G4Track& track)
    445 {
    446   DefineMaterial(track.GetMaterialCutsCouple());
    447   preStepLambda = GetCurrentLambda(track.GetKineticEnergy());
    448   G4double x = DBL_MAX;
    449   if(DBL_MIN < preStepLambda) x = 1.0/preStepLambda;
     625inline G4double G4VEmProcess::GetLambdaFromTable(G4double e)
     626{
     627  G4bool b;
     628  return (((*theLambdaTable)[currentMaterialIndex])->GetValue(e, b));
     629}
     630
     631//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     632
     633inline G4double G4VEmProcess::GetCurrentLambda(G4double e)
     634{
     635  G4double x = 0.0;
     636  if(theLambdaTable) x = GetLambdaFromTable(e);
     637  else               x = ComputeCurrentLambda(e);
    450638  return x;
    451639}
     
    453641//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    454642
    455 inline G4VEmModel* G4VEmProcess::SelectModel(G4double& kinEnergy)
    456 {
    457   return modelManager->SelectModel(kinEnergy, currentMaterialIndex);
    458 }
    459 
    460 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    461 
    462 inline G4VEmModel* G4VEmProcess::SelectModelForMaterial(
    463                                    G4double kinEnergy, size_t& idxRegion) const
    464 {
    465   return modelManager->SelectModel(kinEnergy, idxRegion);
    466 }
    467 
    468 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    469 
    470 inline const G4ParticleDefinition* G4VEmProcess::Particle() const
    471 {
    472   return particle;
    473 }
    474 
    475 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    476 
    477 inline const G4ParticleDefinition* G4VEmProcess::SecondaryParticle() const
    478 {
    479   return secondaryParticle;
    480 }
    481 
    482 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    483 
    484 inline G4double G4VEmProcess::GetGammaEnergyCut()
    485 {
    486   return (*theCutsGamma)[currentMaterialIndex];
    487 }
    488 
    489 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    490 
    491 inline G4double G4VEmProcess::GetElectronEnergyCut()
    492 {
    493   return (*theCutsElectron)[currentMaterialIndex];
    494 }
    495 
    496 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    497 
    498 inline void G4VEmProcess::SetLambdaFactor(G4double val)
    499 {
    500   if(val > 0.0 && val <= 1.0) lambdaFactor = val;
    501 }
    502 
    503 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    504 
    505 inline G4VEmModel* G4VEmProcess::GetModelByIndex(G4int idx, G4bool ver)
    506 {
    507   return modelManager->GetModel(idx, ver);
    508 }
    509 
    510 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    511 
    512 inline G4ParticleChangeForGamma* G4VEmProcess::GetParticleChange()
    513 {
    514   return &fParticleChange;
    515 }
    516 
    517 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    518 
    519 inline void G4VEmProcess::SetParticle(const G4ParticleDefinition* p)
    520 {
    521   particle = p;
    522 }
    523 
    524 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    525 
    526 inline void G4VEmProcess::SetSecondaryParticle(const G4ParticleDefinition* p)
    527 {
    528   secondaryParticle = p;
    529 }
    530 
    531 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    532 
    533 inline void G4VEmProcess::AddEmModel(G4int order, G4VEmModel* p,
    534                                      const G4Region* region)
    535 {
    536   G4VEmFluctuationModel* fm = 0;
    537   modelManager->AddEmModel(order, p, fm, region);
    538   if(p) p->SetParticleChange(pParticleChange);
    539 }
    540 
    541 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    542 
    543 inline void G4VEmProcess::SetModel(G4VEmModel* model)
    544 {
    545   selectedModel = model;
    546 }
    547 
    548 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    549 
    550 inline G4VEmModel* G4VEmProcess::Model()
    551 {
    552   return selectedModel;
    553 }
    554 
    555 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    556 
    557 inline void G4VEmProcess::UpdateEmModel(const G4String& nam,
    558                                         G4double emin, G4double emax)
    559 {
    560   modelManager->UpdateEmModel(nam, emin, emax);
    561 }
    562 
    563 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    564 
    565 inline G4double G4VEmProcess::ComputeCrossSectionPerAtom(
    566                  G4double kineticEnergy, G4double Z, G4double A, G4double cut)
    567 {
    568   G4VEmModel* model = SelectModel(kineticEnergy);
    569   return model->ComputeCrossSectionPerAtom(particle,kineticEnergy,Z,A,cut);
    570 }
    571 
    572 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    573 
    574 inline void G4VEmProcess::SetLambdaBinning(G4int nbins)
    575 {
    576   nLambdaBins = nbins;
    577 }
    578 
    579 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    580 
    581 inline G4int G4VEmProcess::LambdaBinning() const
    582 {
    583   return nLambdaBins;
    584 }
    585 
    586 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    587 
    588 inline void G4VEmProcess::SetMinKinEnergy(G4double e)
    589 {
    590   minKinEnergy = e;
    591 }
    592 
    593 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    594 
    595 inline G4double G4VEmProcess::MinKinEnergy() const
    596 {
    597   return minKinEnergy;
    598 }
    599 
    600 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    601 
    602 inline void G4VEmProcess::SetMaxKinEnergy(G4double e)
    603 {
    604   maxKinEnergy = e;
    605 }
    606 
    607 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    608 
    609 inline G4double G4VEmProcess::MaxKinEnergy() const
    610 {
    611   return maxKinEnergy;
    612 }
    613 
    614 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    615 
    616 inline void G4VEmProcess::SetPolarAngleLimit(G4double val)
    617 {
    618   if(val < 0.0)     polarAngleLimit = 0.0;
    619   else if(val > pi) polarAngleLimit = pi;
    620   else              polarAngleLimit = val;
    621 }
    622 
    623 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    624 
    625 inline G4double G4VEmProcess::PolarAngleLimit() const
    626 {
    627   return polarAngleLimit;
    628 }
    629 
    630 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    631 
    632 inline void G4VEmProcess::ActivateDeexcitation(G4bool, const G4Region*)
    633 {}
    634 
    635 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    636 
    637 inline const G4PhysicsTable* G4VEmProcess::LambdaTable() const
    638 {
    639   return theLambdaTable;
    640 }
    641 
    642 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    643 
    644 inline void G4VEmProcess::SetIntegral(G4bool val)
    645 {
    646   if(particle && particle != theGamma) integral = val;
    647   if(integral) buildLambdaTable = true;
    648 }
    649 
    650 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    651 
    652 inline G4bool G4VEmProcess::IsIntegral() const
    653 {
    654   return integral;
    655 }
    656 
    657 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    658 
    659 inline void G4VEmProcess::SetBuildTableFlag(G4bool val)
    660 {
    661   buildLambdaTable = val;
    662   if(!val) integral = false;
    663 }
    664 
    665 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    666 
    667 inline void G4VEmProcess::SetStartFromNullFlag(G4bool val)
    668 {
    669   startFromNull = val;
    670 }
    671 
    672 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    673 
    674 inline void G4VEmProcess::SetApplyCuts(G4bool val)
    675 {
    676   applyCuts = val;
    677 }
    678 
    679 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    680 
    681 inline size_t G4VEmProcess::CurrentMaterialCutsCoupleIndex() const
    682 {
    683   return currentMaterialIndex;
     643inline G4double G4VEmProcess::ComputeCurrentLambda(G4double e)
     644{
     645  SelectModel(e);
     646  G4double x = 0.0;
     647  if(currentModel) {
     648    x = currentModel->CrossSectionPerVolume(currentMaterial,particle,
     649                                            e,(*theCuts)[currentMaterialIndex]);
     650  }
     651  return x;
    684652}
    685653
  • trunk/source/processes/electromagnetic/utils/include/G4VEnergyLossProcess.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VEnergyLossProcess.hh,v 1.83 2008/09/12 16:19:01 vnivanch Exp $
     26// $Id: G4VEnergyLossProcess.hh,v 1.87 2009/04/07 18:39:47 vnivanch Exp $
    2727// GEANT4 tag $Name:
    2828//
     
    126126  virtual ~G4VEnergyLossProcess();
    127127
     128private:
     129  // clean vectors and arrays
     130  void Clean();
     131
    128132  //------------------------------------------------------------------------
    129133  // Virtual methods to be implemented in concrete processes
    130134  //------------------------------------------------------------------------
    131135
     136public:
    132137  virtual G4bool IsApplicable(const G4ParticleDefinition& p) = 0;
    133138 
     
    143148  //------------------------------------------------------------------------
    144149
    145 protected:
    146 
    147150  virtual G4double MinPrimaryEnergy(const G4ParticleDefinition*,
    148151                                    const G4Material*, G4double cut);
    149152
    150153  //------------------------------------------------------------------------
    151   // Virtual methods common to all EM ContinuousDiscrete processes
    152   // Further inheritance is not assumed
     154  // Virtual methods implementation common to all EM ContinuousDiscrete
     155  // processes. Further inheritance is not assumed
    153156  //------------------------------------------------------------------------
    154157
    155158public:
    156159
     160  // prepare all tables
     161  void PreparePhysicsTable(const G4ParticleDefinition&);
     162
     163  // build all tables
     164  void BuildPhysicsTable(const G4ParticleDefinition&);
     165
     166  // build a table
     167  G4PhysicsTable* BuildDEDXTable(G4EmTableType tType = fRestricted);
     168
     169  // build a table
     170  G4PhysicsTable* BuildLambdaTable(G4EmTableType tType = fRestricted);
     171
     172  // summary printout after initialisation
    157173  void PrintInfoDefinition();
    158174
    159   void PreparePhysicsTable(const G4ParticleDefinition&);
    160 
    161   void BuildPhysicsTable(const G4ParticleDefinition&);
    162 
     175  // Add subcutoff option for the region
     176  void ActivateSubCutoff(G4bool val, const G4Region* region = 0);
     177
     178  // Activate deexcitation code for region
     179  void ActivateDeexcitation(G4bool, const G4Region* region = 0);
     180
     181  // Step limit from AlongStep
    163182  G4double AlongStepGetPhysicalInteractionLength(const G4Track&,
    164183                                                 G4double  previousStepSize,
     
    167186                                                 G4GPILSelection* selection);
    168187
     188  // Step limit from cross section
    169189  G4double PostStepGetPhysicalInteractionLength(const G4Track& track,
    170190                                                G4double   previousStepSize,
    171191                                                G4ForceCondition* condition);
    172192
     193  // AlongStep computations
    173194  G4VParticleChange* AlongStepDoIt(const G4Track&, const G4Step&);
    174195
     196  // Sampling of secondaries in vicinity of geometrical boundary
     197  void SampleSubCutSecondaries(std::vector<G4Track*>&, const G4Step&,
     198                               G4VEmModel* model, G4int matIdx,
     199                               G4double& extraEdep);
     200
     201  // PostStep sampling of secondaries
    175202  G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&);
    176203
    177   // Store PhysicsTable in a file.
    178   // Return false in case of failure at I/O
     204  // Store all PhysicsTable in files.
     205  // Return false in case of any fatal failure at I/O 
    179206  G4bool StorePhysicsTable(const G4ParticleDefinition*,
    180207                           const G4String& directory,
    181208                           G4bool ascii = false);
    182209
    183   // Retrieve Physics from a file.
    184   // (return true if the Physics Table can be build by using file)
    185   // (return false if the process has no functionality or in case of failure)
    186   // File name should is constructed as processName+particleName and the
    187   // should be placed under the directory specifed by the argument.
     210  // Retrieve all Physics from a files.
     211  // Return true if all the Physics Table are built.
     212  // Return false if any fatal failure.
    188213  G4bool RetrievePhysicsTable(const G4ParticleDefinition*,
    189214                              const G4String& directory,
    190215                              G4bool ascii);
    191216
     217private:
     218  // store a table
     219  G4bool StoreTable(const G4ParticleDefinition* p,
     220                    G4PhysicsTable*, G4bool ascii,
     221                    const G4String& directory,
     222                    const G4String& tname);
     223
     224  // retrieve a table
     225  G4bool RetrieveTable(const G4ParticleDefinition* p,
     226                       G4PhysicsTable*, G4bool ascii,
     227                       const G4String& directory,
     228                       const G4String& tname,
     229                       G4bool mandatory);
     230
     231  //------------------------------------------------------------------------
     232  // Public interface to cross section, mfp and sampling of fluctuations
     233  // These methods are not used in run time
     234  //------------------------------------------------------------------------
     235
     236public:
     237  // access to dispersion of restricted energy loss
     238  G4double GetDEDXDispersion(const G4MaterialCutsCouple *couple,
     239                             const G4DynamicParticle* dp,
     240                             G4double length);
     241
     242  // Access to cross section table
     243  G4double CrossSectionPerVolume(G4double kineticEnergy,
     244                                 const G4MaterialCutsCouple* couple);
     245
     246  // access to cross section
     247  G4double MeanFreePath(const G4Track& track);
     248
     249  // access to step limit
     250  G4double ContinuousStepLimit(const G4Track& track,
     251                               G4double previousStepSize,
     252                               G4double currentMinimumStep,
     253                               G4double& currentSafety);
     254
    192255protected:
    193256
     257  // implementation of the pure virtual method
    194258  G4double GetMeanFreePath(const G4Track& track,
    195259                           G4double previousStepSize,
    196260                           G4ForceCondition* condition);
    197261
     262  // implementation of the pure virtual method
    198263  G4double GetContinuousStepLimit(const G4Track& track,
    199264                                  G4double previousStepSize,
     
    202267
    203268  //------------------------------------------------------------------------
    204   // Specific methods for along/post step EM processes
    205   //------------------------------------------------------------------------
     269  // Run time method which may be also used by derived processes
     270  //------------------------------------------------------------------------
     271
     272  // creeation of an empty vector for cross section
     273  G4PhysicsVector* LambdaPhysicsVector(const G4MaterialCutsCouple*,
     274                                       G4double cut);
     275
     276  inline size_t CurrentMaterialCutsCoupleIndex() const;
     277
     278  inline G4double GetCurrentRange() const;
     279
     280  //------------------------------------------------------------------------
     281  // Specific methods to set, access, modify models
     282  //------------------------------------------------------------------------
     283
     284  // Select model in run time
     285  inline void SelectModel(G4double kinEnergy);
    206286
    207287public:
    208 
     288  // Select model by energy and region index
     289  inline G4VEmModel* SelectModelForMaterial(G4double kinEnergy,
     290                                            size_t& idx) const;
     291
     292  // Add EM model coupled with fluctuation model for region, smaller value
     293  // of order defines which pair of models will be selected for a given
     294  // energy interval 
     295  void AddEmModel(G4int, G4VEmModel*,
     296                  G4VEmFluctuationModel* fluc = 0,
     297                  const G4Region* region = 0);
     298
     299  // Define new energy range for the model identified by the name
     300  void UpdateEmModel(const G4String&, G4double, G4double);
     301
     302  // Assign a model to a process
     303  void SetEmModel(G4VEmModel*, G4int index=1);
     304 
     305  // return the assigned model
     306  G4VEmModel* EmModel(G4int index=1);
     307 
     308  // Access to models
     309  G4VEmModel* GetModelByIndex(G4int idx = 0, G4bool ver = false);
     310
     311  G4int NumberOfModels();
     312
     313  // Assign a fluctuation model to a process
     314  void SetFluctModel(G4VEmFluctuationModel*);
     315 
     316  // return the assigned fluctuation model
     317  inline G4VEmFluctuationModel* FluctModel();
     318   
     319  //------------------------------------------------------------------------
     320  // Define and access particle type
     321  //------------------------------------------------------------------------
     322
     323protected:
     324  inline void SetParticle(const G4ParticleDefinition* p);
     325  inline void SetSecondaryParticle(const G4ParticleDefinition* p);
     326
     327public:
     328  inline void SetBaseParticle(const G4ParticleDefinition* p);
     329  inline const G4ParticleDefinition* Particle() const;
     330  inline const G4ParticleDefinition* BaseParticle() const;
     331  inline const G4ParticleDefinition* SecondaryParticle() const;
     332
     333  //------------------------------------------------------------------------
     334  // Get/set parameters to configure the process at initialisation time
     335  //------------------------------------------------------------------------
     336
     337  // Add subcutoff process (bremsstrahlung) to sample secondary
     338  // particle production in vicinity of the geometry boundary
    209339  void AddCollaborativeProcess(G4VEnergyLossProcess*);
    210340
    211   void SampleSubCutSecondaries(std::vector<G4Track*>&, const G4Step&,
    212                                G4VEmModel* model, G4int matIdx,
    213                                G4double& extraEdep);
    214 
    215   G4double GetDEDXDispersion(const G4MaterialCutsCouple *couple,
    216                              const G4DynamicParticle* dp,
    217                              G4double length);
    218 
    219   //------------------------------------------------------------------------
    220   // Specific methods to build and access Physics Tables
    221   //------------------------------------------------------------------------
    222 
    223   G4PhysicsTable* BuildDEDXTable(G4EmTableType tType = fRestricted);
    224 
    225   G4PhysicsTable* BuildLambdaTable(G4EmTableType tType = fRestricted);
     341  inline void SetLossFluctuations(G4bool val);
     342  inline void SetRandomStep(G4bool val);
     343
     344  inline void SetIntegral(G4bool val);
     345  inline G4bool IsIntegral() const;
     346
     347  // Set/Get flag "isIonisation"
     348  inline void SetIonisation(G4bool val);
     349  inline G4bool IsIonisationProcess() const;
     350
     351  // Redefine parameteters for stepping control
     352  //
     353  inline void SetLinearLossLimit(G4double val);
     354  inline void SetMinSubRange(G4double val);
     355  inline void SetLambdaFactor(G4double val);
     356  inline void SetStepFunction(G4double v1, G4double v2);
     357
     358  inline G4int NumberOfSubCutoffRegions() const;
     359  inline G4int NumberOfDERegions() const;
     360
     361  //------------------------------------------------------------------------
     362  // Specific methods to path Physics Tables to the process
     363  //------------------------------------------------------------------------
    226364
    227365  void SetDEDXTable(G4PhysicsTable* p, G4EmTableType tType);
    228366  void SetCSDARangeTable(G4PhysicsTable* pRange);
    229367  void SetRangeTableForLoss(G4PhysicsTable* p);
     368  void SetSecondaryRangeTable(G4PhysicsTable* p);
    230369  void SetInverseRangeTable(G4PhysicsTable* p);
    231   void SetSecondaryRangeTable(G4PhysicsTable* p);
    232370
    233371  void SetLambdaTable(G4PhysicsTable* p);
     
    251389  // Max kinetic energy for tables
    252390  inline void SetMaxKinEnergyForCSDARange(G4double e);
     391
     392  // Return values for given G4MaterialCutsCouple
     393  inline G4double GetDEDX(G4double& kineticEnergy, const G4MaterialCutsCouple*);
     394  inline G4double GetDEDXForSubsec(G4double& kineticEnergy,
     395                                   const G4MaterialCutsCouple*);
     396  inline G4double GetRange(G4double& kineticEnergy, const G4MaterialCutsCouple*);
     397  inline G4double GetCSDARange(G4double& kineticEnergy, const G4MaterialCutsCouple*);
     398  inline G4double GetRangeForLoss(G4double& kineticEnergy, const G4MaterialCutsCouple*);
     399  inline G4double GetKineticEnergy(G4double& range, const G4MaterialCutsCouple*);
     400  inline G4double GetLambda(G4double& kineticEnergy, const G4MaterialCutsCouple*);
     401
     402  inline G4bool TablesAreBuilt() const;
    253403
    254404  // Access to specific tables
     
    264414  inline G4PhysicsTable* SubLambdaTable();
    265415
    266   // Return values for given G4MaterialCutsCouple
    267   inline G4double GetDEDX(G4double& kineticEnergy, const G4MaterialCutsCouple*);
    268   inline G4double GetDEDXForSubsec(G4double& kineticEnergy,
    269                                    const G4MaterialCutsCouple*);
    270   inline G4double GetRange(G4double& kineticEnergy, const G4MaterialCutsCouple*);
    271   inline G4double GetCSDARange(G4double& kineticEnergy, const G4MaterialCutsCouple*);
    272   inline G4double GetRangeForLoss(G4double& kineticEnergy, const G4MaterialCutsCouple*);
    273   inline G4double GetKineticEnergy(G4double& range, const G4MaterialCutsCouple*);
    274   inline G4double GetLambda(G4double& kineticEnergy, const G4MaterialCutsCouple*);
    275 
    276   inline G4bool TablesAreBuilt() const;
    277 
    278   //------------------------------------------------------------------------
    279   // Define and access particle type
    280   //------------------------------------------------------------------------
    281 
    282   inline void SetBaseParticle(const G4ParticleDefinition* p);
    283   inline const G4ParticleDefinition* Particle() const;
    284   inline const G4ParticleDefinition* BaseParticle() const;
    285   inline const G4ParticleDefinition* SecondaryParticle() const;
    286 
    287   //------------------------------------------------------------------------
    288   // Specific methods to set, access, modify models
    289   //------------------------------------------------------------------------
    290 
    291   // Add EM model coupled with fluctuation model for the region
    292   inline void AddEmModel(G4int, G4VEmModel*,
    293                          G4VEmFluctuationModel* fluc = 0,
    294                          const G4Region* region = 0);
    295 
    296   // Assign a model to a process
    297   inline void SetEmModel(G4VEmModel*, G4int index=1);
    298  
    299   // return the assigned model
    300   inline G4VEmModel* EmModel(G4int index=1);
    301  
    302   // Assign a fluctuation model to a process
    303   inline void SetFluctModel(G4VEmFluctuationModel*);
    304  
    305   // return the assigned fluctuation model
    306   inline G4VEmFluctuationModel* FluctModel();
    307    
    308   // Define new energy range for the model identified by the name
    309   inline void UpdateEmModel(const G4String&, G4double, G4double);
    310 
    311   // Access to models
    312   inline G4VEmModel* GetModelByIndex(G4int idx = 0, G4bool ver = false);
    313 
    314   inline G4int NumberOfModels();
    315 
    316   //------------------------------------------------------------------------
    317   // Get/set parameters used for simulation of energy loss
    318   //------------------------------------------------------------------------
    319 
    320   inline void SetLossFluctuations(G4bool val);
    321   inline void SetRandomStep(G4bool val);
    322   inline void SetIntegral(G4bool val);
    323   inline G4bool IsIntegral() const;
    324 
    325   // Set/Get flag "isIonisation"
    326   inline void SetIonisation(G4bool val);
    327   inline G4bool IsIonisationProcess() const;
    328 
    329   // Redefine parameteters for stepping control
    330   //
    331   inline void SetLinearLossLimit(G4double val);
    332   inline void SetMinSubRange(G4double val);
    333   inline void SetStepFunction(G4double v1, G4double v2);
    334   inline void SetLambdaFactor(G4double val);
    335 
    336 
    337   // Add subcutoff option for the region
    338   void ActivateSubCutoff(G4bool val, const G4Region* region = 0);
    339 
    340   inline G4int NumberOfSubCutoffRegions() const;
    341 
    342   // Activate deexcitation code
    343   virtual void ActivateDeexcitation(G4bool, const G4Region* region = 0);
    344 
    345   //------------------------------------------------------------------------
    346   // Public interface to helper functions
    347   //------------------------------------------------------------------------
    348 
    349   inline
    350   G4VEmModel* SelectModelForMaterial(G4double kinEnergy, size_t& idx) const;
    351 
    352   inline G4double MeanFreePath(const G4Track& track);
    353 
    354   inline G4double ContinuousStepLimit(const G4Track& track,
    355                                       G4double previousStepSize,
    356                                       G4double currentMinimumStep,
    357                                       G4double& currentSafety);
    358 
    359416  //------------------------------------------------------------------------
    360417  // Run time method for simulation of ionisation
     
    367424  inline void SetDynamicMassCharge(G4double massratio, G4double charge2ratio);
    368425
    369   // Access to cross section table
    370   G4double CrossSectionPerVolume(G4double kineticEnergy,
    371                                  const G4MaterialCutsCouple* couple);
    372 
    373 protected:
    374 
    375   G4PhysicsVector* LambdaPhysicsVector(const G4MaterialCutsCouple*,
    376                                        G4double cut);
    377 
    378   inline G4ParticleChangeForLoss* GetParticleChange();
    379 
    380   inline void SetParticle(const G4ParticleDefinition* p);
    381 
    382   inline void SetSecondaryParticle(const G4ParticleDefinition* p);
    383 
    384   inline void SelectModel(G4double kinEnergy);
    385 
    386   inline size_t CurrentMaterialCutsCoupleIndex() const;
    387 
    388   inline G4double GetCurrentRange() const;
    389 
    390426private:
    391 
    392   //------------------------------------------------------------------------
    393   // Management of tables
    394   //------------------------------------------------------------------------
    395 
    396   void Clear();
    397 
    398   G4bool StoreTable(const G4ParticleDefinition* p,
    399                     G4PhysicsTable*, G4bool ascii,
    400                     const G4String& directory,
    401                     const G4String& tname);
    402 
    403   G4bool RetrieveTable(const G4ParticleDefinition* p,
    404                        G4PhysicsTable*, G4bool ascii,
    405                        const G4String& directory,
    406                        const G4String& tname,
    407                        G4bool mandatory);
    408427
    409428  // define material and indexes
    410429  inline void DefineMaterial(const G4MaterialCutsCouple* couple);
    411430
    412   // Returnd values for scaled energy using mass of the base particle
    413   //
     431  //------------------------------------------------------------------------
     432  // Compute values using scaling relation, mass and charge of based particle
     433  //------------------------------------------------------------------------
     434
    414435  inline G4double GetDEDXForScaledEnergy(G4double scaledKinEnergy);
    415436  inline G4double GetSubDEDXForScaledEnergy(G4double scaledKinEnergy);
     
    418439  inline G4double GetScaledRangeForScaledEnergy(G4double scaledKinEnergy);
    419440  inline G4double GetLimitScaledRangeForScaledEnergy(G4double scaledKinEnergy);
     441  inline G4double ScaledKinEnergyForLoss(G4double range);
    420442  inline G4double GetLambdaForScaledEnergy(G4double scaledKinEnergy);
    421   inline G4double ScaledKinEnergyForLoss(G4double range);
    422443  inline void ComputeLambdaForScaledEnergy(G4double scaledKinEnergy);
    423444
    424445  // hide  assignment operator
    425 
    426446  G4VEnergyLossProcess(G4VEnergyLossProcess &);
    427447  G4VEnergyLossProcess & operator=(const G4VEnergyLossProcess &right);
     
    444464  G4VEmFluctuationModel*                fluctModel;
    445465  std::vector<const G4Region*>          scoffRegions;
     466  std::vector<const G4Region*>          deRegions;
    446467  G4int                                 nSCoffRegions;
    447   G4int*                                idxSCoffRegions;
     468  G4int                                 nDERegions;
     469  G4bool*                               idxSCoffRegions;
     470  G4bool*                               idxDERegions;
    448471
    449472  std::vector<G4VEnergyLossProcess*>    scProcesses;
     
    493516  G4bool   isIonisation;
    494517  G4bool   useSubCutoff;
     518  G4bool   useDeexcitation;
    495519
    496520protected:
     
    531555//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    532556
    533 inline void G4VEnergyLossProcess::DefineMaterial(
    534             const G4MaterialCutsCouple* couple)
    535 {
    536   if(couple != currentCouple) {
    537     currentCouple   = couple;
    538     currentMaterial = couple->GetMaterial();
    539     currentMaterialIndex = couple->GetIndex();
    540     mfpKinEnergy = DBL_MAX;
    541   }
     557inline size_t G4VEnergyLossProcess::CurrentMaterialCutsCoupleIndex() const
     558{
     559  return currentMaterialIndex;
     560}
     561
     562//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     563 
     564inline G4double G4VEnergyLossProcess::GetCurrentRange() const
     565{
     566  return fRange;
     567}
     568
     569//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     570
     571inline void G4VEnergyLossProcess::SelectModel(G4double kinEnergy)
     572{
     573  currentModel = modelManager->SelectModel(kinEnergy, currentMaterialIndex);
     574  currentModel->SetCurrentCouple(currentCouple);
     575}
     576
     577//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     578
     579inline G4VEmModel* G4VEnergyLossProcess::SelectModelForMaterial(
     580                   G4double kinEnergy, size_t& idx) const
     581{
     582  return modelManager->SelectModel(kinEnergy, idx);
     583}
     584
     585//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     586
     587inline void G4VEnergyLossProcess::SetFluctModel(G4VEmFluctuationModel* p)
     588{
     589  fluctModel = p;
     590}
     591
     592//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     593
     594inline G4VEmFluctuationModel* G4VEnergyLossProcess::FluctModel()
     595{
     596  return fluctModel;
     597}
     598
     599//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     600
     601inline void G4VEnergyLossProcess::SetParticle(const G4ParticleDefinition* p)
     602{
     603  particle = p;
     604}
     605
     606//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     607
     608inline void G4VEnergyLossProcess::SetSecondaryParticle(const G4ParticleDefinition* p)
     609{
     610  secondaryParticle = p;
     611}
     612
     613//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     614
     615inline void G4VEnergyLossProcess::SetBaseParticle(const G4ParticleDefinition* p)
     616{
     617  baseParticle = p;
     618}
     619
     620//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     621
     622inline const G4ParticleDefinition* G4VEnergyLossProcess::Particle() const
     623{
     624  return particle;
     625}
     626
     627//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     628
     629inline const G4ParticleDefinition* G4VEnergyLossProcess::BaseParticle() const
     630{
     631  return baseParticle;
     632}
     633
     634//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     635
     636inline const G4ParticleDefinition* G4VEnergyLossProcess::SecondaryParticle() const
     637{
     638  return secondaryParticle;
     639}
     640
     641//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     642
     643inline void G4VEnergyLossProcess::SetLossFluctuations(G4bool val)
     644{
     645  lossFluctuationFlag = val;
     646}
     647
     648//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     649
     650inline void G4VEnergyLossProcess::SetRandomStep(G4bool val)
     651{
     652  rndmStepFlag = val;
     653}
     654
     655//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     656
     657inline void G4VEnergyLossProcess::SetIntegral(G4bool val)
     658{
     659  integral = val;
     660}
     661
     662//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     663 
     664inline G4bool G4VEnergyLossProcess::IsIntegral() const
     665{
     666  return integral;
     667}
     668
     669//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     670
     671inline void G4VEnergyLossProcess::SetIonisation(G4bool val)
     672{
     673  isIonisation = val;
     674  if(val) aGPILSelection = CandidateForSelection;
     675  else    aGPILSelection = NotCandidateForSelection;
     676}
     677
     678//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     679
     680inline G4bool G4VEnergyLossProcess::IsIonisationProcess() const
     681{
     682  return isIonisation;
     683}
     684
     685//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     686
     687inline void G4VEnergyLossProcess::SetLinearLossLimit(G4double val)
     688{
     689  linLossLimit = val;
     690}
     691
     692//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     693
     694inline void G4VEnergyLossProcess::SetMinSubRange(G4double val)
     695{
     696  minSubRange = val;
     697}
     698
     699//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     700
     701inline void G4VEnergyLossProcess::SetLambdaFactor(G4double val)
     702{
     703  if(val > 0.0 && val <= 1.0) lambdaFactor = val;
     704}
     705
     706//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     707
     708void G4VEnergyLossProcess::SetStepFunction(G4double v1, G4double v2)
     709{
     710  dRoverRange = v1;
     711  finalRange = v2;
     712  if (dRoverRange > 0.999) dRoverRange = 1.0;
     713  currentCouple = 0;
     714  mfpKinEnergy  = DBL_MAX;
     715}
     716
     717//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     718
     719inline G4int G4VEnergyLossProcess::NumberOfSubCutoffRegions() const
     720{
     721  return nSCoffRegions;
     722}
     723
     724//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     725
     726inline G4int G4VEnergyLossProcess::NumberOfDERegions() const
     727{
     728  return nDERegions;
     729}
     730
     731//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     732
     733inline void G4VEnergyLossProcess::SetDEDXBinning(G4int nbins)
     734{
     735  nBins = nbins;
     736}
     737
     738//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     739
     740inline void G4VEnergyLossProcess::SetLambdaBinning(G4int nbins)
     741{
     742  nBins = nbins;
     743}
     744
     745//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     746
     747inline void G4VEnergyLossProcess::SetDEDXBinningForCSDARange(G4int nbins)
     748{
     749  nBinsCSDA = nbins;
     750}
     751
     752//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     753
     754inline void G4VEnergyLossProcess::SetMinKinEnergy(G4double e)
     755{
     756  minKinEnergy = e;
     757}
     758
     759//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     760
     761inline G4double G4VEnergyLossProcess::MinKinEnergy() const
     762{
     763  return minKinEnergy;
     764}
     765
     766//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     767
     768inline void G4VEnergyLossProcess::SetMaxKinEnergy(G4double e)
     769{
     770  maxKinEnergy = e;
     771  if(e < maxKinEnergyCSDA) maxKinEnergyCSDA = e;
     772}
     773
     774//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     775
     776inline G4double G4VEnergyLossProcess::MaxKinEnergy() const
     777{
     778  return maxKinEnergy;
     779}
     780
     781//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     782
     783inline void G4VEnergyLossProcess::SetMaxKinEnergyForCSDARange(G4double e)
     784{
     785  maxKinEnergyCSDA = e;
    542786}
    543787
     
    558802  DefineMaterial(couple);
    559803  return GetSubDEDXForScaledEnergy(kineticEnergy*massRatio);
    560 }
    561 
    562 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    563 
    564 inline G4double G4VEnergyLossProcess::GetDEDXForScaledEnergy(G4double e)
    565 {
    566   G4bool b;
    567   G4double x =
    568     ((*theDEDXTable)[currentMaterialIndex]->GetValue(e, b))*chargeSqRatio;
    569   if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
    570   return x;
    571 }
    572 
    573 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    574 
    575 inline G4double G4VEnergyLossProcess::GetSubDEDXForScaledEnergy(G4double e)
    576 {
    577   G4bool b;
    578   G4double x =
    579     ((*theDEDXSubTable)[currentMaterialIndex]->GetValue(e, b))*chargeSqRatio;
    580   if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
    581   return x;
    582 }
    583 
    584 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    585 
    586 inline G4double G4VEnergyLossProcess::GetIonisationForScaledEnergy(G4double e)
    587 {
    588   G4bool b;
    589   G4double x = 0.0;
    590   //  if(theIonisationTable) {
    591   x = ((*theIonisationTable)[currentMaterialIndex]->GetValue(e, b))
    592     *chargeSqRatio;
    593   if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
    594   //}
    595   return x;
    596 }
    597 
    598 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    599 
    600 inline
    601 G4double G4VEnergyLossProcess::GetSubIonisationForScaledEnergy(G4double e)
    602 {
    603   G4bool b;
    604   G4double x = 0.0;
    605   //if(theIonisationSubTable) {
    606   x = ((*theIonisationSubTable)[currentMaterialIndex]->GetValue(e, b))
    607     *chargeSqRatio;
    608   if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
    609   //}
    610   return x;
    611804}
    612805
     
    643836//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    644837
     838inline G4double G4VEnergyLossProcess::GetRangeForLoss(
     839                G4double& kineticEnergy,
     840                const G4MaterialCutsCouple* couple)
     841{
     842  DefineMaterial(couple);
     843  G4double x = DBL_MAX;
     844  if(theRangeTableForLoss)
     845    x = GetScaledRangeForScaledEnergy(kineticEnergy*massRatio)*reduceFactor;
     846  //  G4cout << "Range from " << GetProcessName()
     847  //         << "  e= " << kineticEnergy << " r= " << x << G4endl;
     848  return x;
     849}
     850
     851//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     852
     853inline G4double G4VEnergyLossProcess::GetKineticEnergy(
     854                G4double& range,
     855                const G4MaterialCutsCouple* couple)
     856{
     857  DefineMaterial(couple);
     858  G4double r = range/reduceFactor;
     859  G4double e = ScaledKinEnergyForLoss(r)/massRatio;
     860  return e;
     861}
     862
     863//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     864
     865inline G4double G4VEnergyLossProcess::GetLambda(G4double& kineticEnergy,
     866                                          const G4MaterialCutsCouple* couple)
     867{
     868  DefineMaterial(couple);
     869  G4double x = 0.0;
     870  if(theLambdaTable) x = GetLambdaForScaledEnergy(kineticEnergy*massRatio);
     871  return x;
     872}
     873
     874//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     875
     876inline G4bool G4VEnergyLossProcess::TablesAreBuilt() const
     877{
     878  return  tablesAreBuilt;
     879}
     880
     881//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     882
     883inline G4PhysicsTable* G4VEnergyLossProcess::DEDXTable() const
     884{
     885  return theDEDXTable;
     886}
     887
     888//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     889
     890inline G4PhysicsTable* G4VEnergyLossProcess::DEDXTableForSubsec() const
     891{
     892  return theDEDXSubTable;
     893}
     894
     895//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     896
     897inline G4PhysicsTable* G4VEnergyLossProcess::DEDXunRestrictedTable() const
     898{
     899  return theDEDXunRestrictedTable;
     900}
     901
     902//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     903
     904inline G4PhysicsTable* G4VEnergyLossProcess::IonisationTable() const
     905{
     906  G4PhysicsTable* t = theDEDXTable;
     907  if(theIonisationTable) t = theIonisationTable;
     908  return t;
     909}
     910
     911//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     912
     913inline G4PhysicsTable* G4VEnergyLossProcess::IonisationTableForSubsec() const
     914{
     915  G4PhysicsTable* t = theDEDXSubTable;
     916  if(theIonisationSubTable) t = theIonisationSubTable;
     917  return t;
     918}
     919
     920//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     921
     922inline G4PhysicsTable* G4VEnergyLossProcess::CSDARangeTable() const
     923{
     924  return theCSDARangeTable;
     925}
     926
     927//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     928
     929inline G4PhysicsTable* G4VEnergyLossProcess::RangeTableForLoss() const
     930{
     931  return theRangeTableForLoss;
     932}
     933
     934//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     935
     936inline G4PhysicsTable* G4VEnergyLossProcess::InverseRangeTable() const
     937{
     938  return theInverseRangeTable;
     939}
     940
     941//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     942
     943inline G4PhysicsTable* G4VEnergyLossProcess::LambdaTable()
     944{
     945  return theLambdaTable;
     946}
     947
     948//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     949
     950inline G4PhysicsTable* G4VEnergyLossProcess::SubLambdaTable()
     951{
     952  return theSubLambdaTable;
     953}
     954
     955//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     956
     957inline G4double G4VEnergyLossProcess::SampleRange()
     958{
     959  G4double e = amu_c2*preStepKinEnergy/particle->GetPDGMass();
     960  G4bool b;
     961  G4double s = fRange*std::pow(10.,vstrag->GetValue(e,b));
     962  G4double x = fRange + G4RandGauss::shoot(0.0,s);
     963  if(x > 0.0) fRange = x;
     964  return fRange;
     965}
     966
     967//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     968
     969inline void G4VEnergyLossProcess::SetDynamicMassCharge(G4double massratio,
     970                                                       G4double charge2ratio)
     971{
     972  massRatio     = massratio;
     973  chargeSqRatio = charge2ratio;
     974  reduceFactor  = 1.0/(chargeSqRatio*massRatio);
     975}
     976
     977//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     978
     979inline void G4VEnergyLossProcess::DefineMaterial(
     980            const G4MaterialCutsCouple* couple)
     981{
     982  if(couple != currentCouple) {
     983    currentCouple   = couple;
     984    currentMaterial = couple->GetMaterial();
     985    currentMaterialIndex = couple->GetIndex();
     986    mfpKinEnergy = DBL_MAX;
     987  }
     988}
     989
     990//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     991
     992inline G4double G4VEnergyLossProcess::GetDEDXForScaledEnergy(G4double e)
     993{
     994  G4bool b;
     995  G4double x =
     996    ((*theDEDXTable)[currentMaterialIndex]->GetValue(e, b))*chargeSqRatio;
     997  if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
     998  return x;
     999}
     1000
     1001//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     1002
     1003inline G4double G4VEnergyLossProcess::GetSubDEDXForScaledEnergy(G4double e)
     1004{
     1005  G4bool b;
     1006  G4double x =
     1007    ((*theDEDXSubTable)[currentMaterialIndex]->GetValue(e, b))*chargeSqRatio;
     1008  if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
     1009  return x;
     1010}
     1011
     1012//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     1013
     1014inline G4double G4VEnergyLossProcess::GetIonisationForScaledEnergy(G4double e)
     1015{
     1016  G4bool b;
     1017  G4double x = 0.0;
     1018  //  if(theIonisationTable) {
     1019  x = ((*theIonisationTable)[currentMaterialIndex]->GetValue(e, b))
     1020    *chargeSqRatio;
     1021  if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
     1022  //}
     1023  return x;
     1024}
     1025
     1026//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     1027
     1028inline
     1029G4double G4VEnergyLossProcess::GetSubIonisationForScaledEnergy(G4double e)
     1030{
     1031  G4bool b;
     1032  G4double x = 0.0;
     1033  //if(theIonisationSubTable) {
     1034  x = ((*theIonisationSubTable)[currentMaterialIndex]->GetValue(e, b))
     1035    *chargeSqRatio;
     1036  if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
     1037  //}
     1038  return x;
     1039}
     1040
     1041//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     1042
     1043inline G4double G4VEnergyLossProcess::GetScaledRangeForScaledEnergy(G4double e)
     1044{
     1045  G4bool b;
     1046  G4double x = ((*theRangeTableForLoss)[currentMaterialIndex])->GetValue(e, b);
     1047  if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
     1048  return x;
     1049}
     1050
     1051//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     1052
    6451053inline G4double G4VEnergyLossProcess::GetLimitScaledRangeForScaledEnergy(
    6461054                G4double e)
     
    6571065  }
    6581066  return x;
    659 }
    660 
    661 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    662 
    663 inline G4double G4VEnergyLossProcess::GetRangeForLoss(
    664                 G4double& kineticEnergy,
    665                 const G4MaterialCutsCouple* couple)
    666 {
    667   DefineMaterial(couple);
    668   G4double x = DBL_MAX;
    669   if(theRangeTableForLoss)
    670     x = GetScaledRangeForScaledEnergy(kineticEnergy*massRatio)*reduceFactor;
    671   //  G4cout << "Range from " << GetProcessName()
    672   //         << "  e= " << kineticEnergy << " r= " << x << G4endl;
    673   return x;
    674 }
    675 
    676 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    677 
    678 inline G4double G4VEnergyLossProcess::GetScaledRangeForScaledEnergy(G4double e)
    679 {
    680   G4bool b;
    681   G4double x = ((*theRangeTableForLoss)[currentMaterialIndex])->GetValue(e, b);
    682   if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
    683   return x;
    684 }
    685 
    686 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    687 
    688 inline G4double G4VEnergyLossProcess::GetKineticEnergy(
    689                 G4double& range,
    690                 const G4MaterialCutsCouple* couple)
    691 {
    692   DefineMaterial(couple);
    693   G4double r = range/reduceFactor;
    694   G4double e = ScaledKinEnergyForLoss(r)/massRatio;
    695   return e;
    6961067}
    6971068
     
    7111082  }
    7121083  return e;
    713 }
    714 
    715 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    716 
    717 inline G4double G4VEnergyLossProcess::GetLambda(G4double& kineticEnergy,
    718                                           const G4MaterialCutsCouple* couple)
    719 {
    720   DefineMaterial(couple);
    721   G4double x = 0.0;
    722   if(theLambdaTable) x = GetLambdaForScaledEnergy(kineticEnergy*massRatio);
    723   return x;
    7241084}
    7251085
     
    7581118//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    7591119
    760 inline G4double G4VEnergyLossProcess::ContinuousStepLimit(
    761          const G4Track& track, G4double x, G4double y, G4double& z)
    762 {
    763   G4GPILSelection sel;
    764   return AlongStepGetPhysicalInteractionLength(track, x, y, z, &sel);
    765 }
    766 
    767 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    768 
    769 inline G4double G4VEnergyLossProcess::SampleRange()
    770 {
    771   G4double e = amu_c2*preStepKinEnergy/particle->GetPDGMass();
    772   G4bool b;
    773   G4double s = fRange*std::pow(10.,vstrag->GetValue(e,b));
    774   G4double x = fRange + G4RandGauss::shoot(0.0,s);
    775   if(x > 0.0) fRange = x;
    776   return fRange;
    777 }
    778 
    779 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    780 
    781 inline G4double G4VEnergyLossProcess::MeanFreePath(const G4Track& track)
    782 {
    783   DefineMaterial(track.GetMaterialCutsCouple());
    784   preStepLambda = GetLambdaForScaledEnergy(track.GetKineticEnergy()*massRatio);
    785   G4double x = DBL_MAX;
    786   if(DBL_MIN < preStepLambda) x = 1.0/preStepLambda;
    787   return x;
    788 }
    789 
    790 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    791 
    792 inline G4double G4VEnergyLossProcess::MinPrimaryEnergy(
    793                 const G4ParticleDefinition*, const G4Material*, G4double cut)
    794 {
    795   return cut;
    796 }
    797 
    798 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    799 
    800 inline void G4VEnergyLossProcess::SelectModel(G4double kinEnergy)
    801 {
    802   currentModel = modelManager->SelectModel(kinEnergy, currentMaterialIndex);
    803 }
    804 
    805 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    806 
    807 inline G4VEmModel* G4VEnergyLossProcess::SelectModelForMaterial(
    808                    G4double kinEnergy, size_t& idx) const
    809 {
    810   return modelManager->SelectModel(kinEnergy, idx);
    811 }
    812 
    813 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    814 
    815 inline G4ParticleChangeForLoss* G4VEnergyLossProcess::GetParticleChange()
    816 {
    817   return &fParticleChange;
    818 }
    819 
    820 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    821 
    822 inline const G4ParticleDefinition* G4VEnergyLossProcess::Particle() const
    823 {
    824   return particle;
    825 }
    826 
    827 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    828 
    829 inline const G4ParticleDefinition* G4VEnergyLossProcess::BaseParticle() const
    830 {
    831   return baseParticle;
    832 }
    833 
    834 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    835 
    836 inline const G4ParticleDefinition* G4VEnergyLossProcess::SecondaryParticle() const
    837 {
    838   return secondaryParticle;
    839 }
    840 
    841 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    842 
    843 inline G4PhysicsTable* G4VEnergyLossProcess::DEDXTable() const
    844 {
    845   return theDEDXTable;
    846 }
    847 
    848 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    849 
    850 inline G4PhysicsTable* G4VEnergyLossProcess::DEDXTableForSubsec() const
    851 {
    852   return theDEDXSubTable;
    853 }
    854 
    855 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    856 
    857 inline G4PhysicsTable* G4VEnergyLossProcess::DEDXunRestrictedTable() const
    858 {
    859   return theDEDXunRestrictedTable;
    860 }
    861 
    862 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    863 
    864 inline G4PhysicsTable* G4VEnergyLossProcess::IonisationTable() const
    865 {
    866   G4PhysicsTable* t = theDEDXTable;
    867   if(theIonisationTable) t = theIonisationTable;
    868   return t;
    869 }
    870 
    871 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    872 
    873 inline G4PhysicsTable* G4VEnergyLossProcess::IonisationTableForSubsec() const
    874 {
    875   G4PhysicsTable* t = theDEDXSubTable;
    876   if(theIonisationSubTable) t = theIonisationSubTable;
    877   return t;
    878 }
    879 
    880 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    881 
    882 inline G4PhysicsTable* G4VEnergyLossProcess::CSDARangeTable() const
    883 {
    884   return theCSDARangeTable;
    885 }
    886 
    887 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    888 
    889 inline G4PhysicsTable* G4VEnergyLossProcess::RangeTableForLoss() const
    890 {
    891   return theRangeTableForLoss;
    892 }
    893 
    894 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    895 
    896 inline G4PhysicsTable* G4VEnergyLossProcess::InverseRangeTable() const
    897 {
    898   return theInverseRangeTable;
    899 }
    900 
    901 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    902 
    903 inline G4PhysicsTable* G4VEnergyLossProcess::LambdaTable()
    904 {
    905   return theLambdaTable;
    906 }
    907 
    908 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    909 
    910 inline G4PhysicsTable* G4VEnergyLossProcess::SubLambdaTable()
    911 {
    912   return theSubLambdaTable;
    913 }
    914 
    915 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    916  
    917 inline G4bool G4VEnergyLossProcess::IsIntegral() const
    918 {
    919   return integral;
    920 }
    921 
    922 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    923 
    924 inline size_t G4VEnergyLossProcess::CurrentMaterialCutsCoupleIndex() const
    925 {
    926   return currentMaterialIndex;
    927 }
    928 
    929 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    930 
    931 inline void G4VEnergyLossProcess::SetDynamicMassCharge(G4double massratio,
    932                                                        G4double charge2ratio)
    933 {
    934   massRatio     = massratio;
    935   chargeSqRatio = charge2ratio;
    936   reduceFactor  = 1.0/(chargeSqRatio*massRatio);
    937 }
    938 
    939 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    940  
    941 inline G4double G4VEnergyLossProcess::GetCurrentRange() const
    942 {
    943   return fRange;
    944 }
    945 
    946 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    947 
    948 inline
    949 void G4VEnergyLossProcess::AddEmModel(G4int order, G4VEmModel* p,
    950                                       G4VEmFluctuationModel* fluc,
    951                                       const G4Region* region)
    952 {
    953   modelManager->AddEmModel(order, p, fluc, region);
    954   if(p) p->SetParticleChange(pParticleChange, fluc);
    955 }
    956 
    957 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    958 
    959 inline
    960 G4VEmModel* G4VEnergyLossProcess::GetModelByIndex(G4int idx, G4bool ver)
    961 {
    962   return modelManager->GetModel(idx, ver);
    963 }
    964 
    965 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    966 
    967 inline G4int G4VEnergyLossProcess::NumberOfModels()
    968 {
    969   return modelManager->NumberOfModels();
    970 }
    971 
    972 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    973 
    974 inline void G4VEnergyLossProcess::SetEmModel(G4VEmModel* p, G4int index)
    975 {
    976   G4int n = emModels.size();
    977   if(index >= n) for(G4int i=n; i<index+1; i++) {emModels.push_back(0);}
    978   emModels[index] = p;
    979 }
    980 
    981 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    982 
    983 inline G4VEmModel* G4VEnergyLossProcess::EmModel(G4int index)
    984 {
    985   G4VEmModel* p = 0;
    986   if(index >= 0 && index <  G4int(emModels.size())) p = emModels[index];
    987   return p;
    988 }
    989 
    990 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    991 
    992 inline void G4VEnergyLossProcess::SetFluctModel(G4VEmFluctuationModel* p)
    993 {
    994   fluctModel = p;
    995 }
    996 
    997 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    998 
    999 inline G4VEmFluctuationModel* G4VEnergyLossProcess::FluctModel()
    1000 {
    1001   return fluctModel;
    1002 }
    1003 
    1004 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    1005 
    1006 inline void G4VEnergyLossProcess::UpdateEmModel(const G4String& nam,
    1007                                                 G4double emin, G4double emax)
    1008 {
    1009   modelManager->UpdateEmModel(nam, emin, emax);
    1010 }
    1011 
    1012 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    1013 
    1014 inline void G4VEnergyLossProcess::SetIntegral(G4bool val)
    1015 {
    1016   integral = val;
    1017 }
    1018 
    1019 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    1020 
    1021 inline void G4VEnergyLossProcess::SetParticle(const G4ParticleDefinition* p)
    1022 {
    1023   particle = p;
    1024 }
    1025 
    1026 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    1027 
    1028 inline void G4VEnergyLossProcess::SetBaseParticle(const G4ParticleDefinition* p)
    1029 {
    1030   baseParticle = p;
    1031 }
    1032 
    1033 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    1034 
    1035 inline void G4VEnergyLossProcess::SetSecondaryParticle(const G4ParticleDefinition* p)
    1036 {
    1037   secondaryParticle = p;
    1038 }
    1039 
    1040 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    1041 
    1042 inline void G4VEnergyLossProcess::SetLinearLossLimit(G4double val)
    1043 {
    1044   linLossLimit = val;
    1045 }
    1046 
    1047 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    1048 
    1049 inline void G4VEnergyLossProcess::SetLossFluctuations(G4bool val)
    1050 {
    1051   lossFluctuationFlag = val;
    1052 }
    1053 
    1054 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    1055 
    1056 inline void G4VEnergyLossProcess::SetRandomStep(G4bool val)
    1057 {
    1058   rndmStepFlag = val;
    1059 }
    1060 
    1061 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    1062 
    1063 inline void G4VEnergyLossProcess::SetMinSubRange(G4double val)
    1064 {
    1065   minSubRange = val;
    1066 }
    1067 
    1068 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    1069 
    1070 inline G4bool G4VEnergyLossProcess::TablesAreBuilt() const
    1071 {
    1072   return  tablesAreBuilt;
    1073 }
    1074 
    1075 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    1076 
    1077 inline G4int G4VEnergyLossProcess::NumberOfSubCutoffRegions() const
    1078 {
    1079   return nSCoffRegions;
    1080 }
    1081 
    1082 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    1083 
    1084 inline void G4VEnergyLossProcess::SetDEDXBinning(G4int nbins)
    1085 {
    1086   nBins = nbins;
    1087 }
    1088 
    1089 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    1090 
    1091 inline void G4VEnergyLossProcess::SetLambdaBinning(G4int nbins)
    1092 {
    1093   nBins = nbins;
    1094 }
    1095 
    1096 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    1097 
    1098 inline void G4VEnergyLossProcess::SetDEDXBinningForCSDARange(G4int nbins)
    1099 {
    1100   nBinsCSDA = nbins;
    1101 }
    1102 
    1103 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    1104 
    1105 inline G4double G4VEnergyLossProcess::MinKinEnergy() const
    1106 {
    1107   return minKinEnergy;
    1108 }
    1109 
    1110 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    1111 
    1112 inline void G4VEnergyLossProcess::SetMinKinEnergy(G4double e)
    1113 {
    1114   minKinEnergy = e;
    1115 }
    1116 
    1117 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    1118 
    1119 inline void G4VEnergyLossProcess::SetMaxKinEnergy(G4double e)
    1120 {
    1121   maxKinEnergy = e;
    1122   if(e < maxKinEnergyCSDA) maxKinEnergyCSDA = e;
    1123 }
    1124 
    1125 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    1126 
    1127 inline void G4VEnergyLossProcess::SetMaxKinEnergyForCSDARange(G4double e)
    1128 {
    1129   maxKinEnergyCSDA = e;
    1130 }
    1131 
    1132 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    1133 
    1134 inline G4double G4VEnergyLossProcess::MaxKinEnergy() const
    1135 {
    1136   return maxKinEnergy;
    1137 }
    1138 
    1139 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    1140 
    1141 inline void G4VEnergyLossProcess::SetLambdaFactor(G4double val)
    1142 {
    1143   if(val > 0.0 && val <= 1.0) lambdaFactor = val;
    1144 }
    1145 
    1146 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    1147 
    1148 inline void G4VEnergyLossProcess::SetIonisation(G4bool val)
    1149 {
    1150   isIonisation = val;
    1151   if(val) aGPILSelection = CandidateForSelection;
    1152   else    aGPILSelection = NotCandidateForSelection;
    1153 }
    1154 
    1155 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    1156 
    1157 inline G4bool G4VEnergyLossProcess::IsIonisationProcess() const
    1158 {
    1159   return isIonisation;
    1160 }
    1161 
    1162 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    1163 
    1164 void G4VEnergyLossProcess::SetStepFunction(G4double v1, G4double v2)
    1165 {
    1166   dRoverRange = v1;
    1167   finalRange = v2;
    1168   if (dRoverRange > 0.999) dRoverRange = 1.0;
    1169   currentCouple = 0;
    1170   mfpKinEnergy  = DBL_MAX;
    1171 }
    1172 
    1173 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    1174 
    11751120#endif
  • trunk/source/processes/electromagnetic/utils/include/G4VMscModel.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VMscModel.hh,v 1.4 2008/03/10 10:39:28 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4VMscModel.hh,v 1.9 2009/04/07 18:39:47 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    3939//
    4040// Modifications:
    41 //
     41// 07.04.2009 V.Ivanchenko moved msc methods from G4VEmModel to G4VMscModel
    4242//
    4343// Class Description:
     
    5454#include "G4MscStepLimitType.hh"
    5555#include "globals.hh"
     56#include "G4ThreeVector.hh"
     57#include "G4Track.hh"
     58#include "G4SafetyHelper.hh"
     59
     60class G4ParticleChangeForMSC;
    5661
    5762class G4VMscModel : public G4VEmModel
     
    6469  virtual ~G4VMscModel();
    6570
     71  virtual G4double ComputeTruePathLengthLimit(const G4Track& track,
     72                                              G4PhysicsTable* theLambdaTable,
     73                                              G4double currentMinimalStep);
     74
     75  virtual G4double ComputeGeomPathLength(G4double truePathLength);
     76
     77  virtual G4double ComputeTrueStepLength(G4double geomPathLength);
     78
     79  virtual void SampleScattering(const G4DynamicParticle*,
     80                                G4double safety);
     81
     82  // empty
     83  virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*,
     84                                 const G4MaterialCutsCouple*,
     85                                 const G4DynamicParticle*,
     86                                 G4double tmin,
     87                                 G4double tmax);
     88
     89  //================================================================
     90  //  Set parameters of multiple scattering models
     91  //================================================================
     92 
    6693  inline void SetStepLimitType(G4MscStepLimitType);
    6794
     
    73100
    74101  inline void SetSkin(G4double);
     102
     103  inline void SetSampleZ(G4bool);
     104
     105protected:
     106
     107  // initialisation of the ParticleChange for the model
     108  G4ParticleChangeForMSC* GetParticleChangeForMSC();
     109
     110  // initialisation of interface with geometry
     111  void InitialiseSafetyHelper();
     112
     113  // shift point of the track PostStep
     114  void ComputeDisplacement(G4ParticleChangeForMSC*, 
     115                           const G4ThreeVector& displDir,
     116                           G4double displacement,
     117                           G4double postsafety);
     118
     119  // compute safety
     120  inline G4double ComputeSafety(const G4ThreeVector& position, G4double limit);
     121
     122  // compute linear distance to a geometry boundary
     123  inline G4double ComputeGeomLimit(const G4Track& position, G4double& presafety,
     124                                   G4double limit);
    75125
    76126private:
     
    79129  G4VMscModel & operator=(const  G4VMscModel &right);
    80130  G4VMscModel(const  G4VMscModel&);
     131
     132  G4SafetyHelper* safetyHelper;
    81133
    82134protected:
     
    88140  G4double dtrl;
    89141  G4double lambdalimit;
     142  G4double geommax;
    90143
    91144  G4MscStepLimitType steppingAlgorithm;
     
    134187//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    135188
     189inline void G4VMscModel::SetSampleZ(G4bool val)
     190{
     191  samplez = val;
     192}
     193
     194//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     195
     196inline G4double G4VMscModel::ComputeSafety(const G4ThreeVector& position,
     197                                           G4double)
     198{
     199  return safetyHelper->ComputeSafety(position);
     200}
     201
     202//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     203
     204inline G4double G4VMscModel::ComputeGeomLimit(const G4Track& track,
     205                                              G4double& presafety,
     206                                              G4double limit)
     207{
     208  G4double res = geommax;
     209  if(track.GetVolume() != safetyHelper->GetWorldVolume()) {
     210    res = safetyHelper->CheckNextStep(
     211          track.GetStep()->GetPreStepPoint()->GetPosition(),
     212          track.GetMomentumDirection(),
     213          limit, presafety);
     214  }
     215  return res;
     216}
     217
     218//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     219
    136220#endif
    137221
  • trunk/source/processes/electromagnetic/utils/include/G4VMultipleScattering.hh

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VMultipleScattering.hh,v 1.54 2008/07/31 13:01:26 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4VMultipleScattering.hh,v 1.56 2009/04/07 18:39:47 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    6464// 27-10-07 Virtual functions moved to source (V.Ivanchenko)
    6565// 15-07-08 Reorder class members for further multi-thread development (VI)
     66// 07-04-09 Moved msc methods from G4VEmModel to G4VMscModel (VI)
    6667//
    6768
     
    8081#include "G4Step.hh"
    8182#include "G4EmModelManager.hh"
    82 #include "G4VEmModel.hh"
     83#include "G4VMscModel.hh"
    8384#include "G4MscStepLimitType.hh"
    8485
     
    145146                              G4bool ascii);
    146147
    147   //------------------------------------------------------------------------
    148   // Specific methods for msc processes
    149   //------------------------------------------------------------------------
    150 
    151148  // The function overloads the corresponding function of the base
    152149  // class.It limits the step near to boundaries only
    153150  // and invokes the method GetMscContinuousStepLimit at every step.
    154   virtual G4double AlongStepGetPhysicalInteractionLength(
     151  G4double AlongStepGetPhysicalInteractionLength(
    155152                                            const G4Track&,
    156153                                            G4double  previousStepSize,
     
    192189  inline G4PhysicsTable* LambdaTable() const;
    193190
    194   //------------------------------------------------------------------------
    195   // Define and access particle type
    196   //------------------------------------------------------------------------
    197 
     191  // access particle type
    198192  inline const G4ParticleDefinition* Particle() const;
    199   inline void SetParticle(const G4ParticleDefinition*);
    200193
    201194  //------------------------------------------------------------------------
     
    203196  //------------------------------------------------------------------------
    204197
    205   inline void AddEmModel(G4int, G4VEmModel*, const G4Region* region = 0);
    206 
     198protected:
     199  // Select model in run time
     200  inline G4VEmModel* SelectModel(G4double kinEnergy);
     201
     202public:
     203  // Select model in run time
    207204  inline G4VEmModel* SelectModelForMaterial(G4double kinEnergy,
    208205                                            size_t& idxRegion) const;
    209206
    210   // Access to models
    211   inline G4VEmModel* GetModelByIndex(G4int idx = 0, G4bool ver = false);
    212 
    213   //------------------------------------------------------------------------
    214   // Set parameters for simulation of multiple scattering
    215   //------------------------------------------------------------------------
    216 
     207  // Add model for region, smaller value of order defines which
     208  // model will be selected for a given energy interval 
     209  void AddEmModel(G4int order, G4VEmModel*, const G4Region* region = 0);
     210
     211  // Access to models by index
     212  G4VEmModel* GetModelByIndex(G4int idx = 0, G4bool ver = false);
     213
     214  //------------------------------------------------------------------------
     215  // Get/Set parameters for simulation of multiple scattering
     216  //------------------------------------------------------------------------
     217
     218  inline G4bool LateralDisplasmentFlag() const;
    217219  inline void SetLateralDisplasmentFlag(G4bool val);
    218220
     221  inline G4double Skin() const;
    219222  inline void SetSkin(G4double val);
    220223
     224  inline G4double RangeFactor() const;
    221225  inline void SetRangeFactor(G4double val);
    222226
     227  inline G4double GeomFactor() const;
    223228  inline void SetGeomFactor(G4double val);
    224229
     230  inline G4double PolarAngleLimit() const;
    225231  inline void SetPolarAngleLimit(G4double val);
    226232
     233  inline G4MscStepLimitType StepLimitType() const;
    227234  inline void SetStepLimitType(G4MscStepLimitType val);
    228235
     236  //------------------------------------------------------------------------
     237  // Run time methods
     238  //------------------------------------------------------------------------
     239
    229240protected:
    230241
    231   // This method is used for tracking, it returns mean free path value
     242  // This method is not used for tracking, it returns mean free path value
    232243  G4double GetMeanFreePath(const G4Track& track,
    233244                           G4double,
    234245                           G4ForceCondition* condition);
    235 
    236   //------------------------------------------------------------------------
    237   // Run time methods
    238   //------------------------------------------------------------------------
    239246
    240247  // This method is not used for tracking, it returns step limit
     
    244251                                  G4double& currentSafety);
    245252
     253  // This method returns inversed transport cross section
    246254  inline G4double GetLambda(const G4ParticleDefinition* p,
    247255                            G4double& kineticEnergy);
     
    253261                                            G4double& currentSafety);
    254262
    255   inline G4VEmModel* SelectModel(G4double kinEnergy);
    256   // Select concrete model
     263  // defines current material in run time
     264  inline void DefineMaterial(const G4MaterialCutsCouple* couple);
    257265
    258266  inline const G4MaterialCutsCouple* CurrentMaterialCutsCouple() const;
    259267
    260   // define current material
    261   inline void DefineMaterial(const G4MaterialCutsCouple* couple);
    262 
    263   //------------------------------------------------------------------------
    264   // Access parameters of multiple scattering
    265   //------------------------------------------------------------------------
    266 
    267   inline G4ParticleChangeForMSC* GetParticleChange();
    268 
    269   inline G4double Skin() const;
    270 
    271   inline G4double RangeFactor() const;
    272 
    273   inline G4double GeomFactor() const;
    274 
    275   inline G4double PolarAngleLimit() const;
    276 
    277   inline G4MscStepLimitType StepLimitType() const;
    278 
    279   inline G4bool LateralDisplasmentFlag() const;
    280 
    281268private:
    282269
    283270  // hide  assignment operator
    284 
    285271  G4VMultipleScattering(G4VMultipleScattering &);
    286272  G4VMultipleScattering & operator=(const G4VMultipleScattering &right);
     
    318304private:
    319305
    320   G4VEmModel*                 currentModel;
     306  G4VMscModel*                currentModel;
    321307
    322308  // cache
     
    330316//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    331317
     318inline G4double G4VMultipleScattering::ContinuousStepLimit(
     319                                       const G4Track& track,
     320                                       G4double previousStepSize,
     321                                       G4double currentMinimalStep,
     322                                       G4double& currentSafety)
     323{
     324  return GetMscContinuousStepLimit(track,previousStepSize,currentMinimalStep,
     325                                   currentSafety);
     326}
     327
     328//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     329
     330inline void G4VMultipleScattering::SetBinning(G4int nbins)
     331{
     332  nBins = nbins;
     333}
     334
     335//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     336
     337inline G4int G4VMultipleScattering::Binning() const
     338{
     339  return nBins;
     340}
     341
     342//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     343
     344inline void G4VMultipleScattering::SetMinKinEnergy(G4double e)
     345{
     346  minKinEnergy = e;
     347}
     348
     349//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     350
     351inline G4double G4VMultipleScattering::MinKinEnergy() const
     352{
     353  return minKinEnergy;
     354}
     355
     356//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     357
     358inline void G4VMultipleScattering::SetMaxKinEnergy(G4double e)
     359{
     360  maxKinEnergy = e;
     361}
     362
     363//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     364
     365inline G4double G4VMultipleScattering::MaxKinEnergy() const
     366{
     367  return maxKinEnergy;
     368}
     369
     370//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     371
     372inline  void G4VMultipleScattering::SetBuildLambdaTable(G4bool val)
     373{
     374  buildLambdaTable = val;
     375}
     376
     377//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     378
     379inline G4PhysicsTable* G4VMultipleScattering::LambdaTable() const
     380{
     381  return theLambdaTable;
     382}
     383
     384//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     385
     386inline  const G4ParticleDefinition* G4VMultipleScattering::Particle() const
     387{
     388  return currentParticle;
     389}
     390
     391//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     392
     393inline G4VEmModel* G4VMultipleScattering::SelectModel(G4double kinEnergy)
     394{
     395  return modelManager->SelectModel(kinEnergy, currentMaterialIndex);
     396}
     397
     398//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     399
     400inline G4VEmModel* G4VMultipleScattering::SelectModelForMaterial(
     401                   G4double kinEnergy, size_t& idxRegion) const
     402{
     403  return modelManager->SelectModel(kinEnergy, idxRegion);
     404}
     405
     406//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     407
     408inline  G4bool G4VMultipleScattering::LateralDisplasmentFlag() const
     409{
     410  return latDisplasment;
     411}
     412
     413//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     414
     415inline  void G4VMultipleScattering::SetLateralDisplasmentFlag(G4bool val)
     416{
     417  latDisplasment = val;
     418}
     419
     420//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     421
     422inline  G4double G4VMultipleScattering::Skin() const
     423{
     424  return skin;
     425}
     426
     427//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     428
     429inline  void G4VMultipleScattering::SetSkin(G4double val)
     430{
     431  if(val < 1.0) skin = 0.0;
     432  else          skin = val;
     433}
     434
     435//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     436
     437inline  G4double G4VMultipleScattering::RangeFactor() const
     438{
     439  return facrange;
     440}
     441
     442//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     443
     444inline  void G4VMultipleScattering::SetRangeFactor(G4double val)
     445{
     446  if(val > 0.0) facrange = val;
     447}
     448
     449//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     450
     451inline  G4double G4VMultipleScattering::GeomFactor() const
     452{
     453  return facgeom;
     454}
     455
     456//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     457
     458inline  void G4VMultipleScattering::SetGeomFactor(G4double val)
     459{
     460  if(val > 0.0) facgeom = val;
     461}
     462
     463//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     464
     465inline  G4double G4VMultipleScattering::PolarAngleLimit() const
     466{
     467  return polarAngleLimit;
     468}
     469
     470//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     471
     472inline  void G4VMultipleScattering::SetPolarAngleLimit(G4double val)
     473{
     474  if(val < 0.0)     polarAngleLimit = 0.0;
     475  else if(val > pi) polarAngleLimit = pi;
     476  else              polarAngleLimit = val;
     477}
     478
     479//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     480
     481inline G4MscStepLimitType G4VMultipleScattering::StepLimitType() const
     482{
     483  return stepLimit;
     484}
     485
     486//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     487
     488inline void G4VMultipleScattering::SetStepLimitType(G4MscStepLimitType val)
     489{
     490  stepLimit = val;
     491  if(val == fMinimal) facrange = 0.2;
     492}
     493
     494//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     495
    332496inline
    333 void G4VMultipleScattering::DefineMaterial(const G4MaterialCutsCouple* couple)
    334 {
    335   if(couple != currentCouple) {
    336     currentCouple   = couple;
    337     currentMaterialIndex = couple->GetIndex();
     497G4double G4VMultipleScattering::GetLambda(const G4ParticleDefinition* p,
     498                                          G4double& e)
     499{
     500  G4double x;
     501  if(theLambdaTable) {
     502    G4bool b;
     503    x = ((*theLambdaTable)[currentMaterialIndex])->GetValue(e, b);
     504  } else {
     505    x = currentModel->CrossSection(currentCouple,p,e);
    338506  }
     507  if(x > DBL_MIN) x = 1./x;
     508  else            x = DBL_MAX;
     509  return x;
    339510}
    340511
     
    349520  G4double x = currentMinimalStep;
    350521  DefineMaterial(track.GetMaterialCutsCouple());
    351   currentModel = SelectModel(scaledKinEnergy);
     522  currentModel = static_cast<G4VMscModel*>(SelectModel(scaledKinEnergy));
    352523  if(x > 0.0 && scaledKinEnergy > 0.0) {
    353524    G4double tPathLength =
     
    364535//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    365536
    366 inline G4double G4VMultipleScattering::ContinuousStepLimit(
    367                                        const G4Track& track,
    368                                        G4double previousStepSize,
    369                                        G4double currentMinimalStep,
    370                                        G4double& currentSafety)
    371 {
    372   return GetMscContinuousStepLimit(track,previousStepSize,currentMinimalStep,
    373                                    currentSafety);
    374 }
    375 
    376 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    377 
    378537inline
    379 G4double G4VMultipleScattering::GetLambda(const G4ParticleDefinition* p,
    380                                           G4double& e)
    381 {
    382   G4double x;
    383   if(theLambdaTable) {
    384     G4bool b;
    385     x = ((*theLambdaTable)[currentMaterialIndex])->GetValue(e, b);
    386   } else {
    387     x = currentModel->CrossSection(currentCouple,p,e);
     538void G4VMultipleScattering::DefineMaterial(const G4MaterialCutsCouple* couple)
     539{
     540  if(couple != currentCouple) {
     541    currentCouple   = couple;
     542    currentMaterialIndex = couple->GetIndex();
    388543  }
    389   if(x > DBL_MIN) x = 1./x;
    390   else            x = DBL_MAX;
    391   return x;
    392 }
    393 
    394 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    395 
    396 inline G4VEmModel* G4VMultipleScattering::SelectModel(G4double kinEnergy)
    397 {
    398   return modelManager->SelectModel(kinEnergy, currentMaterialIndex);
    399 }
    400 
    401 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    402 
    403 inline G4VEmModel* G4VMultipleScattering::SelectModelForMaterial(
    404                    G4double kinEnergy, size_t& idxRegion) const
    405 {
    406   return modelManager->SelectModel(kinEnergy, idxRegion);
    407 }
    408 
    409 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    410 
    411 inline void G4VMultipleScattering::SetBinning(G4int nbins)
    412 {
    413   nBins = nbins;
    414 }
    415 
    416 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    417 
    418 inline G4int G4VMultipleScattering::Binning() const
    419 {
    420   return nBins;
    421 }
    422 
    423 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    424 
    425 inline void G4VMultipleScattering::SetMinKinEnergy(G4double e)
    426 {
    427   minKinEnergy = e;
    428 }
    429 
    430 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    431 
    432 inline G4double G4VMultipleScattering::MinKinEnergy() const
    433 {
    434   return minKinEnergy;
    435 }
    436 
    437 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    438 
    439 inline void G4VMultipleScattering::SetMaxKinEnergy(G4double e)
    440 {
    441   maxKinEnergy = e;
    442 }
    443 
    444 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    445 
    446 inline G4double G4VMultipleScattering::MaxKinEnergy() const
    447 {
    448   return maxKinEnergy;
    449 }
    450 
    451 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    452 
    453 inline  G4bool G4VMultipleScattering::LateralDisplasmentFlag() const
    454 {
    455   return latDisplasment;
    456 }
    457 
    458 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    459 
    460 inline  void G4VMultipleScattering::SetLateralDisplasmentFlag(G4bool val)
    461 {
    462   latDisplasment = val;
    463 }
    464 
    465 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    466 
    467 inline G4ParticleChangeForMSC* G4VMultipleScattering::GetParticleChange()
    468 {
    469   return &fParticleChange;
    470 }
    471 
    472 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    473 
    474 inline  G4double G4VMultipleScattering::Skin() const
    475 {
    476   return skin;
    477 }
    478 
    479 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    480 
    481 inline  void G4VMultipleScattering::SetSkin(G4double val)
    482 {
    483   if(val < 1.0) skin = 0.0;
    484   else          skin = val;
    485 }
    486 
    487 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    488 
    489 inline  G4double G4VMultipleScattering::RangeFactor() const
    490 {
    491   return facrange;
    492 }
    493 
    494 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    495 
    496 inline  void G4VMultipleScattering::SetRangeFactor(G4double val)
    497 {
    498   if(val > 0.0) facrange = val;
    499 }
    500 
    501 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    502 
    503 inline  G4double G4VMultipleScattering::GeomFactor() const
    504 {
    505   return facgeom;
    506 }
    507 
    508 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    509 
    510 inline  void G4VMultipleScattering::SetGeomFactor(G4double val)
    511 {
    512   if(val > 0.0) facgeom = val;
    513 }
    514 
    515 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    516 
    517 inline  G4double G4VMultipleScattering::PolarAngleLimit() const
    518 {
    519   return polarAngleLimit;
    520 }
    521 
    522 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    523 
    524 inline  void G4VMultipleScattering::SetPolarAngleLimit(G4double val)
    525 {
    526   if(val < 0.0)     polarAngleLimit = 0.0;
    527   else if(val > pi) polarAngleLimit = pi;
    528   else              polarAngleLimit = val;
    529 }
    530 
    531 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    532 
    533 inline G4MscStepLimitType G4VMultipleScattering::StepLimitType() const
    534 {
    535   return stepLimit;
    536 }
    537 
    538 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    539 
    540 inline void G4VMultipleScattering::SetStepLimitType(G4MscStepLimitType val)
    541 {
    542   stepLimit = val;
    543   if(val == fMinimal) facrange = 0.2;
    544 }
    545 
    546 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    547 
    548 inline  void G4VMultipleScattering::SetBuildLambdaTable(G4bool val)
    549 {
    550   buildLambdaTable = val;
    551 }
    552 
    553 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    554 
    555 inline  const G4ParticleDefinition* G4VMultipleScattering::Particle() const
    556 {
    557   return currentParticle;
    558 }
    559 
    560 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    561 
    562 inline G4PhysicsTable* G4VMultipleScattering::LambdaTable() const
    563 {
    564   return theLambdaTable;
    565 }
    566 
    567 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    568 
    569 inline
    570 const G4MaterialCutsCouple* G4VMultipleScattering::CurrentMaterialCutsCouple() const
     544}
     545
     546//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     547
     548inline const G4MaterialCutsCouple*
     549G4VMultipleScattering::CurrentMaterialCutsCouple() const
    571550{
    572551  return currentCouple;
     
    575554//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    576555
    577 inline void G4VMultipleScattering::AddEmModel(G4int order, G4VEmModel* p,
    578                                               const G4Region* region)
    579 {
    580   G4VEmFluctuationModel* fm = 0;
    581   modelManager->AddEmModel(order, p, fm, region);
    582   if(p) p->SetParticleChange(pParticleChange);
    583 }
    584 
    585 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    586 
    587 inline
    588 G4VEmModel* G4VMultipleScattering::GetModelByIndex(G4int idx, G4bool ver)
    589 {
    590   return modelManager->GetModel(idx, ver);
    591 }
    592 
    593 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    594 
    595556#endif
  • trunk/source/processes/electromagnetic/utils/src/G4DummyModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4DummyModel.cc,v 1.3 2007/05/22 17:31:58 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4DummyModel.cc,v 1.4 2009/04/07 18:39:47 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    5252
    5353G4DummyModel::G4DummyModel(const G4String& nam)
    54   : G4VEmModel(nam)
     54  : G4VMscModel(nam)
    5555{}
    5656
  • trunk/source/processes/electromagnetic/utils/src/G4EmCalculator.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4EmCalculator.cc,v 1.44 2008/08/03 18:47:15 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4EmCalculator.cc,v 1.46 2009/02/24 09:56:03 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    755755    if(currentProcess) currentProcessName = currentProcess->GetProcessName();
    756756
    757     if(p->GetParticleType() == "nucleus" &&
    758        currentParticleName  != "deuteron" && currentParticleName != "triton") {
     757    if(p->GetParticleType() == "nucleus"
     758       && currentParticleName != "deuteron" 
     759       && currentParticleName != "triton"
     760       && currentParticleName != "alpha+"
     761       && currentParticleName != "helium"
     762       && currentParticleName != "hydrogen"
     763      ) {
    759764      baseParticle = theGenericIon;
    760765      massRatio = baseParticle->GetPDGMass()/p->GetPDGMass();
  • trunk/source/processes/electromagnetic/utils/src/G4EmConfigurator.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4EmConfigurator.cc,v 1.3 2008/11/21 12:30:29 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4EmConfigurator.cc,v 1.4 2009/02/26 11:33:33 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    117117  G4String fname = "";
    118118  if(fm) fname = fm->GetName();
    119   AddModelForRegion(particleName, processName, mod->GetName(), regionName,
     119  G4String mname = "";
     120  if(mod) mname = mod->GetName();
     121  AddModelForRegion(particleName, processName, mname, regionName,
    120122                    emin, emax, fname);
    121123}
     
    203205
    204206        for(G4int i=0; i<nm; i++) {
    205           if(modelName == modelList[i]->GetName() &&
     207          G4String mname = "";
     208          if(modelList[i]) mname = modelList[i]->GetName();
     209          G4String fname = "";
     210          if(flucModelList[i]) fname = flucModelList[i]->GetName();
     211          if(modelName == mname && flucModelName == fname &&
    206212             (particleList[i] == "" || particleList[i] == particleName) ) {
    207213            mod  = modelList[i];
     
    214220
    215221        if(!mod) {
    216           G4cout << "### G4EmConfigurator WARNING: fails to find a model <"
    217                  << modelName << "> for process <"
    218                  << processName << "> and " << particleName
    219                  << G4endl;
    220           if(flucModelName != "") 
    221             G4cout << "                            fluctuation model <"
    222                    << flucModelName << G4endl;
     222
     223          // set fluctuation model for ionisation processes
     224          if(fluc && ptype == eloss) {
     225            G4VEnergyLossProcess* p = reinterpret_cast<G4VEnergyLossProcess*>(proc);
     226            p->SetFluctModel(fluc);
     227         
     228          } else {
     229            G4cout << "### G4EmConfigurator WARNING: fails to find a model <"
     230                   << modelName << "> for process <"
     231                   << processName << "> and " << particleName
     232                   << G4endl;
     233            if(flucModelName != "") {
     234              G4cout << "                            fluctuation model <"
     235                     << flucModelName << G4endl;
     236            }
     237          }
    223238        } else {
    224239
  • trunk/source/processes/electromagnetic/utils/src/G4EmElementSelector.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4EmElementSelector.cc,v 1.4 2008/08/21 18:53:32 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4EmElementSelector.cc,v 1.10 2009/05/26 16:59:35 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    5858                                         G4double emin,
    5959                                         G4double emax,
    60                                          G4bool spline):
     60                                         G4bool /*spline*/):
    6161  model(mod), material(mat), nbins(bins), cutEnergy(-1.0),
    6262  lowEnergy(emin), highEnergy(emax)
     
    6565  nElmMinusOne = n - 1;
    6666  theElementVector = material->GetElementVector();
     67  element = (*theElementVector)[0];
    6768  if(nElmMinusOne > 0) {
    68     for(G4int i=0; i<nElmMinusOne; i++) {
     69    xSections.reserve(n);
     70    for(G4int i=0; i<n; i++) {
    6971      G4PhysicsLogVector* v = new G4PhysicsLogVector(lowEnergy,highEnergy,nbins);
    70       v->SetSpline(spline);
     72      //v->SetSpline(spline);
    7173      xSections.push_back(v);
    7274    }
     
    8082{
    8183  if(nElmMinusOne > 0) {
    82     for(G4int i=0; i<nElmMinusOne; i++) {
     84    for(G4int i=0; i<=nElmMinusOne; i++) {
    8385      delete xSections[i];
    8486    }
     
    101103
    102104  G4int i;
    103   G4int n = nElmMinusOne + 1;
    104   G4double* xsec = new G4double[n]; 
    105105
    106106  // loop over bins
     
    110110    cross = 0.0;
    111111    //G4cout << "j= " << j << " e(MeV)= " << e/MeV << G4endl;
    112     for (i=0; i<n; i++) {
     112    for (i=0; i<=nElmMinusOne; i++) {
    113113      cross += theAtomNumDensityVector[i]*     
    114114        model->ComputeCrossSectionPerAtom(part, (*theElementVector)[i], e,
    115115                                          cutEnergy, e);
    116       xsec[i] = cross;
    117     }
    118     if(DBL_MIN >= cross) cross = 1.0;
    119     // normalise cross section sum
    120     for (i=0; i<nElmMinusOne; i++) {
    121       xSections[i]->PutValue(j, xsec[i]/cross);
    122       //G4cout << "i= " << i << " xs= " << xsec[i]/cross << G4endl;
     116      xSections[i]->PutValue(j, cross);
    123117    }
    124118  }
    125   delete [] xsec;
     119
     120  // xSections start from null, so use probabilities from the next bin
     121  if(DBL_MIN >= (*xSections[nElmMinusOne])[0]) {
     122    for (i=0; i<=nElmMinusOne; i++) {
     123      xSections[i]->PutValue(0, (*xSections[i])[1]);
     124    }
     125  }
     126  // xSections ends with null, so use probabilities from the previous bin
     127  if(DBL_MIN >= (*xSections[nElmMinusOne])[nbins-1]) {
     128    for (i=0; i<=nElmMinusOne; i++) {
     129      xSections[i]->PutValue(nbins-1, (*xSections[i])[nbins-2]);
     130    }
     131  }
     132  // perform normalization
     133  for(G4int j=0; j<nbins; j++) {
     134    cross = (*xSections[nElmMinusOne])[j];
     135    // only for positive X-section
     136    if(cross > DBL_MIN) {
     137      for (i=0; i<nElmMinusOne; i++) {
     138        xSections[i]->PutValue(j, (*xSections[i])[j]/cross);
     139      }
     140    }
     141  }
    126142}
    127143
     
    139155    }
    140156  } 
    141   G4cout << "Last Element in element vector"
     157  G4cout << "Last Element in element vector "
    142158         << (*theElementVector)[nElmMinusOne]->GetName()
    143159         << G4endl;
  • trunk/source/processes/electromagnetic/utils/src/G4EmModelManager.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4EmModelManager.cc,v 1.46 2008/10/13 14:56:56 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4EmModelManager.cc,v 1.49 2009/04/17 10:35:32 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    6161// 15-03-07 Add maxCutInRange (V.Ivanchenko)
    6262// 12-04-07 Add verbosity at destruction (V.Ivanchenko)
     63// 08-04-08 Fixed and simplified initialisation of G4RegionModel (VI)
    6364//
    6465// Class Description:
     
    134135  theGamma = G4Gamma::Gamma();
    135136  thePositron = G4Positron::Positron();
     137  models.reserve(4);
     138  flucModels.reserve(4);
     139  regions.reserve(4);
     140  orderOfModels.reserve(4);
     141  isUsed.reserve(4);
    136142}
    137143
     
    178184  regions.push_back(r);
    179185  orderOfModels.push_back(num);
     186  isUsed.push_back(0);
    180187  p->DefineForRegion(r);
    181188  nEmModels++;
     
    187194                                     G4double emin, G4double emax)
    188195{
    189   if (nEmModels) {
     196  if (nEmModels > 0) {
    190197    for(G4int i=0; i<nEmModels; i++) {
    191198      if(nam == models[i]->GetName()) {
     
    225232{
    226233  verboseLevel = val;
     234  G4String partname = p->GetParticleName();
    227235  if(1 < verboseLevel) {
    228236    G4cout << "G4EmModelManager::Initialise() for "
    229            << p->GetParticleName()
    230            << G4endl;
     237           << partname << G4endl;
    231238  }
    232239  // Are models defined?
    233240  if(!nEmModels) {
    234     G4Exception("G4EmModelManager::Initialise without any model defined");
     241    G4Exception("G4EmModelManager::Initialise without any model defined for "+partname);
    235242  }
    236243  particle = p;
     
    271278    G4ProductionCutsTable::GetProductionCutsTable();
    272279  G4int numOfCouples = theCoupleTable->GetTableSize();
    273   idxOfRegionModels = new G4int[numOfCouples+1];
    274   idxOfRegionModels[numOfCouples] = 0;
     280  if(nRegions > 1) idxOfRegionModels = new G4int[numOfCouples];
    275281  setOfRegionModels = new G4RegionModels*[nRegions];
    276282
    277283  std::vector<G4int>    modelAtRegion(nEmModels);
    278284  std::vector<G4int>    modelOrd(nEmModels);
    279   G4DataVector          eLow(nEmModels);
     285  G4DataVector          eLow(nEmModels+1);
    280286  G4DataVector          eHigh(nEmModels);
    281   G4int nmax = nEmModels;
    282287
    283288  // Order models for regions
     
    305310            if (region) G4cout << region->GetName();
    306311            G4cout << ">  "
    307                  << " tmin(MeV)= " << tmin/MeV
    308                  << "; tmax(MeV)= " << tmax/MeV
    309                  << "; order= " << ord
    310                  << G4endl;
     312                   << " tmin(MeV)= " << tmin/MeV
     313                   << "; tmax(MeV)= " << tmax/MeV
     314                   << "; order= " << ord
     315                   << G4endl;
    311316          }
    312317       
    313           if (n == 0) n++;
    314           else {
     318          if(n > 0) {
     319
     320            // extend energy range to previous models
    315321            tmin = std::min(tmin, eHigh[n-1]);
    316             if(tmin >= tmax) push = false;
    317             else {
    318 
    319               // high energy model
    320               if(tmin == eHigh[n-1] && tmax > eHigh[n-1]) n++;
    321               else if (tmax > eHigh[n-1]) {
    322 
    323                 // compare order of models
    324                 for(G4int k = n-1; k>=0; k--) {
    325        
    326                   if (ord >= modelOrd[k]) {
    327                     tmin = std::max(tmin, eHigh[k]);           
    328                     if(k < n-1) n = k + 2;
    329                     break;
    330                   } else if (tmin > eLow[k]) {
    331                     eHigh[k] = tmin;
    332                     n = k + 2;
    333                     break;
    334                   } else if (tmin == eLow[k]) {
    335                     n = k + 1;
    336                     break;
     322            tmax = std::max(tmax, eLow[0]);
     323            //G4cout << "tmin= " << tmin << "  tmax= "
     324            //     << tmax << "  ord= " << ord <<G4endl;
     325            // empty energy range
     326            if( tmax - tmin <= eV) push = false;
     327            // low-energy model
     328            else if (tmax == eLow[0]) {
     329              push = false;
     330              insert = true;
     331              idx = 0;
     332              // resolve intersections
     333            } else if(tmin < eHigh[n-1]) {
     334              // compare order
     335              for(G4int k=0; k<n; k++) {
     336                // new model has lower application
     337                if(ord >= modelOrd[k]) {
     338                  if(tmin < eHigh[k]  && tmin >= eLow[k]) tmin = eHigh[k];
     339                  if(tmax <= eHigh[k] && tmax >  eLow[k]) tmax = eLow[k];
     340                  if(tmax > eHigh[k] && tmin < eLow[k]) {
     341                    if(tmax - eHigh[k] > eLow[k] - tmin) tmin = eHigh[k];
     342                    else tmax = eLow[k];
     343                  }
     344                  if( tmax - tmin <= eV) {
     345                    push = false;
     346                    break;
    337347                  }
    338348                }
    339                 if(tmin < eLow[0]) n = 1;
    340                 idx = n - 1;
    341 
    342                 // low energy model
    343               } else {
    344 
    345                 tmax = std::max(tmax, eLow[0]);
    346                 insert = true;
    347                 push = false;
    348                 idx = 0;
    349                 if(tmax <= eLow[0]) tmax = eLow[0];
    350                 else {
    351 
    352                   for(G4int k=0; k<n; k++) {
    353        
    354                     if (ord >= modelOrd[k]) {
    355                       if(k == 0) {
    356                         if(tmin < eLow[0]) tmax = eLow[0];
    357                         else insert = false;
    358                         break;
    359                       } else {
    360                         insert = false;
    361                         break;
    362                       }
    363                     } else if(tmax < eHigh[k]) {
    364                       idx = k;
    365                       if(k > 0) tmin = eLow[k];
    366                       eLow[k] = tmax;               
    367                       break;
    368                     } else if(tmax == eHigh[k]) {           
    369                       insert = false;
    370                       push = true;
    371                       idx = k;
    372                       if(k > 0) tmin = eLow[k];
    373                       else tmin = std::min(tmin,eLow[0]);
    374                       break;
    375                     } else {
    376                       modelAtRegion[k] = ii;
    377                       modelOrd[k] = ord;
    378                       if(k == 0) eLow[idx] = std::min(tmin,eLow[0]);
     349              }
     350              //G4cout << "tmin= " << tmin << "  tmax= "
     351              //     << tmax << "  push= " << push << " idx= " << idx <<G4endl;
     352              if(push) {
     353                if (tmax == eLow[0]) {
     354                  push = false;
     355                  insert = true;
     356                  idx = 0;
     357                  // continue resolve intersections
     358                } else if(tmin < eHigh[n-1]) {
     359                  // last energy interval
     360                  if(tmin > eLow[n-1] && tmax >= eHigh[n-1]) {
     361                    eHigh[n-1] = tmin;
     362                    // first energy interval
     363                  } else if(tmin <= eLow[0] && tmax < eHigh[0]) {
     364                    eLow[0] = tmax;
     365                    push = false;
     366                    insert = true;
     367                    idx = 0;
     368                  } else {
     369                    // find energy interval to replace
     370                    for(G4int k=0; k<n; k++) {
     371                      if(tmin <= eLow[k] && tmax >= eHigh[k]) {
     372                        push = false;
     373                        modelAtRegion[k] = ii;
     374                        modelOrd[k] = ord;
     375                        isUsed[ii] = 1;
     376                      }
    379377                    }
    380378                  }
    381379                }
    382                 if(insert && idx < n) n++;
    383                 else insert = false;
    384380              }
    385381            }
    386382          }
    387           if(n > nmax) {
    388             nmax = n;
    389             modelAtRegion.resize(nmax);
    390             modelOrd.resize(nmax);
    391             eLow.resize(nmax);
    392             eHigh.resize(nmax);
    393           }
    394383          if(insert) {
    395             for(G4int k=n-2; k>=idx; k--) {           
     384            for(G4int k=n-1; k>=idx; k--) {           
    396385              modelAtRegion[k+1] = modelAtRegion[k];
    397386              modelOrd[k+1] = modelOrd[k];
     
    400389            }
    401390          }
     391          //G4cout << "push= " << push << " insert= " << insert
     392          //<< " idx= " << idx <<G4endl;
    402393          if (push || insert) {
     394            n++;
    403395            modelAtRegion[idx] = ii;
    404396            modelOrd[idx] = ord;
    405397            eLow[idx]  = tmin;
    406398            eHigh[idx] = tmax;
     399            isUsed[ii] = 1;
    407400          }
    408401        }
     
    416409    }
    417410    eLow[0] = 0.0;
    418     if(n >= nmax) eLow.resize(nmax+1);
    419411    eLow[n] = eHigh[n-1];
    420412
     
    430422  }
    431423
     424  currRegionModel = setOfRegionModels[0];
     425
    432426  // Access to materials and build cuts
    433 
    434427  for(G4int i=0; i<numOfCouples; i++) {
    435428
     
    439432    const G4ProductionCuts* pcuts = couple->GetProductionCuts();
    440433 
    441     G4int reg = nRegions;
    442     do {reg--;} while (reg>0 && pcuts != (setr[reg]->GetProductionCuts()));
    443     idxOfRegionModels[i] = reg;
    444 
     434    G4int reg = 0;
     435    if(nRegions > 1) {
     436      reg = nRegions;
     437      do {reg--;} while (reg>0 && pcuts != (setr[reg]->GetProductionCuts()));
     438      idxOfRegionModels[i] = reg;
     439    }
    445440    if(1 < verboseLevel) {
    446441      G4cout << "G4EmModelManager::Initialise() for "
    447              << material->GetName()
    448              << " indexOfCouple= " << i
    449              << " indexOfRegion= " << reg
    450              << G4endl;
     442             << material->GetName()
     443             << " indexOfCouple= " << i
     444             << " indexOfRegion= " << reg
     445             << G4endl;
    451446    }
    452447
     
    494489
    495490  for(G4int jj=0; jj<nEmModels; jj++) {
    496     models[jj]->Initialise(particle, theCuts);
    497     if(flucModels[jj]) flucModels[jj]->InitialiseMe(particle);
    498   }
    499 
     491    if(1 == isUsed[jj]) {
     492      models[jj]->Initialise(particle, theCuts);
     493      if(flucModels[jj]) flucModels[jj]->InitialiseMe(particle);
     494    }
     495  }
    500496
    501497  if(1 < verboseLevel) {
     
    534530  }
    535531
    536   G4int reg  = idxOfRegionModels[i];
     532  G4int reg  = 0;
     533  if(nRegions > 1) reg = idxOfRegionModels[i];
    537534  const G4RegionModels* regModels = setOfRegionModels[reg];
    538535  G4int nmod = regModels->NumberOfModels();
     
    683680  }
    684681
    685   G4int reg  = idxOfRegionModels[i];
     682  G4int reg  = 0;
     683  if(nRegions > 1) reg  = idxOfRegionModels[i];
    686684  const G4RegionModels* regModels = setOfRegionModels[reg];
    687685  G4int nmod = regModels->NumberOfModels();
     
    799797    G4RegionModels* r = setOfRegionModels[i];
    800798    const G4Region* reg = r->Region();
    801     if(verb > 1 || nRegions > 1) {
    802     }
     799    //    if(verb > -1 || nRegions > 1) {
     800    // }
    803801    G4int n = r->NumberOfModels(); 
    804     if(verb > 1 || n > 0) {
     802    if(verb > -1 || n > 0) {
    805803      G4cout << "      ===== EM models for the G4Region  " << reg->GetName()
    806804             << " ======" << G4endl;;
  • trunk/source/processes/electromagnetic/utils/src/G4EmProcessOptions.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4EmProcessOptions.cc,v 1.24 2008/04/17 10:33:27 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4EmProcessOptions.cc,v 1.26 2009/02/18 14:43:27 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    5959#include "G4VMultipleScattering.hh"
    6060#include "G4Region.hh"
     61#include "G4RegionStore.hh"
    6162
    6263//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    392393//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    393394
    394 void G4EmProcessOptions::ActivateDeexcitation(G4bool val, const G4Region* r)
    395 {
    396   const std::vector<G4VEnergyLossProcess*>& v =
    397         theManager->GetEnergyLossProcessVector();
    398   std::vector<G4VEnergyLossProcess*>::const_iterator itr;
    399   for(itr = v.begin(); itr != v.end(); itr++) {
    400     G4VEnergyLossProcess* p = *itr;
    401     if(p) p->ActivateDeexcitation(val,r);
    402   }
    403   const std::vector<G4VEmProcess*>& w =
    404         theManager->GetEmProcessVector();
    405   std::vector<G4VEmProcess*>::const_iterator itp;
    406   for(itp = w.begin(); itp != w.end(); itp++) {
    407     G4VEmProcess* q = *itp;
    408     if(q) q->ActivateDeexcitation(val,r);
     395void G4EmProcessOptions::ActivateDeexcitation(const G4String& pname,
     396                                              G4bool val,
     397                                              const G4String& reg)
     398{
     399  G4RegionStore* regionStore = G4RegionStore::GetInstance();
     400  const G4Region* r = 0;
     401  if(reg == "" || reg == "World") {
     402    r = regionStore->GetRegion("DefaultRegionForTheWorld", false);
     403  } else {
     404    r = regionStore->GetRegion(reg, false);
     405  }
     406  if(!r) {
     407    G4cout << "G4EmProcessOptions::ActivateDeexcitation ERROR: G4Region <"
     408           << reg << "> not found, the command ignored" << G4endl;
     409    return;
     410  }
     411
     412  const std::vector<G4VEnergyLossProcess*>& v =
     413        theManager->GetEnergyLossProcessVector();
     414  std::vector<G4VEnergyLossProcess*>::const_iterator itr;
     415  for(itr = v.begin(); itr != v.end(); itr++) {
     416    G4VEnergyLossProcess* p = *itr;
     417    if(p) {
     418      if(pname == p->GetProcessName()) p->ActivateDeexcitation(val,r);
     419    }
     420  }
     421  const std::vector<G4VEmProcess*>& w =
     422        theManager->GetEmProcessVector();
     423  std::vector<G4VEmProcess*>::const_iterator itp;
     424  for(itp = w.begin(); itp != w.end(); itp++) {
     425    G4VEmProcess* q = *itp;
     426    if(q) {
     427      if(pname == q->GetProcessName()) q->ActivateDeexcitation(val,r);
     428    }
    409429  }
    410430}
  • trunk/source/processes/electromagnetic/utils/src/G4EnergyLossMessenger.cc

    r1007 r1055  
    2525//
    2626//
    27 // $Id: G4EnergyLossMessenger.cc,v 1.35 2008/10/20 13:27:45 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     27// $Id: G4EnergyLossMessenger.cc,v 1.37 2009/02/18 14:43:27 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030// -------------------------------------------------------------------
     
    178178  aplCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
    179179
     180  deexCmd = new G4UIcommand("/process/em/deexcitation",this);
     181  deexCmd->SetGuidance("Set deexcitation flag per process and G4Region.");
     182  deexCmd->SetGuidance("  procName  : process name");
     183  deexCmd->SetGuidance("  flag      : flag");
     184  deexCmd->SetGuidance("  regName   : G4Region name");
     185
     186  G4UIparameter* pName = new G4UIparameter("pName",'s',false);
     187  deexCmd->SetParameter(pName);
     188
     189  G4UIparameter* flag = new G4UIparameter("flag",'s',false);
     190  deexCmd->SetParameter(flag);
     191
     192  G4UIparameter* regName = new G4UIparameter("regName",'s',false);
     193  deexCmd->SetParameter(regName);
     194
    180195  dedxCmd = new G4UIcmdWithAnInteger("/process/eLoss/binsDEDX",this);
    181196  dedxCmd->SetGuidance("Set number of bins for DEDX tables");
     
    259274  delete MinSubSecCmd;
    260275  delete StepFuncCmd;
     276  delete deexCmd;
    261277  delete eLossDirectory;
    262278  delete mscDirectory;
     
    320336  }
    321337
     338  if (command == deexCmd) {
     339    G4String s1 (""), s2(""), s3("");
     340    G4bool b = false;
     341    std::istringstream is(newValue);
     342    is >> s1 >> s2 >> s3;
     343    if(s2 == "true") b = true;
     344    opt->ActivateDeexcitation(s1,b,s3);
     345  }
     346
    322347  if (command == mscCmd) {
    323348    if(newValue == "Minimal")
  • trunk/source/processes/electromagnetic/utils/src/G4LossTableBuilder.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4LossTableBuilder.cc,v 1.27 2008/07/22 15:55:15 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4LossTableBuilder.cc,v 1.28 2009/02/18 16:24:47 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    132132      G4double dedx1  = pv->GetValue(elow, b);
    133133
     134      //G4cout << "nbins= " << nbins << " dedx1= " << dedx1 << G4endl;
     135
    134136      // protection for specific cases dedx=0
    135137      if(dedx1 == 0.0) {
    136         for (size_t k=1; k<nbins; k++) {
     138        for (size_t k=1; k<nbins-1; k++) {
    137139          bin0++;
    138140          elow  = pv->GetLowEdgeEnergy(k);
     
    143145      }
    144146
     147      //G4cout << "nbins= " << nbins << " elow= " << elow << " ehigh= " << ehigh << G4endl;
    145148      // initialisation of a new vector
    146149      G4PhysicsLogVector* v = new G4PhysicsLogVector(elow, ehigh, nbins);
     150      // dedx is exect zero
     151      if(nbins <= 2) {
     152        v->PutValue(0,1000.);
     153        v->PutValue(1,2000.);
     154        G4PhysicsTableHelper::SetPhysicsVector(rangeTable, i, v);
     155        return;
     156      }
    147157      v->SetSpline(splineFlag);
    148158
  • trunk/source/processes/electromagnetic/utils/src/G4LossTableManager.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4LossTableManager.cc,v 1.95 2008/11/13 18:23:39 schaelic Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4LossTableManager.cc,v 1.96 2009/04/09 16:10:57 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    9393#include "G4EmCorrections.hh"
    9494#include "G4EmSaturation.hh"
     95#include "G4EmConfigurator.hh"
    9596#include "G4EmTableType.hh"
    9697#include "G4LossTableBuilder.hh"
     
    164165  emCorrections= new G4EmCorrections();
    165166  emSaturation = new G4EmSaturation();
     167  emConfigurator = new G4EmConfigurator();
    166168  integral = true;
    167169  integralActive = false;
     
    932934}
    933935
     936//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     937
     938G4EmConfigurator* G4LossTableManager::EmConfigurator()
     939{
     940  return emConfigurator;
     941}
     942
    934943//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
  • trunk/source/processes/electromagnetic/utils/src/G4VEmFluctuationModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VEmFluctuationModel.cc,v 1.3 2008/07/15 16:56:39 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4VEmFluctuationModel.cc,v 1.4 2009/02/19 11:25:50 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    6565}
    6666
     67void G4VEmFluctuationModel::InitialiseMe(const G4ParticleDefinition*)
     68{}
    6769
     70void G4VEmFluctuationModel::SetParticleAndCharge(const G4ParticleDefinition*,
     71                                                 G4double)
     72{}
     73
     74
  • trunk/source/processes/electromagnetic/utils/src/G4VEmModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VEmModel.cc,v 1.20 2008/11/13 23:13:18 schaelic Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4VEmModel.cc,v 1.27 2009/05/26 15:00:49 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    4141// 25.10.2005 Set default highLimit=100.TeV (V.Ivanchenko)
    4242// 06.02.2006 add method ComputeMeanFreePath() (mma)
     43// 16.02.2009 Move implementations of virtual methods to source (VI)
    4344//
    4445//
     
    5354#include "G4LossTableManager.hh"
    5455#include "G4ProductionCutsTable.hh"
     56#include "G4ParticleChangeForLoss.hh"
     57#include "G4ParticleChangeForGamma.hh"
    5558
    5659//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    6063  fluc(0), name(nam), lowLimit(0.1*keV), highLimit(100.0*TeV),
    6164  polarAngleLimit(0.0),secondaryThreshold(DBL_MAX),theLPMflag(false),
    62   pParticleChange(0),nuclearStopping(false),nsec(5)
     65  pParticleChange(0),nuclearStopping(false),
     66  currentCouple(0),currentElement(0),
     67  nsec(5),flagDeexcitation(false)
    6368{
    6469  xsec.resize(nsec);
     
    7883    }
    7984  }
     85}
     86
     87//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     88
     89G4ParticleChangeForLoss* G4VEmModel::GetParticleChangeForLoss()
     90{
     91  G4ParticleChangeForLoss* p = 0;
     92  if (pParticleChange) {
     93    p = static_cast<G4ParticleChangeForLoss*>(pParticleChange);
     94  } else {
     95    p = new G4ParticleChangeForLoss();
     96  }
     97  return p;
     98}
     99
     100//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     101
     102G4ParticleChangeForGamma* G4VEmModel::GetParticleChangeForGamma()
     103{
     104  G4ParticleChangeForGamma* p = 0;
     105  if (pParticleChange) {
     106    p = static_cast<G4ParticleChangeForGamma*>(pParticleChange);
     107  } else {
     108    p = new G4ParticleChangeForGamma();
     109  }
     110  return p;
     111}
     112
     113//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     114
     115void G4VEmModel::InitialiseElementSelectors(const G4ParticleDefinition* p,
     116                                            const G4DataVector& cuts)
     117{
     118  // initialise before run
     119  flagDeexcitation = false;
     120
     121  G4int nbins = G4int(std::log10(highLimit/lowLimit) + 0.5);
     122  if(nbins < 3) nbins = 3;
     123  G4bool spline = G4LossTableManager::Instance()->SplineFlag();
     124
     125  G4ProductionCutsTable* theCoupleTable=
     126    G4ProductionCutsTable::GetProductionCutsTable();
     127  G4int numOfCouples = theCoupleTable->GetTableSize();
     128
     129  // prepare vector
     130  if(numOfCouples > nSelectors) elmSelectors.reserve(numOfCouples);
     131
     132  // initialise vector
     133  for(G4int i=0; i<numOfCouples; i++) {
     134    const G4MaterialCutsCouple* couple =
     135      theCoupleTable->GetMaterialCutsCouple(i);
     136    const G4Material* material = couple->GetMaterial();
     137    G4int idx = couple->GetIndex();
     138
     139    // selector already exist check if should be deleted
     140    G4bool create = true;
     141    if(i < nSelectors) {
     142      if(elmSelectors[i]) {
     143        if(material == elmSelectors[i]->GetMaterial()) create = false;
     144        else delete elmSelectors[i];
     145      }
     146    } else {
     147      nSelectors++;
     148      elmSelectors.push_back(0);
     149    }
     150    if(create) {
     151      elmSelectors[i] = new G4EmElementSelector(this,material,nbins,
     152                                                lowLimit,highLimit,spline);
     153    }
     154    elmSelectors[i]->Initialise(p, cuts[idx]);
     155    //elmSelectors[i]->Dump(p);
     156  }
     157}
     158
     159//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     160
     161G4double G4VEmModel::ComputeDEDXPerVolume(const G4Material*,
     162                                          const G4ParticleDefinition*,
     163                                          G4double,G4double)
     164{
     165  return 0.0;
    80166}
    81167
     
    107193//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    108194
    109 G4double G4VEmModel::ComputeMeanFreePath(const G4ParticleDefinition* p,
    110                                          G4double ekin,
    111                                          const G4Material* material,     
    112                                          G4double emin,
    113                                          G4double emax)
    114 {
    115   G4double mfp = DBL_MAX;
    116   G4double cross = CrossSectionPerVolume(material,p,ekin,emin,emax);
    117   if (cross > DBL_MIN) mfp = 1./cross;
    118   return mfp;
    119 }
    120 
    121 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    122 
    123 void G4VEmModel::InitialiseElementSelectors(const G4ParticleDefinition* p,
    124                                             const G4DataVector& cuts)
    125 {
    126   G4int nbins = G4int(std::log10(highLimit/lowLimit) + 0.5);
    127   if(nbins < 3) nbins = 3;
    128   G4bool spline = G4LossTableManager::Instance()->SplineFlag();
    129 
    130   G4ProductionCutsTable* theCoupleTable=
    131     G4ProductionCutsTable::GetProductionCutsTable();
    132   G4int numOfCouples = theCoupleTable->GetTableSize();
    133 
    134   // prepare vector
    135   if(numOfCouples > nSelectors) {
    136     elmSelectors.resize(numOfCouples);
    137     nSelectors = numOfCouples;
    138   }
    139 
    140   // initialise vector
    141   for(G4int i=0; i<numOfCouples; i++) {
    142     const G4MaterialCutsCouple* couple =
    143       theCoupleTable->GetMaterialCutsCouple(i);
    144     const G4Material* material = couple->GetMaterial();
    145     G4int idx = couple->GetIndex();
    146 
    147     // selector already exist check if should be deleted
    148     G4bool create = true;
    149     if(elmSelectors[i]) {
    150       if(material == elmSelectors[i]->GetMaterial()) create = false;
    151       else delete elmSelectors[i];
    152     }
    153     if(create) {
    154       elmSelectors[i] = new G4EmElementSelector(this,material,nbins,
    155                                                 lowLimit,highLimit,spline);
    156     }
    157     elmSelectors[i]->Initialise(p, cuts[idx]);
    158     //elmSelectors[i]->Dump(p);
    159   }
    160 }
    161 
    162 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    163 
    164 
     195G4double G4VEmModel::ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
     196                                                G4double, G4double, G4double,
     197                                                G4double, G4double)
     198{
     199  return 0.0;
     200}
     201
     202//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     203
     204G4double G4VEmModel::MinEnergyCut(const G4ParticleDefinition*,
     205                                  const G4MaterialCutsCouple*)
     206{
     207  return 0.0;
     208}
     209
     210//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     211
     212G4double G4VEmModel::GetChargeSquareRatio(const G4ParticleDefinition* p,
     213                                          const G4Material*, G4double)
     214{
     215  G4double q = p->GetPDGCharge()/CLHEP::eplus;
     216  return q*q;
     217}
     218
     219//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     220
     221G4double G4VEmModel::GetParticleCharge(const G4ParticleDefinition* p,
     222                                       const G4Material*, G4double)
     223{
     224  return p->GetPDGCharge();
     225}
     226
     227//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     228
     229void G4VEmModel::CorrectionsAlongStep(const G4MaterialCutsCouple*,
     230                                      const G4DynamicParticle*,
     231                                      G4double&,G4double&,G4double)
     232{}
     233
     234//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     235
     236void G4VEmModel::SampleDeexcitationAlongStep(const G4Material*,
     237                                             const G4Track&,
     238                                             G4double& )
     239{}
     240
     241//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     242
     243G4double G4VEmModel::MaxSecondaryEnergy(const G4ParticleDefinition*,
     244                                        G4double kineticEnergy)
     245{
     246  return kineticEnergy;
     247}
     248
     249//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     250
     251void G4VEmModel::DefineForRegion(const G4Region*)
     252{}
     253
     254//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     255
     256void G4VEmModel::SetupForMaterial(const G4ParticleDefinition*,
     257                                  const G4Material*, G4double)
     258{}
     259
     260//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
  • trunk/source/processes/electromagnetic/utils/src/G4VEmProcess.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VEmProcess.cc,v 1.60 2008/10/17 14:46:16 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4VEmProcess.cc,v 1.66 2009/04/17 10:35:32 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    7878#include "G4Positron.hh"
    7979#include "G4PhysicsTableHelper.hh"
     80#include "G4EmConfigurator.hh"
    8081
    8182//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    9192  applyCuts(false),
    9293  startFromNull(true),
    93   nRegions(0),
    94   selectedModel(0),
     94  useDeexcitation(false),
     95  nDERegions(0),
     96  idxDERegions(0),
     97  currentModel(0),
    9598  particle(0),
    9699  currentCouple(0)
     
    100103  // Size of tables assuming spline
    101104  minKinEnergy = 0.1*keV;
    102   maxKinEnergy = 100.0*TeV;
    103   nLambdaBins  = 84;
     105  maxKinEnergy = 10.0*TeV;
     106  nLambdaBins  = 77;
    104107
    105108  // default lambda factor
     
    139142//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    140143
     144void G4VEmProcess::Clear()
     145{
     146  delete [] theEnergyOfCrossSectionMax;
     147  delete [] theCrossSectionMax;
     148  delete [] idxDERegions;
     149  theEnergyOfCrossSectionMax = 0;
     150  theCrossSectionMax = 0;
     151  idxDERegions = 0;
     152  currentCouple = 0;
     153  preStepLambda = 0.0;
     154  mfpKinEnergy  = DBL_MAX;
     155  deRegions.clear();
     156  nDERegions = 0;
     157}
     158
     159//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     160
     161void G4VEmProcess::AddEmModel(G4int order, G4VEmModel* p,
     162                              const G4Region* region)
     163{
     164  G4VEmFluctuationModel* fm = 0;
     165  modelManager->AddEmModel(order, p, fm, region);
     166  if(p) p->SetParticleChange(pParticleChange);
     167}
     168
     169//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     170
     171void G4VEmProcess::SetModel(G4VEmModel* p, G4int index)
     172{
     173  G4int n = emModels.size();
     174  if(index >= n) for(G4int i=n; i<index+1; i++) {emModels.push_back(0);}
     175  emModels[index] = p;
     176}
     177
     178//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     179
     180G4VEmModel* G4VEmProcess::Model(G4int index)
     181{
     182  G4VEmModel* p = 0;
     183  if(index >= 0 && index <  G4int(emModels.size())) p = emModels[index];
     184  return p;
     185}
     186
     187//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     188
     189void G4VEmProcess::UpdateEmModel(const G4String& nam,
     190                                 G4double emin, G4double emax)
     191{
     192  modelManager->UpdateEmModel(nam, emin, emax);
     193}
     194
     195//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     196
     197G4VEmModel* G4VEmProcess::GetModelByIndex(G4int idx, G4bool ver)
     198{
     199  return modelManager->GetModel(idx, ver);
     200}
     201
     202//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     203
    141204void G4VEmProcess::PreparePhysicsTable(const G4ParticleDefinition& part)
    142205{
     
    149212           << G4endl;
    150213  }
     214
     215  (G4LossTableManager::Instance())->EmConfigurator()->AddModels();
    151216
    152217  if(particle == &part) {
     
    159224    theCutsElectron = theCoupleTable->GetEnergyCutsVector(idxG4ElectronCut);
    160225    theCutsPositron = theCoupleTable->GetEnergyCutsVector(idxG4PositronCut);
    161     if(buildLambdaTable)
     226    if(buildLambdaTable){
    162227      theLambdaTable = G4PhysicsTableHelper::PreparePhysicsTable(theLambdaTable);
    163   }
    164 }
    165 
    166 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    167 
    168 void G4VEmProcess::Clear()
    169 {
    170   if(theEnergyOfCrossSectionMax) delete [] theEnergyOfCrossSectionMax;
    171   if(theCrossSectionMax) delete [] theCrossSectionMax;
    172   theEnergyOfCrossSectionMax = 0;
    173   theCrossSectionMax = 0;
    174   currentCouple = 0;
    175   preStepLambda = 0.0;
    176   mfpKinEnergy  = DBL_MAX;
     228    }
     229  }
     230  // Sub Cutoff and Deexcitation
     231  if (nDERegions>0) {
     232
     233    const G4ProductionCutsTable* theCoupleTable=
     234          G4ProductionCutsTable::GetProductionCutsTable();
     235    size_t numOfCouples = theCoupleTable->GetTableSize();
     236
     237    idxDERegions = new G4bool[numOfCouples];
     238
     239    for (size_t j=0; j<numOfCouples; j++) {
     240
     241      const G4MaterialCutsCouple* couple =
     242        theCoupleTable->GetMaterialCutsCouple(j);
     243      const G4ProductionCuts* pcuts = couple->GetProductionCuts();
     244      G4bool reg = false;
     245      for(G4int i=0; i<nDERegions; i++) {
     246        if(deRegions[i]) {
     247          if(pcuts == deRegions[i]->GetProductionCuts()) reg = true;
     248        }
     249      }
     250      idxDERegions[j] = reg;
     251    }
     252  }
     253  if (1 < verboseLevel && nDERegions>0) {
     254    G4cout << " Deexcitation is activated for regions: " << G4endl;
     255    for (G4int i=0; i<nDERegions; i++) {
     256      const G4Region* r = deRegions[i];
     257      G4cout << "           " << r->GetName() << G4endl;
     258    }
     259  }
    177260}
    178261
     
    237320      G4cout << *theLambdaTable << G4endl;
    238321    }
     322  }
     323}
     324
     325//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     326
     327void G4VEmProcess::PrintInfoDefinition()
     328{
     329  if(verboseLevel > 0) {
     330    G4cout << G4endl << GetProcessName() << ":   for  "
     331           << particle->GetParticleName();
     332    if(integral) G4cout << ", integral: 1 ";
     333    if(applyCuts) G4cout << ", applyCuts: 1 ";
     334    G4cout << "    SubType= " << GetProcessSubType() << G4endl;
     335    if(buildLambdaTable) {
     336      G4cout << "      Lambda tables from "
     337             << G4BestUnit(minKinEnergy,"Energy")
     338             << " to "
     339             << G4BestUnit(maxKinEnergy,"Energy")
     340             << " in " << nLambdaBins << " bins, spline: "
     341             << (G4LossTableManager::Instance())->SplineFlag()
     342             << G4endl;
     343    }
     344    PrintInfo();
     345    modelManager->DumpModelList(verboseLevel);
     346  }
     347
     348  if(verboseLevel > 2 && buildLambdaTable) {
     349    G4cout << "      LambdaTable address= " << theLambdaTable << G4endl;
     350    if(theLambdaTable) G4cout << (*theLambdaTable) << G4endl;
    239351  }
    240352}
     
    304416//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    305417
    306 G4double G4VEmProcess::GetMeanFreePath(const G4Track& track,
    307                                        G4double,
    308                                        G4ForceCondition* condition)
    309 {
    310   *condition = NotForced;
    311   return G4VEmProcess::MeanFreePath(track);
    312 }
    313 
    314 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    315 
    316418G4VParticleChange* G4VEmProcess::PostStepDoIt(const G4Track& track,
    317419                                              const G4Step&)
     
    342444  }
    343445
    344   G4VEmModel* currentModel = SelectModel(finalT);
    345 
     446  SelectModel(finalT);
     447  if(useDeexcitation) {
     448    currentModel->SetDeexcitationFlag(idxDERegions[currentMaterialIndex]);
     449  }
    346450  /* 
    347451  if(0 < verboseLevel) {
     
    404508//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    405509
    406 void G4VEmProcess::PrintInfoDefinition()
    407 {
    408   if(verboseLevel > 0) {
    409     G4cout << G4endl << GetProcessName() << ":   for  "
    410            << particle->GetParticleName();
    411     if(integral) G4cout << ", integral: 1 ";
    412     if(applyCuts) G4cout << ", applyCuts: 1 ";
    413     G4cout << "    SubType= " << GetProcessSubType() << G4endl;
    414     if(buildLambdaTable) {
    415       G4cout << "      Lambda tables from "
    416              << G4BestUnit(minKinEnergy,"Energy")
    417              << " to "
    418              << G4BestUnit(maxKinEnergy,"Energy")
    419              << " in " << nLambdaBins << " bins, spline: "
    420              << (G4LossTableManager::Instance())->SplineFlag()
    421              << G4endl;
    422     }
    423     PrintInfo();
    424     modelManager->DumpModelList(verboseLevel);
    425   }
    426 
    427   if(verboseLevel > 2 && buildLambdaTable) {
    428     G4cout << "      LambdaTable address= " << theLambdaTable << G4endl;
    429     if(theLambdaTable) G4cout << (*theLambdaTable) << G4endl;
    430   }
    431 }
    432 
    433 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    434 
    435 G4double G4VEmProcess::CrossSectionPerVolume(G4double kineticEnergy,
    436                                              const G4MaterialCutsCouple* couple)
    437 {
    438   // Cross section per atom is calculated
    439   DefineMaterial(couple);
    440   G4double cross = 0.0;
    441   G4bool b;
    442   if(theLambdaTable) {
    443     cross = (((*theLambdaTable)[currentMaterialIndex])->
    444                            GetValue(kineticEnergy, b));
    445   } else {
    446     G4VEmModel* model = SelectModel(kineticEnergy);
    447     cross =
    448       model->CrossSectionPerVolume(currentMaterial,particle,kineticEnergy);
    449   }
    450 
    451   return cross;
    452 }
    453 
    454 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    455 
    456510G4bool G4VEmProcess::StorePhysicsTable(const G4ParticleDefinition* part,
    457511                                       const G4String& directory,
     
    521575
    522576  return yes;
     577}
     578
     579//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     580
     581void G4VEmProcess::ActivateDeexcitation(G4bool val, const G4Region* r)
     582{
     583  G4RegionStore* regionStore = G4RegionStore::GetInstance();
     584  const G4Region* reg = r;
     585  if (!reg) {reg = regionStore->GetRegion("DefaultRegionForTheWorld", false);}
     586
     587  // the region is in the list
     588  if (nDERegions) {
     589    for (G4int i=0; i<nDERegions; i++) {
     590      if (reg == deRegions[i]) {
     591        if(!val) deRegions[i] = 0;
     592        return;
     593      }
     594    }
     595  }
     596
     597  // new region
     598  if(val) {
     599    useDeexcitation = true;
     600    deRegions.push_back(reg);
     601    nDERegions++;
     602  } else {
     603    useDeexcitation = false;
     604  }
     605}
     606
     607//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     608
     609G4double G4VEmProcess::CrossSectionPerVolume(G4double kineticEnergy,
     610                                             const G4MaterialCutsCouple* couple)
     611{
     612  // Cross section per atom is calculated
     613  DefineMaterial(couple);
     614  G4double cross = 0.0;
     615  G4bool b;
     616  if(theLambdaTable) {
     617    cross = (((*theLambdaTable)[currentMaterialIndex])->
     618                           GetValue(kineticEnergy, b));
     619  } else {
     620    SelectModel(kineticEnergy);
     621    cross = currentModel->CrossSectionPerVolume(currentMaterial,
     622                                                particle,kineticEnergy);
     623  }
     624
     625  return cross;
     626}
     627
     628//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     629
     630G4double G4VEmProcess::GetMeanFreePath(const G4Track& track,
     631                                       G4double,
     632                                       G4ForceCondition* condition)
     633{
     634  *condition = NotForced;
     635  return G4VEmProcess::MeanFreePath(track);
    523636}
    524637
  • trunk/source/processes/electromagnetic/utils/src/G4VEnergyLossProcess.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VEnergyLossProcess.cc,v 1.143 2008/10/17 14:46:16 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4VEnergyLossProcess.cc,v 1.149 2009/04/17 10:35:32 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    142142#include "G4SafetyHelper.hh"
    143143#include "G4TransportationManager.hh"
     144#include "G4EmConfigurator.hh"
    144145
    145146//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    150151  secondaryParticle(0),
    151152  nSCoffRegions(0),
     153  nDERegions(0),
    152154  idxSCoffRegions(0),
     155  idxDERegions(0),
    153156  nProcesses(0),
    154157  theDEDXTable(0),
     
    176179  isIonisation(true),
    177180  useSubCutoff(false),
     181  useDeexcitation(false),
    178182  particle(0),
    179183  currentCouple(0),
     
    188192  // Size of tables assuming spline
    189193  minKinEnergy     = 0.1*keV;
    190   maxKinEnergy     = 100.0*TeV;
    191   nBins            = 84;
     194  maxKinEnergy     = 10.0*TeV;
     195  nBins            = 77;
    192196  maxKinEnergyCSDA = 1.0*GeV;
    193197  nBinsCSDA        = 35;
     
    237241           << G4endl;
    238242  delete vstrag;
    239   Clear();
     243  Clean();
    240244
    241245  if ( !baseParticle ) {
     
    291295//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    292296
    293 void G4VEnergyLossProcess::Clear()
     297void G4VEnergyLossProcess::Clean()
    294298{
    295299  if(1 < verboseLevel) {
     
    302306  delete [] theCrossSectionMax;
    303307  delete [] idxSCoffRegions;
     308  delete [] idxDERegions;
    304309
    305310  theDEDXAtMaxEnergy = 0;
     
    312317  scProcesses.clear();
    313318  nProcesses = 0;
     319}
     320
     321//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     322
     323G4double G4VEnergyLossProcess::MinPrimaryEnergy(const G4ParticleDefinition*,
     324                                                const G4Material*,
     325                                                G4double cut)
     326{
     327  return cut;
     328}
     329
     330//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     331
     332void G4VEnergyLossProcess::AddEmModel(G4int order, G4VEmModel* p,
     333                                      G4VEmFluctuationModel* fluc,
     334                                      const G4Region* region)
     335{
     336  modelManager->AddEmModel(order, p, fluc, region);
     337  if(p) p->SetParticleChange(pParticleChange, fluc);
     338}
     339
     340//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     341
     342void G4VEnergyLossProcess::UpdateEmModel(const G4String& nam,
     343                                         G4double emin, G4double emax)
     344{
     345  modelManager->UpdateEmModel(nam, emin, emax);
     346}
     347
     348//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     349
     350void G4VEnergyLossProcess::SetEmModel(G4VEmModel* p, G4int index)
     351{
     352  G4int n = emModels.size();
     353  if(index >= n) for(G4int i=n; i<index+1; i++) {emModels.push_back(0);}
     354  emModels[index] = p;
     355}
     356
     357//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     358
     359G4VEmModel* G4VEnergyLossProcess::EmModel(G4int index)
     360{
     361  G4VEmModel* p = 0;
     362  if(index >= 0 && index <  G4int(emModels.size())) p = emModels[index];
     363  return p;
     364}
     365
     366//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     367
     368G4VEmModel* G4VEnergyLossProcess::GetModelByIndex(G4int idx, G4bool ver)
     369{
     370  return modelManager->GetModel(idx, ver);
     371}
     372
     373//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     374
     375G4int G4VEnergyLossProcess::NumberOfModels()
     376{
     377  return modelManager->NumberOfModels();
    314378}
    315379
     
    364428  }
    365429
    366   Clear();
     430  Clean();
     431  lManager->EmConfigurator()->AddModels();
    367432
    368433  // Base particle and set of models can be defined here
     
    407472                                     minSubRange, verboseLevel);
    408473
    409   // Sub Cutoff Regime
    410   if (nSCoffRegions>0) {
     474  // Sub Cutoff and Deexcitation
     475  if (nSCoffRegions>0 || nDERegions>0) {
    411476    theSubCuts = modelManager->SubCutoff();
    412477
     
    414479          G4ProductionCutsTable::GetProductionCutsTable();
    415480    size_t numOfCouples = theCoupleTable->GetTableSize();
    416     idxSCoffRegions = new G4int[numOfCouples];
     481
     482    if(nSCoffRegions>0) idxSCoffRegions = new G4bool[numOfCouples];
     483    if(nDERegions>0) idxDERegions = new G4bool[numOfCouples];
    417484 
    418485    for (size_t j=0; j<numOfCouples; j++) {
     
    421488        theCoupleTable->GetMaterialCutsCouple(j);
    422489      const G4ProductionCuts* pcuts = couple->GetProductionCuts();
    423       G4int reg = 0;
    424       for(G4int i=0; i<nSCoffRegions; i++) {
    425         if( pcuts == scoffRegions[i]->GetProductionCuts()) reg = 1;
    426       }
    427       idxSCoffRegions[j] = reg;
     490     
     491      if(nSCoffRegions>0) {
     492        G4bool reg = false;
     493        for(G4int i=0; i<nSCoffRegions; i++) {
     494          if( pcuts == scoffRegions[i]->GetProductionCuts()) reg = true;
     495        }
     496        idxSCoffRegions[j] = reg;
     497      }
     498      if(nDERegions>0) {
     499        G4bool reg = false;
     500        for(G4int i=0; i<nDERegions; i++) {
     501          if( pcuts == deRegions[i]->GetProductionCuts()) reg = true;
     502        }
     503        idxDERegions[j] = reg;
     504      }
    428505    }
    429506  }
     
    445522      }
    446523    }
     524    if (nDERegions) {
     525      G4cout << " Deexcitation is ON for regions: " << G4endl;
     526      for (G4int i=0; i<nDERegions; i++) {
     527        const G4Region* r = deRegions[i];
     528        G4cout << "           " << r->GetName() << G4endl;
     529      }
     530    }
    447531  }
    448532}
     
    479563    if(isIonisation) G4cout << "  isIonisation  flag = 1";
    480564    G4cout << G4endl;
    481   }
    482 }
    483 
    484 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    485 
    486 void G4VEnergyLossProcess::ActivateSubCutoff(G4bool val, const G4Region* r)
    487 {
    488   G4RegionStore* regionStore = G4RegionStore::GetInstance();
    489   if(val) {
    490     useSubCutoff = true;
    491     if (!r) {r = regionStore->GetRegion("DefaultRegionForTheWorld", false);}
    492     if (nSCoffRegions) {
    493       for (G4int i=0; i<nSCoffRegions; i++) {
    494         if (r == scoffRegions[i]) return;
    495       }
    496     }
    497     scoffRegions.push_back(r);
    498     nSCoffRegions++;
    499   } else {
    500     useSubCutoff = false;
    501565  }
    502566}
     
    640704//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    641705
    642 G4double G4VEnergyLossProcess::GetContinuousStepLimit(
    643                 const G4Track&,
    644                 G4double, G4double, G4double&)
    645 {
    646   return DBL_MAX;
     706void G4VEnergyLossProcess::PrintInfoDefinition()
     707{
     708  if(0 < verboseLevel) {
     709    G4cout << G4endl << GetProcessName() << ":   for  "
     710           << particle->GetParticleName()
     711           << "    SubType= " << GetProcessSubType()
     712           << G4endl
     713           << "      dE/dx and range tables from "
     714           << G4BestUnit(minKinEnergy,"Energy")
     715           << " to " << G4BestUnit(maxKinEnergy,"Energy")
     716           << " in " << nBins << " bins" << G4endl
     717           << "      Lambda tables from threshold to "
     718           << G4BestUnit(maxKinEnergy,"Energy")
     719           << " in " << nBins << " bins, spline: "
     720           << (G4LossTableManager::Instance())->SplineFlag()
     721           << G4endl;
     722    if(theRangeTableForLoss && isIonisation) {
     723      G4cout << "      finalRange(mm)= " << finalRange/mm
     724             << ", dRoverRange= " << dRoverRange
     725             << ", integral: " << integral
     726             << ", fluct: " << lossFluctuationFlag
     727             << ", linLossLimit= " << linLossLimit
     728             << G4endl;
     729    }
     730    PrintInfo();
     731    modelManager->DumpModelList(verboseLevel);
     732    if(theCSDARangeTable && isIonisation) {
     733      G4cout << "      CSDA range table up"
     734             << " to " << G4BestUnit(maxKinEnergyCSDA,"Energy")
     735             << " in " << nBinsCSDA << " bins" << G4endl;
     736    }
     737    if(nSCoffRegions>0 && isIonisation) {
     738      G4cout << "      Subcutoff sampling in " << nSCoffRegions
     739             << " regions" << G4endl;
     740    }
     741    if(2 < verboseLevel) {
     742      G4cout << "      DEDXTable address= " << theDEDXTable << G4endl;
     743      if(theDEDXTable && isIonisation) G4cout << (*theDEDXTable) << G4endl;
     744      G4cout << "non restricted DEDXTable address= "
     745             << theDEDXunRestrictedTable << G4endl;
     746      if(theDEDXunRestrictedTable && isIonisation) {
     747           G4cout << (*theDEDXunRestrictedTable) << G4endl;
     748      }
     749      if(theDEDXSubTable && isIonisation) {
     750        G4cout << (*theDEDXSubTable) << G4endl;
     751      }
     752      G4cout << "      CSDARangeTable address= " << theCSDARangeTable
     753             << G4endl;
     754      if(theCSDARangeTable && isIonisation) {
     755        G4cout << (*theCSDARangeTable) << G4endl;
     756      }
     757      G4cout << "      RangeTableForLoss address= " << theRangeTableForLoss
     758             << G4endl;
     759      if(theRangeTableForLoss && isIonisation) {
     760             G4cout << (*theRangeTableForLoss) << G4endl;
     761      }
     762      G4cout << "      InverseRangeTable address= " << theInverseRangeTable
     763             << G4endl;
     764      if(theInverseRangeTable && isIonisation) {
     765             G4cout << (*theInverseRangeTable) << G4endl;
     766      }
     767      G4cout << "      LambdaTable address= " << theLambdaTable << G4endl;
     768      if(theLambdaTable && isIonisation) {
     769        G4cout << (*theLambdaTable) << G4endl;
     770      }
     771      G4cout << "      SubLambdaTable address= " << theSubLambdaTable << G4endl;
     772      if(theSubLambdaTable && isIonisation) {
     773        G4cout << (*theSubLambdaTable) << G4endl;
     774      }
     775    }
     776  }
     777}
     778
     779//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     780
     781void G4VEnergyLossProcess::ActivateSubCutoff(G4bool val, const G4Region* r)
     782{
     783  G4RegionStore* regionStore = G4RegionStore::GetInstance();
     784  const G4Region* reg = r;
     785  if (!reg) {reg = regionStore->GetRegion("DefaultRegionForTheWorld", false);}
     786
     787  // the region is in the list
     788  if (nSCoffRegions) {
     789    for (G4int i=0; i<nSCoffRegions; i++) {
     790      if (reg == scoffRegions[i]) {
     791        if(!val) deRegions[i] = 0;
     792        return;
     793      }
     794    }
     795  }
     796
     797  // new region
     798  if(val) {
     799    useSubCutoff = true;
     800    scoffRegions.push_back(reg);
     801    nSCoffRegions++;
     802  } else {
     803    useSubCutoff = false;
     804  }
     805}
     806
     807//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     808
     809void G4VEnergyLossProcess::ActivateDeexcitation(G4bool val, const G4Region* r)
     810{
     811  G4RegionStore* regionStore = G4RegionStore::GetInstance();
     812  const G4Region* reg = r;
     813  if (!reg) {reg = regionStore->GetRegion("DefaultRegionForTheWorld", false);}
     814
     815  // the region is in the list
     816  if (nDERegions) {
     817    for (G4int i=0; i<nDERegions; i++) {
     818      if (reg == deRegions[i]) {
     819        if(!val) deRegions[i] = 0;
     820        return;
     821      }
     822    }
     823  }
     824
     825  // new region
     826  if(val) {
     827    useDeexcitation = true;
     828    deRegions.push_back(reg);
     829    nDERegions++;
     830  } else {
     831    useDeexcitation = false;
     832  }
    647833}
    648834
     
    674860  //  <<" stepLimit= "<<x<<G4endl;
    675861  return x;
    676 }
    677 
    678 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    679 
    680 G4double G4VEnergyLossProcess::GetMeanFreePath(
    681                              const G4Track& track,
    682                              G4double,
    683                              G4ForceCondition* condition)
    684 
    685 {
    686   *condition = NotForced;
    687   return MeanFreePath(track);
    688862}
    689863
     
    806980  if (length >= fRange) {
    807981    eloss = preStepKinEnergy;
    808     currentModel->CorrectionsAlongStep(currentCouple, dynParticle,
    809                                        eloss, esecdep, length);
     982    if (useDeexcitation) {
     983      if(idxDERegions[currentMaterialIndex]) {
     984        currentModel->SampleDeexcitationAlongStep(currentMaterial, track, eloss);
     985        if(eloss < 0.0) eloss = 0.0;
     986      }
     987    }
    810988    fParticleChange.SetProposedKineticEnergy(0.0);
    811     fParticleChange.ProposeLocalEnergyDeposit(preStepKinEnergy);
     989    fParticleChange.ProposeLocalEnergyDeposit(eloss);
    812990    return &fParticleChange;
    813991  }
     
    9341112      G4double tmax =
    9351113        std::min(currentModel->MaxSecondaryKinEnergy(dynParticle),cut);
     1114      G4double emean = eloss;
    9361115      eloss = fluc->SampleFluctuations(currentMaterial,dynParticle,
    937                                        tmax,length,eloss);
     1116                                       tmax,length,emean);
    9381117      /*                           
    9391118      if(-1 < verboseLevel)
     
    9501129  eloss += esecdep;
    9511130  if(eloss < 0.0) eloss = 0.0;
     1131
     1132  // deexcitation
     1133  else if (useDeexcitation) {
     1134    if(idxDERegions[currentMaterialIndex]) {
     1135      currentModel->SampleDeexcitationAlongStep(currentMaterial, track, eloss);
     1136      if(eloss < 0.0) eloss = 0.0;
     1137    }
     1138  }
    9521139
    9531140  // Energy balanse
     
    11061293
    11071294  SelectModel(postStepScaledEnergy);
     1295  if(useDeexcitation) {
     1296    currentModel->SetDeexcitationFlag(idxDERegions[currentMaterialIndex]);
     1297  }
     1298
    11081299  const G4DynamicParticle* dynParticle = track.GetDynamicParticle();
    11091300  G4double tcut = (*theCuts)[currentMaterialIndex];
     
    11401331//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    11411332
    1142 void G4VEnergyLossProcess::PrintInfoDefinition()
    1143 {
    1144   if(0 < verboseLevel) {
    1145     G4cout << G4endl << GetProcessName() << ":   for  "
    1146            << particle->GetParticleName()
    1147            << "    SubType= " << GetProcessSubType()
    1148            << G4endl
    1149            << "      dE/dx and range tables from "
    1150            << G4BestUnit(minKinEnergy,"Energy")
    1151            << " to " << G4BestUnit(maxKinEnergy,"Energy")
    1152            << " in " << nBins << " bins" << G4endl
    1153            << "      Lambda tables from threshold to "
    1154            << G4BestUnit(maxKinEnergy,"Energy")
    1155            << " in " << nBins << " bins, spline: "
    1156            << (G4LossTableManager::Instance())->SplineFlag()
     1333G4bool G4VEnergyLossProcess::StorePhysicsTable(
     1334       const G4ParticleDefinition* part, const G4String& directory,
     1335       G4bool ascii)
     1336{
     1337  G4bool res = true;
     1338  if ( baseParticle || part != particle ) return res;
     1339
     1340  if(!StoreTable(part,theDEDXTable,ascii,directory,"DEDX"))
     1341    {res = false;}
     1342
     1343  if(!StoreTable(part,theDEDXunRestrictedTable,ascii,directory,"DEDXnr"))
     1344    {res = false;}
     1345
     1346  if(!StoreTable(part,theDEDXSubTable,ascii,directory,"SubDEDX"))
     1347    {res = false;}
     1348
     1349  if(!StoreTable(part,theIonisationTable,ascii,directory,"Ionisation"))
     1350    {res = false;}
     1351
     1352  if(!StoreTable(part,theIonisationSubTable,ascii,directory,"SubIonisation"))
     1353    {res = false;}
     1354
     1355  if(isIonisation &&
     1356     !StoreTable(part,theCSDARangeTable,ascii,directory,"CSDARange"))
     1357    {res = false;}
     1358
     1359  if(isIonisation &&
     1360     !StoreTable(part,theRangeTableForLoss,ascii,directory,"Range"))
     1361    {res = false;}
     1362 
     1363  if(isIonisation &&
     1364     !StoreTable(part,theInverseRangeTable,ascii,directory,"InverseRange"))
     1365    {res = false;}
     1366 
     1367  if(!StoreTable(part,theLambdaTable,ascii,directory,"Lambda"))
     1368    {res = false;}
     1369
     1370  if(!StoreTable(part,theSubLambdaTable,ascii,directory,"SubLambda"))
     1371    {res = false;}
     1372
     1373  if ( res ) {
     1374    if(0 < verboseLevel) {
     1375      G4cout << "Physics tables are stored for " << particle->GetParticleName()
     1376             << " and process " << GetProcessName()
     1377             << " in the directory <" << directory
     1378             << "> " << G4endl;
     1379    }
     1380  } else {
     1381    G4cout << "Fail to store Physics Tables for "
     1382           << particle->GetParticleName()
     1383           << " and process " << GetProcessName()
     1384           << " in the directory <" << directory
     1385           << "> " << G4endl;
     1386  }
     1387  return res;
     1388}
     1389
     1390//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
     1391
     1392G4bool G4VEnergyLossProcess::RetrievePhysicsTable(
     1393       const G4ParticleDefinition* part, const G4String& directory,
     1394       G4bool ascii)
     1395{
     1396  G4bool res = true;
     1397  const G4String particleName = part->GetParticleName();
     1398
     1399  if(1 < verboseLevel) {
     1400    G4cout << "G4VEnergyLossProcess::RetrievePhysicsTable() for "
     1401           << particleName << " and process " << GetProcessName()
     1402           << "; tables_are_built= " << tablesAreBuilt
    11571403           << G4endl;
    1158     if(theRangeTableForLoss && isIonisation) {
    1159       G4cout << "      finalRange(mm)= " << finalRange/mm
    1160              << ", dRoverRange= " << dRoverRange
    1161              << ", integral: " << integral
    1162              << ", fluct: " << lossFluctuationFlag
    1163              << ", linLossLimit= " << linLossLimit
    1164              << G4endl;
    1165     }
    1166     PrintInfo();
    1167     modelManager->DumpModelList(verboseLevel);
    1168     if(theCSDARangeTable && isIonisation) {
    1169       G4cout << "      CSDA range table up"
    1170              << " to " << G4BestUnit(maxKinEnergyCSDA,"Energy")
    1171              << " in " << nBinsCSDA << " bins" << G4endl;
    1172     }
    1173     if(nSCoffRegions>0 && isIonisation) {
    1174       G4cout << "      Subcutoff sampling in " << nSCoffRegions
    1175              << " regions" << G4endl;
    1176     }
    1177     if(2 < verboseLevel) {
    1178       G4cout << "      DEDXTable address= " << theDEDXTable << G4endl;
    1179       if(theDEDXTable && isIonisation) G4cout << (*theDEDXTable) << G4endl;
    1180       G4cout << "non restricted DEDXTable address= "
    1181              << theDEDXunRestrictedTable << G4endl;
    1182       if(theDEDXunRestrictedTable && isIonisation) {
    1183            G4cout << (*theDEDXunRestrictedTable) << G4endl;
    1184       }
    1185       if(theDEDXSubTable && isIonisation) {
    1186         G4cout << (*theDEDXSubTable) << G4endl;
    1187       }
    1188       G4cout << "      CSDARangeTable address= " << theCSDARangeTable
     1404  }
     1405  if(particle == part) {
     1406
     1407    //    G4bool yes = true;
     1408    if ( !baseParticle ) {
     1409
     1410      G4bool fpi = true;
     1411      if(!RetrieveTable(part,theDEDXTable,ascii,directory,"DEDX",fpi))
     1412        {fpi = false;}
     1413
     1414      if(!RetrieveTable(part,theIonisationTable,ascii,directory,"Ionisation",false))
     1415        {fpi = false;}
     1416
     1417      if(!RetrieveTable(part,theRangeTableForLoss,ascii,directory,"Range",fpi))
     1418        {res = false;}
     1419
     1420      if(!RetrieveTable(part,theDEDXunRestrictedTable,ascii,directory,"DEDXnr",false))
     1421        {res = false;}
     1422
     1423      if(!RetrieveTable(part,theCSDARangeTable,ascii,directory,"CSDARange",false))
     1424        {res = false;}
     1425
     1426      if(!RetrieveTable(part,theInverseRangeTable,ascii,directory,"InverseRange",fpi))
     1427        {res = false;}
     1428
     1429      if(!RetrieveTable(part,theLambdaTable,ascii,directory,"Lambda",true))
     1430        {res = false;}
     1431
     1432      G4bool yes = false;
     1433      if(nSCoffRegions > 0) {yes = true;}
     1434
     1435      if(!RetrieveTable(part,theDEDXSubTable,ascii,directory,"SubDEDX",yes))
     1436        {res = false;}
     1437
     1438      if(!RetrieveTable(part,theSubLambdaTable,ascii,directory,"SubLambda",yes))
     1439        {res = false;}
     1440
     1441      if(!fpi) yes = false;
     1442      if(!RetrieveTable(part,theIonisationSubTable,ascii,directory,"SubIonisation",yes))
     1443        {res = false;}
     1444    }
     1445  }
     1446
     1447  return res;
     1448}
     1449
     1450//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
     1451
     1452G4bool G4VEnergyLossProcess::StoreTable(const G4ParticleDefinition* part,
     1453                                        G4PhysicsTable* aTable, G4bool ascii,
     1454                                        const G4String& directory,
     1455                                        const G4String& tname)
     1456{
     1457  G4bool res = true;
     1458  if ( aTable ) {
     1459    const G4String name = GetPhysicsTableFileName(part,directory,tname,ascii);
     1460    if( !aTable->StorePhysicsTable(name,ascii)) res = false;
     1461  }
     1462  return res;
     1463}
     1464
     1465//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
     1466
     1467G4bool G4VEnergyLossProcess::RetrieveTable(const G4ParticleDefinition* part,
     1468                                           G4PhysicsTable* aTable, G4bool ascii,
     1469                                           const G4String& directory,
     1470                                           const G4String& tname,
     1471                                           G4bool mandatory)
     1472{
     1473  G4bool res = true;
     1474  G4String filename = GetPhysicsTableFileName(part,directory,tname,ascii);
     1475  G4bool yes = aTable->ExistPhysicsTable(filename);
     1476  if(yes) {
     1477    yes = G4PhysicsTableHelper::RetrievePhysicsTable(aTable,filename,ascii);
     1478    if((G4LossTableManager::Instance())->SplineFlag()) {
     1479      size_t n = aTable->length();
     1480      for(size_t i=0; i<n; i++) {(*aTable)[i]->SetSpline(true);}
     1481    }
     1482  }
     1483  if(yes) {
     1484    if (0 < verboseLevel) {
     1485      G4cout << tname << " table for " << part->GetParticleName()
     1486             << " is Retrieved from <" << filename << ">"
    11891487             << G4endl;
    1190       if(theCSDARangeTable && isIonisation) {
    1191         G4cout << (*theCSDARangeTable) << G4endl;
    1192       }
    1193       G4cout << "      RangeTableForLoss address= " << theRangeTableForLoss
     1488    }
     1489  } else {
     1490    if(mandatory) res = false;
     1491    if(mandatory || 1 < verboseLevel) {
     1492      G4cout << tname << " table for " << part->GetParticleName()
     1493             << " from file <"
     1494             << filename << "> is not Retrieved"
    11941495             << G4endl;
    1195       if(theRangeTableForLoss && isIonisation) {
    1196              G4cout << (*theRangeTableForLoss) << G4endl;
    1197       }
    1198       G4cout << "      InverseRangeTable address= " << theInverseRangeTable
    1199              << G4endl;
    1200       if(theInverseRangeTable && isIonisation) {
    1201              G4cout << (*theInverseRangeTable) << G4endl;
    1202       }
    1203       G4cout << "      LambdaTable address= " << theLambdaTable << G4endl;
    1204       if(theLambdaTable && isIonisation) {
    1205         G4cout << (*theLambdaTable) << G4endl;
    1206       }
    1207       G4cout << "      SubLambdaTable address= " << theSubLambdaTable << G4endl;
    1208       if(theSubLambdaTable && isIonisation) {
    1209         G4cout << (*theSubLambdaTable) << G4endl;
    1210       }
     1496    }
     1497  }
     1498  return res;
     1499}
     1500
     1501//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     1502
     1503G4double G4VEnergyLossProcess::GetDEDXDispersion(
     1504                                  const G4MaterialCutsCouple *couple,
     1505                                  const G4DynamicParticle* dp,
     1506                                        G4double length)
     1507{
     1508  DefineMaterial(couple);
     1509  G4double ekin = dp->GetKineticEnergy();
     1510  SelectModel(ekin*massRatio);
     1511  G4double tmax = currentModel->MaxSecondaryKinEnergy(dp);
     1512  tmax = std::min(tmax,(*theCuts)[currentMaterialIndex]);
     1513  G4double d = 0.0;
     1514  G4VEmFluctuationModel* fm = currentModel->GetModelOfFluctuations();
     1515  if(fm) d = fm->Dispersion(currentMaterial,dp,tmax,length);
     1516  return d;
     1517}
     1518
     1519//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     1520
     1521G4double G4VEnergyLossProcess::CrossSectionPerVolume(
     1522         G4double kineticEnergy, const G4MaterialCutsCouple* couple)
     1523{
     1524  // Cross section per volume is calculated
     1525  DefineMaterial(couple);
     1526  G4double cross = 0.0;
     1527  G4bool b;
     1528  if(theLambdaTable) {
     1529    cross =
     1530      ((*theLambdaTable)[currentMaterialIndex])->GetValue(kineticEnergy, b);
     1531  } else {
     1532    SelectModel(kineticEnergy);
     1533    cross =
     1534      currentModel->CrossSectionPerVolume(currentMaterial,
     1535                                          particle, kineticEnergy,
     1536                                          (*theCuts)[currentMaterialIndex]);
     1537  }
     1538
     1539  return cross;
     1540}
     1541
     1542//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     1543
     1544G4double G4VEnergyLossProcess::MeanFreePath(const G4Track& track)
     1545{
     1546  DefineMaterial(track.GetMaterialCutsCouple());
     1547  preStepLambda = GetLambdaForScaledEnergy(track.GetKineticEnergy()*massRatio);
     1548  G4double x = DBL_MAX;
     1549  if(DBL_MIN < preStepLambda) x = 1.0/preStepLambda;
     1550  return x;
     1551}
     1552
     1553//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     1554
     1555G4double G4VEnergyLossProcess::ContinuousStepLimit(const G4Track& track,
     1556                                                   G4double x, G4double y,
     1557                                                   G4double& z)
     1558{
     1559  G4GPILSelection sel;
     1560  return AlongStepGetPhysicalInteractionLength(track, x, y, z, &sel);
     1561}
     1562
     1563//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     1564
     1565G4double G4VEnergyLossProcess::GetMeanFreePath(
     1566                             const G4Track& track,
     1567                             G4double,
     1568                             G4ForceCondition* condition)
     1569
     1570{
     1571  *condition = NotForced;
     1572  return MeanFreePath(track);
     1573}
     1574
     1575//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     1576
     1577G4double G4VEnergyLossProcess::GetContinuousStepLimit(
     1578                const G4Track&,
     1579                G4double, G4double, G4double&)
     1580{
     1581  return DBL_MAX;
     1582}
     1583
     1584//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     1585
     1586G4PhysicsVector* G4VEnergyLossProcess::LambdaPhysicsVector(
     1587                 const G4MaterialCutsCouple* couple, G4double cut)
     1588{
     1589  //  G4double cut  = (*theCuts)[couple->GetIndex()];
     1590  //  G4int nbins = nLambdaBins;
     1591  G4double tmin =
     1592    std::max(MinPrimaryEnergy(particle, couple->GetMaterial(), cut),
     1593             minKinEnergy);
     1594  if(tmin >= maxKinEnergy) tmin = 0.5*maxKinEnergy;
     1595  G4PhysicsVector* v = new G4PhysicsLogVector(tmin, maxKinEnergy, nBins);
     1596  v->SetSpline((G4LossTableManager::Instance())->SplineFlag());
     1597
     1598  return v;
     1599}
     1600
     1601//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     1602 
     1603void G4VEnergyLossProcess::AddCollaborativeProcess(
     1604            G4VEnergyLossProcess* p)
     1605{
     1606  G4bool add = true;
     1607  if(p->GetProcessName() != "eBrem") add = false;
     1608  if(add && nProcesses > 0) {
     1609    for(G4int i=0; i<nProcesses; i++) {
     1610      if(p == scProcesses[i]) {
     1611        add = false;
     1612        break;
     1613      }
     1614    }
     1615  }
     1616  if(add) {
     1617    scProcesses.push_back(p);
     1618    nProcesses++;
     1619    if (1 < verboseLevel) {
     1620      G4cout << "### The process " << p->GetProcessName()
     1621             << " is added to the list of collaborative processes of "
     1622             << GetProcessName() << G4endl;
    12111623    }
    12121624  }
     
    13771789//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    13781790
    1379 G4PhysicsVector* G4VEnergyLossProcess::LambdaPhysicsVector(
    1380                  const G4MaterialCutsCouple* couple, G4double cut)
    1381 {
    1382   //  G4double cut  = (*theCuts)[couple->GetIndex()];
    1383   //  G4int nbins = nLambdaBins;
    1384   G4double tmin =
    1385     std::max(MinPrimaryEnergy(particle, couple->GetMaterial(), cut),
    1386              minKinEnergy);
    1387   if(tmin >= maxKinEnergy) tmin = 0.5*maxKinEnergy;
    1388   G4PhysicsVector* v = new G4PhysicsLogVector(tmin, maxKinEnergy, nBins);
    1389   v->SetSpline((G4LossTableManager::Instance())->SplineFlag());
    1390 
    1391   return v;
    1392 }
    1393 
    1394 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    1395 
    1396 G4double G4VEnergyLossProcess::CrossSectionPerVolume(
    1397          G4double kineticEnergy, const G4MaterialCutsCouple* couple)
    1398 {
    1399   // Cross section per volume is calculated
    1400   DefineMaterial(couple);
    1401   G4double cross = 0.0;
    1402   G4bool b;
    1403   if(theLambdaTable) {
    1404     cross =
    1405       ((*theLambdaTable)[currentMaterialIndex])->GetValue(kineticEnergy, b);
    1406   } else {
    1407     SelectModel(kineticEnergy);
    1408     cross =
    1409       currentModel->CrossSectionPerVolume(currentMaterial,
    1410                                           particle, kineticEnergy,
    1411                                           (*theCuts)[currentMaterialIndex]);
    1412   }
    1413 
    1414   return cross;
    1415 }
    1416 
    1417 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    1418 
    1419 G4bool G4VEnergyLossProcess::StorePhysicsTable(
    1420        const G4ParticleDefinition* part, const G4String& directory,
    1421        G4bool ascii)
    1422 {
    1423   G4bool res = true;
    1424   if ( baseParticle || part != particle ) return res;
    1425 
    1426   if(!StoreTable(part,theDEDXTable,ascii,directory,"DEDX"))
    1427     {res = false;}
    1428 
    1429   if(!StoreTable(part,theDEDXunRestrictedTable,ascii,directory,"DEDXnr"))
    1430     {res = false;}
    1431 
    1432   if(!StoreTable(part,theDEDXSubTable,ascii,directory,"SubDEDX"))
    1433     {res = false;}
    1434 
    1435   if(!StoreTable(part,theIonisationTable,ascii,directory,"Ionisation"))
    1436     {res = false;}
    1437 
    1438   if(!StoreTable(part,theIonisationSubTable,ascii,directory,"SubIonisation"))
    1439     {res = false;}
    1440 
    1441   if(isIonisation &&
    1442      !StoreTable(part,theCSDARangeTable,ascii,directory,"CSDARange"))
    1443     {res = false;}
    1444 
    1445   if(isIonisation &&
    1446      !StoreTable(part,theRangeTableForLoss,ascii,directory,"Range"))
    1447     {res = false;}
    1448  
    1449   if(isIonisation &&
    1450      !StoreTable(part,theInverseRangeTable,ascii,directory,"InverseRange"))
    1451     {res = false;}
    1452  
    1453   if(!StoreTable(part,theLambdaTable,ascii,directory,"Lambda"))
    1454     {res = false;}
    1455 
    1456   if(!StoreTable(part,theSubLambdaTable,ascii,directory,"SubLambda"))
    1457     {res = false;}
    1458 
    1459   if ( res ) {
    1460     if(0 < verboseLevel) {
    1461       G4cout << "Physics tables are stored for " << particle->GetParticleName()
    1462              << " and process " << GetProcessName()
    1463              << " in the directory <" << directory
    1464              << "> " << G4endl;
    1465     }
    1466   } else {
    1467     G4cout << "Fail to store Physics Tables for "
    1468            << particle->GetParticleName()
    1469            << " and process " << GetProcessName()
    1470            << " in the directory <" << directory
    1471            << "> " << G4endl;
    1472   }
    1473   return res;
    1474 }
    1475 
    1476 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
    1477 
    1478 G4bool G4VEnergyLossProcess::StoreTable(const G4ParticleDefinition* part,
    1479                                         G4PhysicsTable* aTable, G4bool ascii,
    1480                                         const G4String& directory,
    1481                                         const G4String& tname)
    1482 {
    1483   G4bool res = true;
    1484   if ( aTable ) {
    1485     const G4String name = GetPhysicsTableFileName(part,directory,tname,ascii);
    1486     if( !aTable->StorePhysicsTable(name,ascii)) res = false;
    1487   }
    1488   return res;
    1489 }
    1490 
    1491 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
    1492 
    1493 G4bool G4VEnergyLossProcess::RetrievePhysicsTable(
    1494        const G4ParticleDefinition* part, const G4String& directory,
    1495        G4bool ascii)
    1496 {
    1497   G4bool res = true;
    1498   const G4String particleName = part->GetParticleName();
    1499 
    1500   if(1 < verboseLevel) {
    1501     G4cout << "G4VEnergyLossProcess::RetrievePhysicsTable() for "
    1502            << particleName << " and process " << GetProcessName()
    1503            << "; tables_are_built= " << tablesAreBuilt
    1504            << G4endl;
    1505   }
    1506   if(particle == part) {
    1507 
    1508     //    G4bool yes = true;
    1509     if ( !baseParticle ) {
    1510 
    1511       G4bool fpi = true;
    1512       if(!RetrieveTable(part,theDEDXTable,ascii,directory,"DEDX",fpi))
    1513         {fpi = false;}
    1514 
    1515       if(!RetrieveTable(part,theIonisationTable,ascii,directory,"Ionisation",false))
    1516         {fpi = false;}
    1517 
    1518       if(!RetrieveTable(part,theRangeTableForLoss,ascii,directory,"Range",fpi))
    1519         {res = false;}
    1520 
    1521       if(!RetrieveTable(part,theDEDXunRestrictedTable,ascii,directory,"DEDXnr",false))
    1522         {res = false;}
    1523 
    1524       if(!RetrieveTable(part,theCSDARangeTable,ascii,directory,"CSDARange",false))
    1525         {res = false;}
    1526 
    1527       if(!RetrieveTable(part,theInverseRangeTable,ascii,directory,"InverseRange",fpi))
    1528         {res = false;}
    1529 
    1530       if(!RetrieveTable(part,theLambdaTable,ascii,directory,"Lambda",true))
    1531         {res = false;}
    1532 
    1533       G4bool yes = false;
    1534       if(nSCoffRegions > 0) {yes = true;}
    1535 
    1536       if(!RetrieveTable(part,theDEDXSubTable,ascii,directory,"SubDEDX",yes))
    1537         {res = false;}
    1538 
    1539       if(!RetrieveTable(part,theSubLambdaTable,ascii,directory,"SubLambda",yes))
    1540         {res = false;}
    1541 
    1542       if(!fpi) yes = false;
    1543       if(!RetrieveTable(part,theIonisationSubTable,ascii,directory,"SubIonisation",yes))
    1544         {res = false;}
    1545     }
    1546   }
    1547 
    1548   return res;
    1549 }
    1550 
    1551 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
    1552 
    1553 G4bool G4VEnergyLossProcess::RetrieveTable(const G4ParticleDefinition* part,
    1554                                            G4PhysicsTable* aTable, G4bool ascii,
    1555                                            const G4String& directory,
    1556                                            const G4String& tname,
    1557                                            G4bool mandatory)
    1558 {
    1559   G4bool res = true;
    1560   G4String filename = GetPhysicsTableFileName(part,directory,tname,ascii);
    1561   G4bool yes = aTable->ExistPhysicsTable(filename);
    1562   if(yes) {
    1563     yes = G4PhysicsTableHelper::RetrievePhysicsTable(aTable,filename,ascii);
    1564     if((G4LossTableManager::Instance())->SplineFlag()) {
    1565       size_t n = aTable->length();
    1566       for(size_t i=0; i<n; i++) {(*aTable)[i]->SetSpline(true);}
    1567     }
    1568   }
    1569   if(yes) {
    1570     if (0 < verboseLevel) {
    1571       G4cout << tname << " table for " << part->GetParticleName()
    1572              << " is Retrieved from <" << filename << ">"
    1573              << G4endl;
    1574     }
    1575   } else {
    1576     if(mandatory) res = false;
    1577     if(mandatory || 1 < verboseLevel) {
    1578       G4cout << tname << " table for " << part->GetParticleName()
    1579              << " from file <"
    1580              << filename << "> is not Retrieved"
    1581              << G4endl;
    1582     }
    1583   }
    1584   return res;
    1585 }
    1586 
    1587 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    1588  
    1589 void G4VEnergyLossProcess::AddCollaborativeProcess(
    1590             G4VEnergyLossProcess* p)
    1591 {
    1592   G4bool add = true;
    1593   if(p->GetProcessName() != "eBrem") add = false;
    1594   if(add && nProcesses > 0) {
    1595     for(G4int i=0; i<nProcesses; i++) {
    1596       if(p == scProcesses[i]) {
    1597         add = false;
    1598         break;
    1599       }
    1600     }
    1601   }
    1602   if(add) {
    1603     scProcesses.push_back(p);
    1604     nProcesses++;
    1605     if (1 < verboseLevel) {
    1606       G4cout << "### The process " << p->GetProcessName()
    1607              << " is added to the list of collaborative processes of "
    1608              << GetProcessName() << G4endl;
    1609     }
    1610   }
    1611 }
    1612 
    1613 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    1614 
    1615 G4double G4VEnergyLossProcess::GetDEDXDispersion(
    1616                                   const G4MaterialCutsCouple *couple,
    1617                                   const G4DynamicParticle* dp,
    1618                                         G4double length)
    1619 {
    1620   DefineMaterial(couple);
    1621   G4double ekin = dp->GetKineticEnergy();
    1622   SelectModel(ekin*massRatio);
    1623   G4double tmax = currentModel->MaxSecondaryKinEnergy(dp);
    1624   tmax = std::min(tmax,(*theCuts)[currentMaterialIndex]);
    1625   G4double d = 0.0;
    1626   G4VEmFluctuationModel* fm = currentModel->GetModelOfFluctuations();
    1627   if(fm) d = fm->Dispersion(currentMaterial,dp,tmax,length);
    1628   return d;
    1629 }
    1630 
    1631 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    1632 
    1633 void G4VEnergyLossProcess::ActivateDeexcitation(G4bool, const G4Region*)
    1634 {}
    1635 
    1636 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    1637 
  • trunk/source/processes/electromagnetic/utils/src/G4VMscModel.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VMscModel.cc,v 1.4 2008/03/10 18:39:45 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4VMscModel.cc,v 1.12 2009/05/10 19:36:19 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    4949
    5050#include "G4VMscModel.hh"
     51#include "G4ParticleChangeForMSC.hh"
     52#include "G4TransportationManager.hh"
    5153
    5254//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    5557G4VMscModel::G4VMscModel(const G4String& nam):
    5658  G4VEmModel(nam),
    57   facrange(0.02),
     59  safetyHelper(0),
     60  facrange(0.04),
    5861  facgeom(2.5),
    5962  facsafety(0.25),
     
    6164  dtrl(0.05),
    6265  lambdalimit(mm),
     66  geommax(1.e50*mm),
    6367  steppingAlgorithm(fUseSafety),
    6468  samplez(false),
     
    7276
    7377//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     78
     79G4ParticleChangeForMSC* G4VMscModel::GetParticleChangeForMSC()
     80{
     81  G4ParticleChangeForMSC* p = 0;
     82  if (pParticleChange) {
     83    p = static_cast<G4ParticleChangeForMSC*>(pParticleChange);
     84  } else {
     85    p = new G4ParticleChangeForMSC();
     86  }
     87  return p;
     88}
     89
     90//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     91
     92void G4VMscModel::InitialiseSafetyHelper()
     93{
     94  if(!safetyHelper) {
     95    safetyHelper = G4TransportationManager::GetTransportationManager()
     96      ->GetSafetyHelper();
     97    safetyHelper->InitialiseHelper();
     98  }
     99}
     100
     101//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     102
     103void G4VMscModel::ComputeDisplacement(G4ParticleChangeForMSC* fParticleChange, 
     104                                      const G4ThreeVector& dir,
     105                                      G4double displacement,
     106                                      G4double postsafety)
     107{
     108  const G4ThreeVector* pos = fParticleChange->GetProposedPosition();
     109  G4double r = displacement;
     110  if(r >  postsafety) {
     111    G4double newsafety = safetyHelper->ComputeSafety(*pos);
     112    if(r > newsafety) r = newsafety;
     113  }
     114  if(r > 0.) {
     115
     116    // compute new endpoint of the Step
     117    G4ThreeVector newPosition = *pos + r*dir;
     118
     119    // definitely not on boundary
     120    if(displacement == r) {
     121      safetyHelper->ReLocateWithinVolume(newPosition);
     122
     123    } else {
     124      // check safety after displacement
     125      G4double postsafety = safetyHelper->ComputeSafety(newPosition);
     126
     127      // displacement to boundary
     128      if(postsafety <= 0.0) {
     129        safetyHelper->Locate(newPosition,
     130                             *fParticleChange->GetProposedMomentumDirection());
     131
     132        // not on the boundary
     133      } else {
     134        safetyHelper->ReLocateWithinVolume(newPosition);
     135      }
     136    }
     137    fParticleChange->ProposePosition(newPosition);
     138  }
     139}
     140
     141//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     142
     143void G4VMscModel::SampleScattering(const G4DynamicParticle*, G4double)
     144{}
     145
     146//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     147
     148G4double G4VMscModel::ComputeTruePathLengthLimit(const G4Track&,
     149                                                 G4PhysicsTable*,
     150                                                 G4double)
     151{
     152  return DBL_MAX;
     153}
     154
     155//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     156
     157G4double G4VMscModel::ComputeGeomPathLength(G4double truePathLength)
     158{
     159  return truePathLength;
     160}
     161
     162//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     163
     164G4double G4VMscModel::ComputeTrueStepLength(G4double geomPathLength)
     165{
     166  return geomPathLength;
     167}
     168
     169//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     170
     171void G4VMscModel::SampleSecondaries(std::vector<G4DynamicParticle*>*,
     172                                    const G4MaterialCutsCouple*,
     173                                    const G4DynamicParticle*,
     174                                    G4double, G4double)
     175{}
     176
     177//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
  • trunk/source/processes/electromagnetic/utils/src/G4VMultipleScattering.cc

    r1007 r1055  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VMultipleScattering.cc,v 1.60 2008/11/20 20:32:40 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02 $
     26// $Id: G4VMultipleScattering.cc,v 1.66 2009/05/27 11:55:02 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    8383#include "G4GenericIon.hh"
    8484#include "G4Electron.hh"
     85#include "G4EmConfigurator.hh"
    8586
    8687//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    9495  stepLimit(fUseSafety),
    9596  skin(3.0),
    96   facrange(0.02),
     97  facrange(0.04),
    9798  facgeom(2.5),
    9899  latDisplasment(true),
     
    105106  // Size of tables assuming spline
    106107  minKinEnergy = 0.1*keV;
    107   maxKinEnergy = 100.0*TeV;
    108   nBins        = 84;
     108  maxKinEnergy = 10.0*TeV;
     109  nBins        = 77;
    109110
    110111  // default limit on polar angle
     
    132133  }
    133134  (G4LossTableManager::Instance())->DeRegister(this);
     135}
     136
     137//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     138
     139void G4VMultipleScattering::AddEmModel(G4int order, G4VEmModel* p,
     140                                       const G4Region* region)
     141{
     142  G4VEmFluctuationModel* fm = 0;
     143  modelManager->AddEmModel(order, p, fm, region);
     144  if(p) p->SetParticleChange(pParticleChange);
     145}
     146
     147//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     148
     149G4VEmModel* G4VMultipleScattering::GetModelByIndex(G4int idx, G4bool ver)
     150{
     151  return modelManager->GetModel(idx, ver);
    134152}
    135153
     
    208226           << G4endl;
    209227  }
     228
     229  (G4LossTableManager::Instance())->EmConfigurator()->AddModels();
    210230
    211231  if(firstParticle == &part) {
Note: See TracChangeset for help on using the changeset viewer.