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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 9.6)


  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 // $Id$
                                                   >>  27 //
                                                   >>  28 // -------------------------------------------------------------------
 26 //                                                 29 //
 27 // ------------------------------------------- << 
 28 //                                                 30 //
 29 // GEANT4 Class header file                        31 // GEANT4 Class header file
 30 //                                                 32 //
                                                   >>  33 //
 31 // File name:     G4GoudsmitSaundersonMscModel     34 // File name:     G4GoudsmitSaundersonMscModel
 32 //                                                 35 //
 33 // Author:        Mihaly Novak / (Omrane Kadri <<  36 // Author:        Omrane Kadri
 34 //                                                 37 //
 35 // Creation date: 20.02.2009                       38 // Creation date: 20.02.2009
 36 //                                                 39 //
 37 // Modifications:                                  40 // Modifications:
 38 // 04.03.2009 V.Ivanchenko cleanup and format      41 // 04.03.2009 V.Ivanchenko cleanup and format according to Geant4 EM style
 39 // 12.05.2010 O.Kadri: adding Qn1 and Qn12 as      42 // 12.05.2010 O.Kadri: adding Qn1 and Qn12 as private doubles
 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 //                                                 43 //
102 // Class description:                              44 // 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 //                                                 45 //
119 // ------------------------------------------- <<  46 // Multiple scattering model using classical Goudsmit-Saunderson model
                                                   >>  47 //
                                                   >>  48 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
                                                   >>  49 //REFERENCES:
                                                   >>  50 //Ref.1:E. Benedito et al.,"Mixed simulation ... cross-sections", NIMB 174 (2001) pp 91-110;
                                                   >>  51 //Ref.2:I. Kawrakow et al.,"On the condensed ... transport",NIMB 142 (1998) pp 253-280;
                                                   >>  52 //Ref.3:I. Kawrakow et al.,"On the representation ... calculations",NIMB 134 (1998) pp 325-336;
                                                   >>  53 //Ref.4:I. Kawrakow et al.,"The EGSnrc code ... Transport",NRCC Report PIRS-701, Sept. 21, 2006;
                                                   >>  54 //Ref.5:F. Salvat et al.,"ELSEPA--Dirac partial ...molecules", Comp. Phys. Comm. 165 (2005) pp 157-190;
                                                   >>  55 //Ref.6:G4UrbanMscModel G4_v9.1Ref09; 
                                                   >>  56 //Ref.7:G4WentzelVIModel G4_v9.3.
                                                   >>  57 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
120                                                    58 
121 #ifndef G4GoudsmitSaundersonMscModel_h             59 #ifndef G4GoudsmitSaundersonMscModel_h
122 #define G4GoudsmitSaundersonMscModel_h 1           60 #define G4GoudsmitSaundersonMscModel_h 1
123                                                    61 
124 #include <CLHEP/Units/SystemOfUnits.h>             62 #include <CLHEP/Units/SystemOfUnits.h>
125                                                    63 
126 #include "G4VMscModel.hh"                          64 #include "G4VMscModel.hh"
127 #include "G4PhysicsTable.hh"                       65 #include "G4PhysicsTable.hh"
128 #include "G4MaterialCutsCouple.hh"             << 
129 #include "globals.hh"                              66 #include "globals.hh"
130                                                    67 
131                                                << 
132 class G4DataVector;                                68 class G4DataVector;
133 class G4ParticleChangeForMSC;                      69 class G4ParticleChangeForMSC;
134 class G4LossTableManager;                          70 class G4LossTableManager;
135 class G4GoudsmitSaundersonTable;                   71 class G4GoudsmitSaundersonTable;
136 class G4GSPWACorrections;                      << 
137                                                    72 
138 class G4GoudsmitSaundersonMscModel : public G4     73 class G4GoudsmitSaundersonMscModel : public G4VMscModel
139 {                                                  74 {
140 public:                                            75 public:
141                                                    76 
142   G4GoudsmitSaundersonMscModel(const G4String&     77   G4GoudsmitSaundersonMscModel(const G4String& nam = "GoudsmitSaunderson");
143                                                    78 
144   ~G4GoudsmitSaundersonMscModel() override;    <<  79   virtual ~G4GoudsmitSaundersonMscModel();
145                                                << 
146   void Initialise(const G4ParticleDefinition*, << 
147                                                << 
148   void InitialiseLocal(const G4ParticleDefinit << 
149                                                << 
150   G4ThreeVector& SampleScattering(const G4Thre << 
151                                                    80 
152   G4double ComputeTruePathLengthLimit(const G4 <<  81   virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&);
153                                                    82 
154   G4double ComputeGeomPathLength(G4double true <<  83   void StartTracking(G4Track*);
155                                                    84 
156   G4double ComputeTrueStepLength(G4double geom <<  85   virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition* particle,
                                                   >>  86                 G4double KineticEnergy,
                                                   >>  87                 G4double AtomicNumber, G4double, 
                                                   >>  88                 G4double, G4double);
157                                                    89 
158   // method to compute first transport cross s <<  90   virtual G4ThreeVector& SampleScattering(const G4DynamicParticle*, 
159   // method is used only for testing and not d <<  91             G4double safety);
160   G4double CrossSectionPerVolume(const G4Mater << 
161                                                    92 
162   void     StartTracking(G4Track*) override;   <<  93   virtual G4double ComputeTruePathLengthLimit(const G4Track& track,
                                                   >>  94                 G4double& currentMinimalStep);
163                                                    95 
164   void     SampleMSC();                        <<  96   virtual G4double ComputeGeomPathLength(G4double truePathLength);
165                                                    97 
166   G4double GetTransportMeanFreePath(const G4Pa <<  98   virtual G4double ComputeTrueStepLength(G4double geomStepLength);
167                                                    99 
168   void SetOptionPWACorrection(G4bool opt)    { << 100 private:  
                                                   >> 101   void SampleCosineTheta(G4double,G4double,G4double &,G4double &);
169                                                   102 
170   G4bool GetOptionPWACorrection() const      { << 103   void CalculateIntegrals(const G4ParticleDefinition* ,G4double,G4double,
                                                   >> 104                           G4double&,G4double&);
171                                                   105 
172   void   SetOptionMottCorrection(G4bool opt) { << 106   void LoadELSEPAXSections();
173                                                   107 
174   G4bool GetOptionMottCorrection() const     { << 108   inline void SetParticle(const G4ParticleDefinition* p);
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                                                   109 
187   inline G4double GetLambda(G4double);            110   inline G4double GetLambda(G4double);
188                                                   111 
189   G4double GetTransportMeanFreePathOnly(const  << 112   //  hide assignment operator
190                                                << 113   G4GoudsmitSaundersonMscModel & operator=(const  G4GoudsmitSaundersonMscModel &right);
191   inline G4double Randomizetlimit();           << 114   G4GoudsmitSaundersonMscModel(const  G4GoudsmitSaundersonMscModel&);
192                                                   115 
193 private:                                       << 116   G4double lowKEnergy;
194   CLHEP::HepRandomEngine* rndmEngineMod;       << 117   G4double highKEnergy;
195   //                                           << 
196   G4double currentKinEnergy;                      118   G4double currentKinEnergy;
197   G4double currentRange;                       << 119   G4double currentRange; 
198   //                                           << 120 
199   G4double fr;                                 << 121   G4double smallstep,tlimitminfix,skindepth;
200   G4double rangeinit;                          << 122   G4double fr,rangeinit,masslimite,tgeom;
201   G4double geombig;                            << 123   G4double par1,par2,par3,zPathLength,truePathLength;
202   G4double geomlimit;                          << 124   G4double tausmall,taulim,tlimit,tlimitmin,geommin,geombig;
203   G4double tlimit;                             << 125   G4double charge,lambdalimit;
204   G4double tgeom;                              << 126   G4double tPathLength,stepmin ;
205   //                                           << 127   G4double lambda0,lambda1,lambda11;
206   G4double par1;                               << 
207   G4double par2;                               << 
208   G4double par3;                               << 
209   G4double tlimitminfix2;                      << 
210   G4double tausmall;                           << 
211   G4double mass;                                  128   G4double mass;
212   G4double taulim;                             << 
213   //                                           << 
214   //                                           << 
215   G4double presafety;                          << 
216   G4double fZeff;                              << 
217   //                                           << 
218   G4int    charge;                             << 
219   G4int    currentMaterialIndex;                  129   G4int    currentMaterialIndex;
220   //                                           << 130 
221   G4bool   firstStep;                             131   G4bool   firstStep;
222   //                                           << 132   G4bool   inside;
223   G4LossTableManager*         theManager;      << 133   G4bool   insideskin;
                                                   >> 134 
                                                   >> 135   G4GoudsmitSaundersonTable* GSTable;
                                                   >> 136   G4LossTableManager*        theManager;
224   const G4ParticleDefinition* particle;           137   const G4ParticleDefinition* particle;
225   G4ParticleChangeForMSC*     fParticleChange;    138   G4ParticleChangeForMSC*     fParticleChange;
226   const G4MaterialCutsCouple* currentCouple;      139   const G4MaterialCutsCouple* currentCouple;
227                                                   140 
228   G4GoudsmitSaundersonTable*  fGSTable;        << 141   static G4double ener[106];
229   G4GSPWACorrections*         fPWACorrection;  << 142   static G4double TCSE[103][106];
                                                   >> 143   static G4double FTCSE[103][106];
                                                   >> 144   static G4double TCSP[103][106];
                                                   >> 145   static G4double FTCSP[103][106];
230                                                   146 
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 };                                                147 };
                                                   >> 148 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
263                                                   149 
264 ////////////////////////////////////////////// << 
265 inline                                            150 inline
266 void G4GoudsmitSaundersonMscModel::SetParticle    151 void G4GoudsmitSaundersonMscModel::SetParticle(const G4ParticleDefinition* p)
267 {                                                 152 {
268   if (p != particle) {                            153   if (p != particle) {
269     particle = p;                                 154     particle = p;
270     charge = (G4int)(p->GetPDGCharge()/CLHEP:: << 
271     mass = p->GetPDGMass();                       155     mass = p->GetPDGMass();
                                                   >> 156     charge = p->GetPDGCharge()/CLHEP::eplus;
272   }                                               157   }
273 }                                                 158 }
274                                                   159 
275                                                << 
276 //....oooOO0OOooo........oooOO0OOooo........oo    160 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
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                                                   161 
290 #endif                                            162 #endif
                                                   >> 163 
291                                                   164