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 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /processes/electromagnetic/lowenergy/src/G4hBetheBlochModel.cc (Version 11.3.0) and /processes/electromagnetic/lowenergy/src/G4hBetheBlochModel.cc (Version 10.6.p1)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 //                                                 26 //
 27 // -------------------------------------------     27 // -------------------------------------------------------------------
 28 //                                                 28 //
 29 // GEANT4 Class file                               29 // GEANT4 Class file
 30 //                                                 30 //
 31 //                                                 31 //
 32 // File name:     G4hBetheBlochModel               32 // File name:     G4hBetheBlochModel
 33 //                                                 33 //
 34 // Author:        V.Ivanchenko (Vladimir.Ivanc     34 // Author:        V.Ivanchenko (Vladimir.Ivanchenko@cern.ch)
 35 //                                                 35 // 
 36 // Creation date: 20 July 2000                     36 // Creation date: 20 July 2000
 37 //                                                 37 //
 38 // Modifications:                                  38 // Modifications: 
 39 // 20/07/2000  V.Ivanchenko First implementati     39 // 20/07/2000  V.Ivanchenko First implementation
 40 // 03/10/2000  V.Ivanchenko clean up accoding      40 // 03/10/2000  V.Ivanchenko clean up accoding to CodeWizard
 41 //                                                 41 //
 42 // Class Description:                              42 // Class Description: 
 43 //                                                 43 //
 44 // Bethe-Bloch ionisation model                    44 // Bethe-Bloch ionisation model
 45 //                                                 45 //
 46 // Class Description: End                          46 // Class Description: End 
 47 //                                                 47 //
 48 // -------------------------------------------     48 // -------------------------------------------------------------------
 49 //                                                 49 //
 50 //....oooOO0OOooo........oooOO0OOooo........oo     50 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 51                                                    51 
 52 #include "G4hBetheBlochModel.hh"                   52 #include "G4hBetheBlochModel.hh"
 53                                                    53 
 54 #include "globals.hh"                              54 #include "globals.hh"
 55 #include "G4PhysicalConstants.hh"                  55 #include "G4PhysicalConstants.hh"
 56 #include "G4SystemOfUnits.hh"                      56 #include "G4SystemOfUnits.hh"
 57 #include "G4DynamicParticle.hh"                    57 #include "G4DynamicParticle.hh"
 58 #include "G4ParticleDefinition.hh"                 58 #include "G4ParticleDefinition.hh"
 59 #include "G4Material.hh"                           59 #include "G4Material.hh"
 60                                                    60 
 61 //....oooOO0OOooo........oooOO0OOooo........oo     61 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 62                                                    62 
 63 G4hBetheBlochModel::G4hBetheBlochModel(const G     63 G4hBetheBlochModel::G4hBetheBlochModel(const G4String& name)
 64   : G4VLowEnergyModel(name),                   <<  64   : G4VLowEnergyModel(name), 
                                                   >>  65     lowEnergyLimit(1.*MeV),
                                                   >>  66     highEnergyLimit(100.*GeV),
 65     twoln10(2.*std::log(10.)),                     67     twoln10(2.*std::log(10.)),
 66     bg2lim(0.0169),                                68     bg2lim(0.0169), 
 67     taulim(8.4146e-3),                         <<  69     taulim(8.4146e-3)
 68     lowEnergyLimit(1.*MeV),                    << 
 69     highEnergyLimit(100.*GeV)                  << 
 70 {;}                                                70 {;}
 71                                                    71 
 72 //....oooOO0OOooo........oooOO0OOooo........oo     72 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 73                                                    73 
 74 G4hBetheBlochModel::~G4hBetheBlochModel()          74 G4hBetheBlochModel::~G4hBetheBlochModel() 
 75 {;}                                                75 {;}
 76                                                    76 
 77 //....oooOO0OOooo........oooOO0OOooo........oo     77 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 78                                                    78 
 79 G4double G4hBetheBlochModel::TheValue(const G4     79 G4double G4hBetheBlochModel::TheValue(const G4DynamicParticle* particle,
 80                                 const G4Materi     80                                 const G4Material* material) 
 81 {                                                  81 {
 82   G4double energy = particle->GetKineticEnergy     82   G4double energy = particle->GetKineticEnergy() ;
 83   G4double particleMass = particle->GetMass()      83   G4double particleMass = particle->GetMass() ;
 84                                                    84 
 85   G4double eloss  = BetheBlochFormula(material     85   G4double eloss  = BetheBlochFormula(material,energy,particleMass) ;
 86                                                    86 
 87   return eloss ;                                   87   return eloss ;
 88 }                                                  88 }
 89                                                    89 
 90 //....oooOO0OOooo........oooOO0OOooo........oo     90 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 91                                                    91 
 92 G4double G4hBetheBlochModel::TheValue(const G4     92 G4double G4hBetheBlochModel::TheValue(const G4ParticleDefinition* aParticle,
 93                                 const G4Materi     93                                 const G4Material* material,
 94               G4double kineticEnergy)              94               G4double kineticEnergy) 
 95 {                                                  95 {
 96   G4double particleMass = aParticle->GetPDGMas     96   G4double particleMass = aParticle->GetPDGMass() ;
 97   G4double eloss  = BetheBlochFormula(material     97   G4double eloss  = BetheBlochFormula(material,kineticEnergy,particleMass) ;
 98                                                    98 
 99   return eloss ;                                   99   return eloss ;
100 }                                                 100 }
101                                                   101 
102 //....oooOO0OOooo........oooOO0OOooo........oo    102 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
103                                                   103 
104 G4double G4hBetheBlochModel::HighEnergyLimit(     104 G4double G4hBetheBlochModel::HighEnergyLimit(
105                              const G4ParticleD    105                              const G4ParticleDefinition* ,
106                              const G4Material*    106                              const G4Material* ) const
107 {                                                 107 {
108   return highEnergyLimit ;                        108   return highEnergyLimit ;
109 }                                                 109 }
110                                                   110 
111 //....oooOO0OOooo........oooOO0OOooo........oo    111 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
112                                                   112 
113 G4double G4hBetheBlochModel::LowEnergyLimit(      113 G4double G4hBetheBlochModel::LowEnergyLimit(
114                              const G4ParticleD    114                              const G4ParticleDefinition* aParticle,
115                              const G4Material*    115                              const G4Material* material) const
116 {                                                 116 {
117   G4double taul = (material->GetIonisation()->    117   G4double taul = (material->GetIonisation()->GetTaul())*
118                   (aParticle->GetPDGMass()) ;     118                   (aParticle->GetPDGMass()) ;
119   return taul ;                                   119   return taul ;
120 }                                                 120 }
121                                                   121 
122 //....oooOO0OOooo........oooOO0OOooo........oo    122 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
123                                                   123 
124 G4double G4hBetheBlochModel::HighEnergyLimit(     124 G4double G4hBetheBlochModel::HighEnergyLimit(
125                              const G4ParticleD    125                              const G4ParticleDefinition* ) const
126 {                                                 126 {
127   return highEnergyLimit ;                        127   return highEnergyLimit ;
128 }                                                 128 }
129                                                   129 
130 //....oooOO0OOooo........oooOO0OOooo........oo    130 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
131                                                   131 
132 G4double G4hBetheBlochModel::LowEnergyLimit(      132 G4double G4hBetheBlochModel::LowEnergyLimit(
133                              const G4ParticleD    133                              const G4ParticleDefinition* ) const
134 {                                                 134 {
135   return lowEnergyLimit ;                         135   return lowEnergyLimit ;
136 }                                                 136 }
137                                                   137 
138 //....oooOO0OOooo........oooOO0OOooo........oo    138 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
139                                                   139  
140 G4bool G4hBetheBlochModel::IsInCharge(const G4    140 G4bool G4hBetheBlochModel::IsInCharge(const G4DynamicParticle* ,
141                           const G4Material* )     141                           const G4Material* ) const
142 {                                                 142 {
143   return true ;                                   143   return true ;
144 }                                                 144 }
145                                                   145 
146 //....oooOO0OOooo........oooOO0OOooo........oo    146 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
147                                                   147  
148 G4bool G4hBetheBlochModel::IsInCharge(const G4    148 G4bool G4hBetheBlochModel::IsInCharge(const G4ParticleDefinition* ,
149                           const G4Material* )     149                           const G4Material* ) const
150 {                                                 150 {
151   return true ;                                   151   return true ;
152 }                                                 152 }
153                                                   153 
154 //....oooOO0OOooo........oooOO0OOooo........oo    154 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
155                                                   155 
156 G4double G4hBetheBlochModel::BetheBlochFormula    156 G4double G4hBetheBlochModel::BetheBlochFormula(
157                              const G4Material*    157                              const G4Material* material,
158                                    G4double ki    158                                    G4double kineticEnergy,
159                                    G4double pa    159                                    G4double particleMass) const
160 {                                                 160 {
161   // This member function is applied normally     161   // This member function is applied normally to proton/antiproton
162   G4double ionloss ;                              162   G4double ionloss ;
163                                                   163 
164   G4double rateMass = electron_mass_c2/particl    164   G4double rateMass = electron_mass_c2/particleMass ;
165                                                   165 
166   G4double taul = material->GetIonisation()->G    166   G4double taul = material->GetIonisation()->GetTaul() ;
167   G4double tau  = kineticEnergy/particleMass ;    167   G4double tau  = kineticEnergy/particleMass ;    // tau is relative energy
168                                                   168   
169   // It is not normal case for this function      169   // It is not normal case for this function
170   // for low energy parametrisation have to be    170   // for low energy parametrisation have to be applied
171   if ( tau < taul ) tau = taul ;                  171   if ( tau < taul ) tau = taul ; 
172                                                   172     
173   // some local variables                         173   // some local variables 
174                                                   174     
175   G4double gamma,bg2,beta2,tmax,x,delta,sh ;      175   G4double gamma,bg2,beta2,tmax,x,delta,sh ;
176   G4double electronDensity = material->GetElec    176   G4double electronDensity = material->GetElectronDensity();
177   G4double eexc  = material->GetIonisation()->    177   G4double eexc  = material->GetIonisation()->GetMeanExcitationEnergy();
178   G4double eexc2 = eexc*eexc ;                    178   G4double eexc2 = eexc*eexc ;
179   G4double cden  = material->GetIonisation()->    179   G4double cden  = material->GetIonisation()->GetCdensity();
180   G4double mden  = material->GetIonisation()->    180   G4double mden  = material->GetIonisation()->GetMdensity();
181   G4double aden  = material->GetIonisation()->    181   G4double aden  = material->GetIonisation()->GetAdensity();
182   G4double x0den = material->GetIonisation()->    182   G4double x0den = material->GetIonisation()->GetX0density();
183   G4double x1den = material->GetIonisation()->    183   G4double x1den = material->GetIonisation()->GetX1density();
184   G4double* shellCorrectionVector =               184   G4double* shellCorrectionVector =
185             material->GetIonisation()->GetShel    185             material->GetIonisation()->GetShellCorrectionVector();
186                                                   186     
187   gamma = tau + 1.0 ;                             187   gamma = tau + 1.0 ;
188   bg2 = tau*(tau+2.0) ;                           188   bg2 = tau*(tau+2.0) ;
189   beta2 = bg2/(gamma*gamma) ;                     189   beta2 = bg2/(gamma*gamma) ;
190   tmax = 2.*electron_mass_c2*bg2/(1.+2.*gamma*    190   tmax = 2.*electron_mass_c2*bg2/(1.+2.*gamma*rateMass+rateMass*rateMass) ;
191                                                   191         
192   ionloss = std::log(2.0*electron_mass_c2*bg2*    192   ionloss = std::log(2.0*electron_mass_c2*bg2*tmax/eexc2)-2.0*beta2 ;
193                                                   193     
194   // density correction                           194   // density correction     
195   x = std::log(bg2)/twoln10 ;                     195   x = std::log(bg2)/twoln10 ;
196   if ( x < x0den ) {                              196   if ( x < x0den ) {
197     delta = 0.0 ;                                 197     delta = 0.0 ;
198                                                   198 
199   } else {                                        199   } else { 
200     delta = twoln10*x - cden ;                    200     delta = twoln10*x - cden ;
201     if ( x < x1den ) delta += aden*std::pow((x    201     if ( x < x1den ) delta += aden*std::pow((x1den-x),mden) ;
202   }                                               202   }
203                                                   203     
204   // shell correction                             204   // shell correction 
205   sh = 0.0 ;                                      205   sh = 0.0 ;      
206   x  = 1.0 ;                                      206   x  = 1.0 ;
207                                                   207 
208   if ( bg2 > bg2lim ) {                           208   if ( bg2 > bg2lim ) {
209     for (G4int k=0; k<=2; k++) {                  209     for (G4int k=0; k<=2; k++) {
210   x *= bg2 ;                                      210   x *= bg2 ;
211   sh += shellCorrectionVector[k]/x;               211   sh += shellCorrectionVector[k]/x;
212     }                                             212     }
213                                                   213 
214   } else {                                        214   } else {
215     for (G4int k=0; k<=2; k++) {                  215     for (G4int k=0; k<=2; k++) {
216   x *= bg2lim ;                                   216   x *= bg2lim ;
217   sh += shellCorrectionVector[k]/x;               217   sh += shellCorrectionVector[k]/x;
218     }                                             218     }
219     sh *= std::log(tau/taul)/std::log(taulim/t    219     sh *= std::log(tau/taul)/std::log(taulim/taul) ;     
220   }                                               220   }
221                                                   221     
222   // now compute the total ionization loss        222   // now compute the total ionization loss
223                                                   223     
224   ionloss -= delta + sh ;                         224   ionloss -= delta + sh ;
225   ionloss *= twopi_mc2_rcl2*electronDensity/be    225   ionloss *= twopi_mc2_rcl2*electronDensity/beta2 ;
226                                                   226 
227   if ( ionloss < 0.0) ionloss = 0.0 ;             227   if ( ionloss < 0.0) ionloss = 0.0 ;
228                                                   228   
229   return ionloss;                                 229   return ionloss;
230 }                                                 230 }
231                                                   231 
232                                                   232 
233                                                   233