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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/standard/src/G4LindhardSorensenData.cc (Version 11.3.0) and /processes/electromagnetic/standard/src/G4LindhardSorensenData.cc (Version 8.0.p1)


  1 //                                                  1 
  2 // *******************************************    
  3 // * License and Disclaimer                       
  4 // *                                              
  5 // * The  Geant4 software  is  copyright of th    
  6 // * the Geant4 Collaboration.  It is provided    
  7 // * conditions of the Geant4 Software License    
  8 // * LICENSE and available at  http://cern.ch/    
  9 // * include a list of copyright holders.         
 10 // *                                              
 11 // * Neither the authors of this software syst    
 12 // * institutes,nor the agencies providing fin    
 13 // * work  make  any representation or  warran    
 14 // * regarding  this  software system or assum    
 15 // * use.  Please see the license in the file     
 16 // * for the full disclaimer and the limitatio    
 17 // *                                              
 18 // * This  code  implementation is the result     
 19 // * technical work of the GEANT4 collaboratio    
 20 // * By using,  copying,  modifying or  distri    
 21 // * any work based  on the software)  you  ag    
 22 // * use  in  resulting  scientific  publicati    
 23 // * acceptance of all terms of the Geant4 Sof    
 24 // *******************************************    
 25 //                                                
 26 //                                                
 27 //--------------------------------------------    
 28 //                                                
 29 // GEANT4 Class file                              
 30 //                                                
 31 // Description: Data on stopping power            
 32 //                                                
 33 // Description: Data on stopping power            
 34 //                                                
 35 // Author:        Alexander Bagulya & Vladimir    
 36 //                                                
 37 // Creation date: 23.04.2018                      
 38 //                                                
 39 //--------------------------------------------    
 40 //                                                
 41                                                   
 42 //....oooOO0OOooo........oooOO0OOooo........oo    
 43                                                   
 44 #include "G4LindhardSorensenData.hh"              
 45 #include "G4PhysicsVector.hh"                     
 46 #include "G4PhysicsLinearVector.hh"               
 47 #include "G4Log.hh"                               
 48 #include "G4Pow.hh"                               
 49                                                   
 50 const G4int zlist[9] = {1, 10, 18, 36, 54, 66,    
 51 const G4int LVECT = 8;                            
 52 const G4int NPOINT = 41;                          
 53                                                   
 54 //....oooOO0OOooo........oooOO0OOooo........oo    
 55                                                   
 56 G4LindhardSorensenData::G4LindhardSorensenData    
 57 {                                                 
 58   g4calc = G4Pow::GetInstance();                  
 59   InitialiseData();                               
 60 }                                                 
 61                                                   
 62 //....oooOO0OOooo........oooOO0OOooo........oo    
 63                                                   
 64 G4LindhardSorensenData::~G4LindhardSorensenDat    
 65 {                                                 
 66   for(G4int i=0; i<=LVECT; ++i) { delete data[    
 67 }                                                 
 68                                                   
 69 //....oooOO0OOooo........oooOO0OOooo........oo    
 70                                                   
 71 G4double G4LindhardSorensenData::GetDeltaL(G4i    
 72 {                                                 
 73   G4int idx = 0;                                  
 74   for(; idx<LVECT; ++idx) {                       
 75     if(Z < zlist[idx+1]) { break; }               
 76   }                                               
 77   idx = std::min(idx, LVECT);                     
 78                                                   
 79   G4double x = G4Log(gamma - 1.0);                
 80   G4double y = ComputeDeltaL(idx, x);             
 81                                                   
 82   // interpolation over Z if needed               
 83   if(idx < LVECT && Z > zlist[idx]) {             
 84     G4double y1 = ComputeDeltaL(idx+1, x);        
 85     //G4cout << "idx= " << idx << " x= " << x     
 86     y += (y1 - y)*(Z - zlist[idx])/(G4double)(    
 87   }                                               
 88   y *= g4calc->Z23(Z);                            
 89   return y;                                       
 90 }                                                 
 91                                                   
 92 //....oooOO0OOooo........oooOO0OOooo........oo    
 93                                                   
 94 G4double G4LindhardSorensenData::ComputeDeltaL    
 95 {                                                 
 96   G4double y(0.0);                                
 97   if(x < xmin) {                                  
 98     G4double x1 = (data[idx])->Energy(1);         
 99     G4double ymin = (*(data[idx]))[0];            
100     G4double y1 = (*(data[idx]))[1];              
101     y = ymin + (y1 - ymin)*(x - xmin)/(x1 - xm    
102   } else if(x >= xmax) {                          
103     G4double x1 = (data[idx])->Energy(NPOINT-2    
104     G4double ymax = (*(data[idx]))[NPOINT-1];     
105     G4double y1 = (*(data[idx]))[NPOINT-2];       
106     y = y1 + (ymax - y1)*(x - x1)/(xmax - x1);    
107   } else {                                        
108     y = (data[idx])->Value(x);                    
109   }                                               
110   return y;                                       
111 }                                                 
112                                                   
113 //....oooOO0OOooo........oooOO0OOooo........oo    
114                                                   
115 void G4LindhardSorensenData::InitialiseData()     
116 {                                                 
117   xmin = G4Log(0.02);                             
118   xmax = G4Log(316.22777);                        
119                                                   
120   const G4double lsdata[9][NPOINT] = {            
121     {0.0036181621,                                
122      0.0042618872, 0.0040786701, 0.0039097273,    
123      0.0059858073, 0.0079655897, 0.0089669217,    
124      0.0085344428, 0.0087326058,  0.009780094,    
125      0.01185287,  0.012242278,  0.012507042,      
126      0.012016446,  0.011793182,  0.011612196,     
127      0.0096685612, 0.0093765113, 0.0091152632,    
128      0.0068625676, 0.0046558921, 0.0021660968,    
129      -0.015834368,  -0.03224412, -0.062296044,    
130     {-0.024837796,                                
131      -0.018943357, -0.013251703, -0.007646936,    
132      0.0027996278, 0.0057534909, 0.0078441157,    
133      0.01491866,  0.016403769,  0.018106955,      
134      0.021636244,  0.022526456,  0.023429501,     
135      0.024997337,  0.025225657,  0.025335138,     
136      0.025048151,   0.02467553,   0.02416496,     
137      0.020902526,  0.017645158,  0.013219058,     
138      -0.020223315, -0.044480728, -0.074942757,    
139     {-0.04948514,                                 
140      -0.039259418, -0.029641846, -0.022112859,    
141      -0.0031032447, 0.0023506153, 0.0058573025    
142      0.016404575,  0.018642388,  0.021492082,     
143      0.026839018,  0.028169751,  0.029240668,     
144      0.031113343,  0.031518392,  0.031657748,     
145      0.031507453,  0.031024952,  0.030410522,     
146      0.025132583,   0.02141173,  0.016127626,     
147      -0.02196456, -0.043877567, -0.070852217,     
148     {-0.07502957,                                 
149      -0.063927817, -0.053895181, -0.043621797,    
150      -0.015996122, -0.0084995741, -0.000174992    
151      0.016956954,   0.02155737,  0.025213602,     
152      0.034664781,  0.036995048,  0.038244843,     
153      0.041677336,  0.042211864,  0.042472572,     
154      0.042049893,  0.041341375,  0.040408112,     
155      0.032742289,  0.027897265,  0.020305954,     
156      -0.020344557, -0.039700638, -0.059781744,    
157     {-0.081885964,                                
158      -0.072049323,  -0.06299877, -0.053400445,    
159      -0.024723298, -0.015706543, -0.0070305988    
160      0.017338568,  0.023286722,  0.028930541,     
161      0.041512165,   0.04362858,  0.046323682,     
162      0.050501289,  0.050963981,  0.051463496,     
163      0.050350498,  0.049370817,  0.047660517,     
164      0.037009647,  0.030171627,  0.021186013,     
165      -0.01977885, -0.036354277, -0.053187271,     
166     {-0.083068958,                                
167      -0.074302116, -0.065040071, -0.056500699,    
168      -0.028666422,   -0.0192974, -0.0097949279    
169      0.01548354,  0.023483416,  0.030515545,      
170      0.045011738,  0.048259036,  0.051136495,     
171      0.056247898,  0.056729496,  0.057135059,     
172      0.055504504,  0.054134086,  0.051812977,     
173      0.038593442,   0.03027527,  0.020452704,     
174      -0.018750622, -0.033642805, -0.048788529,    
175     {-0.083061344,                                
176      -0.075180377, -0.066630961, -0.058114277,    
177      -0.031608369, -0.022553882, -0.012699373,    
178      0.013817276,  0.023132109,  0.030886148,     
179      0.048602814,  0.052502168,  0.055969817,     
180      0.061732795,  0.062844014,  0.062911637,     
181      0.060500452,  0.058323088,  0.055297604,     
182      0.038863441,  0.030302781,  0.019055839,     
183      -0.017733076, -0.031547911,  -0.04523347,    
184     {-0.082449782,                                
185      -0.07492693, -0.067041495, -0.059614338,     
186      -0.034242658, -0.025296495, -0.016157818,    
187      0.012927383,  0.021914897,   0.03053429,     
188      0.05141546,  0.056473799,  0.060050334,      
189      0.066961692,  0.067369593,  0.067623539,     
190      0.063673411,  0.061033708,  0.057399807,     
191      0.037931379,  0.028569029,  0.017544895,     
192      -0.015233268, -0.026956839, -0.038975048,    
193     {-0.081232852,                                
194      -0.074976912, -0.068421001, -0.060951614,    
195      -0.037708151, -0.029246587,  -0.02018635,    
196      0.0090831897,  0.018970381,   0.02761289,    
197      0.051067631,  0.057143777,  0.061348214,     
198      0.069155687,  0.069845259,  0.069828188,     
199      0.065486015,  0.062437523,  0.058111347,     
200      0.037571853,  0.028019555,  0.016564385,     
201      -0.015675051, -0.027353574,  -0.03931666,    
202                                                   
203   for(G4int i=0; i<=LVECT; ++i) {                 
204     data[i] = new G4PhysicsLinearVector(xmin,     
205     for(std::size_t j=0; j<NPOINT; ++j) {         
206       data[i]->PutValue(j, lsdata[i][j]);         
207     }                                             
208     data[i]->FillSecondDerivatives();             
209   }                                               
210 }                                                 
211                                                   
212 //....oooOO0OOooo........oooOO0OOooo........oo    
213