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.p3 ] [ 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/include/G4GoudsmitSaundersonMscModel.hh (Version 11.3.0) and /processes/electromagnetic/standard/include/G4GoudsmitSaundersonMscModel.hh (Version 7.0)


  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 header file                       
 30 //                                                
 31 // File name:     G4GoudsmitSaundersonMscModel    
 32 //                                                
 33 // Author:        Mihaly Novak / (Omrane Kadri    
 34 //                                                
 35 // Creation date: 20.02.2009                      
 36 //                                                
 37 // Modifications:                                 
 38 // 04.03.2009 V.Ivanchenko cleanup and format     
 39 // 12.05.2010 O.Kadri: adding Qn1 and Qn12 as     
 40 // 18.05.2015 M. Novak provide PLERIMINARYY ve    
 41 //            All algorithms of the class were    
 42 //            A new version of Kawrakow-Bielaj    
 43 //            based on the screened Rutherford    
 44 //            electrons/positrons has been int    
 45 //            angular distributions over a 2D     
 46 //            and the CDFs are now stored in a    
 47 //            together with the corresponding     
 48 //            These angular distributions are     
 49 //            G4GoudsmitSaundersonTable class     
 50 //            it was no, single, few or multip    
 51 //            angular deflection (i.e. cos(the    
 52 //            Two screening options are provid    
 53 //             - if fgIsUsePWATotalXsecData=TR    
 54 //               was called before initialisat    
 55 //               determined such that the firs    
 56 //               computed according to the scr    
 57 //               scattering will reproduce the    
 58 //               and first transport mean free    
 59 //             - if fgIsUsePWATotalXsecData=FA    
 60 //               SetOptionPWAScreening(FALSE)     
 61 //               screening parameter value A i    
 62 //               formula (by using material de    
 63 //               precomputed for each material    
 64 //               G4GoudsmitSaundersonTable) [3    
 65 //            Elastic and first trasport mean     
 66 //            The new version is self-consiste    
 67 //            robust and accurate compared to     
 68 //            Spin effects as well as a more a    
 69 //            computations of Lewis moments wi    
 70 // 02.09.2015 M. Novak: first version of new s    
 71 //            fUseSafetyPlus corresponds to Ur    
 72 //            fUseDistanceToBoundary correspon    
 73 //            fUseSafety  corresponds to EGSnr    
 74 //            Range factor can be significantl    
 75 // 23.08.2017 M. Novak: added corrections to a    
 76 //            It can be activated by setting t    
 77 //            before initialization using the     
 78 //            The fMottCorrection member is re    
 79 //            correction (rejection) functions    
 80 //            Goudsmit-Saunderson agnular dist    
 81 //            effects and screening correction    
 82 //            GS angular distributions is: DCS    
 83 //               # DCS_{SR} is the relativisti    
 84 //                 solution of the Klein-Gordo    
 85 //                 scattering of spinless e- o    
 86 //                 note: the default (without     
 87 //                 are based on this DCS_{SR}     
 88 //               # DCS_{R} is the Rutherford D    
 89 //                 screening                      
 90 //               # DCS_{Mott} is the Mott DCS     
 91 //                 Coulomb potential i.e. scat    
 92 //                 point-like unscreened Coulo    
 93 //               # moreover, the screening par    
 94 //                 the DCS_{cor} with this cor    
 95 //                 transport cross sections ob    
 96 //                 (i.e. from elsepa [4])         
 97 //            Unlike the default GS, the Mott-    
 98 //            (different for e- and e+ <= the     
 99 //            (Z and material) dependent.         
100 // 02.02.2018 M. Novak: implemented CrossSecti    
101 //                                                
102 // Class description:                             
103 //   Kawrakow-Bielajew Goudsmit-Saunderson MSC    
104 //   for elastic scattering of e-/e+. Option,     
105 //   also available now (SetOptionMottCorrecti    
106 //   algorithm (UseSafety) is available beyond    
107 //   and true to geomerty and geometry to true    
108 //   from the Urban model[5]. The most accurat    
109 //   with Mott-correction (SetOptionMottCorrec    
110 //                                                
111 // References:                                    
112 //   [1] A.F.Bielajew, NIMB 111 (1996) 195-208    
113 //   [2] I.Kawrakow, A.F.Bielajew, NIMB 134(19    
114 //   [3] I.Kawrakow, E.Mainegra-Hing, D.W.O.Ro    
115 //       Report PIRS-701 (2013)                   
116 //   [4] F.Salvat, A.Jablonski, C.J. Powell, C    
117 //   [5] L.Urban, Preprint CERN-OPEN-2006-077     
118 //                                                
119 // -------------------------------------------    
120                                                   
121 #ifndef G4GoudsmitSaundersonMscModel_h            
122 #define G4GoudsmitSaundersonMscModel_h 1          
123                                                   
124 #include <CLHEP/Units/SystemOfUnits.h>            
125                                                   
126 #include "G4VMscModel.hh"                         
127 #include "G4PhysicsTable.hh"                      
128 #include "G4MaterialCutsCouple.hh"                
129 #include "globals.hh"                             
130                                                   
131                                                   
132 class G4DataVector;                               
133 class G4ParticleChangeForMSC;                     
134 class G4LossTableManager;                         
135 class G4GoudsmitSaundersonTable;                  
136 class G4GSPWACorrections;                         
137                                                   
138 class G4GoudsmitSaundersonMscModel : public G4    
139 {                                                 
140 public:                                           
141                                                   
142   G4GoudsmitSaundersonMscModel(const G4String&    
143                                                   
144   ~G4GoudsmitSaundersonMscModel() override;       
145                                                   
146   void Initialise(const G4ParticleDefinition*,    
147                                                   
148   void InitialiseLocal(const G4ParticleDefinit    
149                                                   
150   G4ThreeVector& SampleScattering(const G4Thre    
151                                                   
152   G4double ComputeTruePathLengthLimit(const G4    
153                                                   
154   G4double ComputeGeomPathLength(G4double true    
155                                                   
156   G4double ComputeTrueStepLength(G4double geom    
157                                                   
158   // method to compute first transport cross s    
159   // method is used only for testing and not d    
160   G4double CrossSectionPerVolume(const G4Mater    
161                                                   
162   void     StartTracking(G4Track*) override;      
163                                                   
164   void     SampleMSC();                           
165                                                   
166   G4double GetTransportMeanFreePath(const G4Pa    
167                                                   
168   void SetOptionPWACorrection(G4bool opt)    {    
169                                                   
170   G4bool GetOptionPWACorrection() const      {    
171                                                   
172   void   SetOptionMottCorrection(G4bool opt) {    
173                                                   
174   G4bool GetOptionMottCorrection() const     {    
175                                                   
176   G4GoudsmitSaundersonTable* GetGSTable()         
177                                                   
178   G4GSPWACorrections*        GetPWACorrection(    
179                                                   
180   //  hide assignment operator                    
181   G4GoudsmitSaundersonMscModel & operator=(con    
182   G4GoudsmitSaundersonMscModel(const  G4Goudsm    
183                                                   
184 private:                                          
185   inline void     SetParticle(const G4Particle    
186                                                   
187   inline G4double GetLambda(G4double);            
188                                                   
189   G4double GetTransportMeanFreePathOnly(const     
190                                                   
191   inline G4double Randomizetlimit();              
192                                                   
193 private:                                          
194   CLHEP::HepRandomEngine* rndmEngineMod;          
195   //                                              
196   G4double currentKinEnergy;                      
197   G4double currentRange;                          
198   //                                              
199   G4double fr;                                    
200   G4double rangeinit;                             
201   G4double geombig;                               
202   G4double geomlimit;                             
203   G4double tlimit;                                
204   G4double tgeom;                                 
205   //                                              
206   G4double par1;                                  
207   G4double par2;                                  
208   G4double par3;                                  
209   G4double tlimitminfix2;                         
210   G4double tausmall;                              
211   G4double mass;                                  
212   G4double taulim;                                
213   //                                              
214   //                                              
215   G4double presafety;                             
216   G4double fZeff;                                 
217   //                                              
218   G4int    charge;                                
219   G4int    currentMaterialIndex;                  
220   //                                              
221   G4bool   firstStep;                             
222   //                                              
223   G4LossTableManager*         theManager;         
224   const G4ParticleDefinition* particle;           
225   G4ParticleChangeForMSC*     fParticleChange;    
226   const G4MaterialCutsCouple* currentCouple;      
227                                                   
228   G4GoudsmitSaundersonTable*  fGSTable;           
229   G4GSPWACorrections*         fPWACorrection;     
230                                                   
231   G4bool   fIsUsePWACorrection;                   
232   G4bool   fIsUseMottCorrection;                  
233   //                                              
234   G4double fLambda0; // elastic mean free path    
235   G4double fLambda1; // first transport mean f    
236   G4double fScrA;    // screening parameter       
237   G4double fG1;      // first transport coef.     
238   // in case of Mott-correction                   
239   G4double fMCtoScrA;                             
240   G4double fMCtoQ1;                               
241   G4double fMCtoG2PerG1;                          
242   //                                              
243   G4double fTheTrueStepLenght;                    
244   G4double fTheTransportDistance;                 
245   G4double fTheZPathLenght;                       
246   //                                              
247   G4ThreeVector fTheDisplacementVector;           
248   G4ThreeVector fTheNewDirection;                 
249   //                                              
250   G4bool fIsEndedUpOnBoundary;  // step ended     
251   G4bool fIsMultipleSacettring;                   
252   G4bool fIsSingleScattering;                     
253   G4bool fIsEverythingWasDone;                    
254   G4bool fIsNoScatteringInMSC;                    
255   G4bool fIsNoDisplace;                           
256   G4bool fIsInsideSkin;                           
257   G4bool fIsWasOnBoundary;                        
258   G4bool fIsFirstRealStep;                        
259   //                                              
260   static G4bool gIsUseAccurate;                   
261   static G4bool gIsOptimizationOn;                
262 };                                                
263                                                   
264 //////////////////////////////////////////////    
265 inline                                            
266 void G4GoudsmitSaundersonMscModel::SetParticle    
267 {                                                 
268   if (p != particle) {                            
269     particle = p;                                 
270     charge = (G4int)(p->GetPDGCharge()/CLHEP::    
271     mass = p->GetPDGMass();                       
272   }                                               
273 }                                                 
274                                                   
275                                                   
276 //....oooOO0OOooo........oooOO0OOooo........oo    
277 inline                                            
278 G4double G4GoudsmitSaundersonMscModel::Randomi    
279 {                                                 
280   G4double temptlimit;                            
281     do {                                          
282          temptlimit = G4RandGauss::shoot(rndmE    
283        } while ( (temptlimit<0.) || (temptlimi    
284                                                   
285   return temptlimit;                              
286 }                                                 
287                                                   
288                                                   
289                                                   
290 #endif                                            
291