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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/include/G4WentzelOKandVIxSection.hh (Version 11.3.0) and /processes/electromagnetic/standard/include/G4WentzelOKandVIxSection.hh (Version 9.5.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 // $Id: G4WentzelOKandVIxSection.hh,v 1.6 2010-06-25 09:41:38 gunter Exp $
                                                   >>  27 // GEANT4 tag $Name: not supported by cvs2svn $
 26 //                                                 28 //
 27 // -------------------------------------------     29 // -------------------------------------------------------------------
 28 //                                                 30 //
 29 //                                                 31 //
 30 // GEANT4 Class header file                        32 // GEANT4 Class header file
 31 //                                                 33 //
 32 //                                                 34 //
 33 // File name:     G4WentzelOKandVIxSection         35 // File name:     G4WentzelOKandVIxSection
 34 //                                                 36 //
 35 // Authors:       V.Ivanchenko and O.Kadri         37 // Authors:       V.Ivanchenko and O.Kadri 
 36 //                                                 38 //
 37 // Creation date: 21.05.2010                       39 // Creation date: 21.05.2010 
 38 //                                                 40 //
 39 // Modifications:                                  41 // Modifications:
 40 //                                                 42 //
 41 //                                                 43 //
 42 // Class Description:                              44 // Class Description:
 43 //                                                 45 //
 44 // Implementation of the computation of total      46 // Implementation of the computation of total and transport cross sections,
 45 // sample scattering angle for the single scat     47 // sample scattering angle for the single scattering case.
 46 // to be used by single and multiple scatterin     48 // to be used by single and multiple scattering models. References:
 47 // 1) G.Wentzel, Z. Phys. 40 (1927) 590.           49 // 1) G.Wentzel, Z. Phys. 40 (1927) 590.
 48 // 2) J.M. Fernandez-Varea et al., NIM B73 (19     50 // 2) J.M. Fernandez-Varea et al., NIM B73 (1993) 447.
 49 //                                                 51 //
 50 // -------------------------------------------     52 // -------------------------------------------------------------------
 51 //                                                 53 //
 52                                                    54 
 53 #ifndef G4WentzelOKandVIxSection_h                 55 #ifndef G4WentzelOKandVIxSection_h
 54 #define G4WentzelOKandVIxSection_h 1               56 #define G4WentzelOKandVIxSection_h 1
 55                                                    57 
 56 //....oooOO0OOooo........oooOO0OOooo........oo     58 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 57                                                    59 
 58 #include "globals.hh"                              60 #include "globals.hh"
 59 #include "G4Material.hh"                           61 #include "G4Material.hh"
 60 #include "G4Element.hh"                            62 #include "G4Element.hh"
 61 #include "G4ElementVector.hh"                      63 #include "G4ElementVector.hh"
 62 #include "G4NistManager.hh"                        64 #include "G4NistManager.hh"
 63 #include "G4NuclearFormfactorType.hh"          << 
 64 #include "G4ThreeVector.hh"                        65 #include "G4ThreeVector.hh"
 65 #include "G4Pow.hh"                                66 #include "G4Pow.hh"
 66                                                    67 
 67 class G4ParticleDefinition;                        68 class G4ParticleDefinition;
 68 class G4ScreeningMottCrossSection;             << 
 69                                                    69 
 70 //....oooOO0OOooo........oooOO0OOooo........oo     70 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 71                                                    71 
 72 class G4WentzelOKandVIxSection                     72 class G4WentzelOKandVIxSection 
 73 {                                                  73 {
 74                                                    74 
 75 public:                                            75 public:
 76                                                    76 
 77   explicit G4WentzelOKandVIxSection(G4bool com <<  77   G4WentzelOKandVIxSection();
 78                                                    78 
 79   virtual ~G4WentzelOKandVIxSection();             79   virtual ~G4WentzelOKandVIxSection();
 80                                                    80 
 81   void Initialise(const G4ParticleDefinition*,     81   void Initialise(const G4ParticleDefinition*, G4double CosThetaLim);
 82                                                    82 
 83   void SetupParticle(const G4ParticleDefinitio     83   void SetupParticle(const G4ParticleDefinition*);
 84                                                    84 
 85   // return cos(ThetaMax) for msc and cos(thet     85   // return cos(ThetaMax) for msc and cos(thetaMin) for single scattering
 86   // cut = DBL_MAX means no scattering off ele     86   // cut = DBL_MAX means no scattering off electrons 
 87   virtual G4double SetupKinematic(G4double kin <<  87   G4double SetupTarget(G4int Z, G4double cut = DBL_MAX);
 88   G4double SetupTarget(G4int Z, G4double cut); << 
 89                                                    88 
 90   G4double ComputeTransportCrossSectionPerAtom     89   G4double ComputeTransportCrossSectionPerAtom(G4double CosThetaMax);
 91                                                    90  
 92   G4ThreeVector& SampleSingleScattering(G4doub <<  91   G4ThreeVector SampleSingleScattering(G4double CosThetaMin,
 93           G4double CosThetaMax,                <<  92                G4double CosThetaMax,
 94           G4double elecRatio);                 <<  93                G4double elecRatio = 0.0);
 95                                                << 
 96   G4double ComputeSecondTransportMoment(G4doub << 
 97                                                    94 
 98   inline G4double ComputeNuclearCrossSection(G     95   inline G4double ComputeNuclearCrossSection(G4double CosThetaMin,
 99                G4double CosThetaMax);              96                G4double CosThetaMax);
100                                                    97  
101   inline G4double ComputeElectronCrossSection(     98   inline G4double ComputeElectronCrossSection(G4double CosThetaMin,
102                 G4double CosThetaMax);             99                 G4double CosThetaMax);
103                                                << 100  
                                                   >> 101   inline G4double SetupKinematic(G4double kinEnergy, const G4Material* mat);
                                                   >> 102   
104   inline void SetTargetMass(G4double value);      103   inline void SetTargetMass(G4double value);
105                                                   104 
                                                   >> 105   //obsolete method
                                                   >> 106   inline void SetRelativisticMass(G4double value);
                                                   >> 107 
106   inline G4double GetMomentumSquare() const;      108   inline G4double GetMomentumSquare() const;
107                                                   109 
108   inline G4double GetCosThetaNuc() const;         110   inline G4double GetCosThetaNuc() const;
109                                                   111 
110   inline G4double GetCosThetaElec() const;        112   inline G4double GetCosThetaElec() const;
111                                                   113 
112   //  hide assignment operator                 << 114 private:
113   G4WentzelOKandVIxSection & operator=         << 
114   (const G4WentzelOKandVIxSection &right) = de << 
115   G4WentzelOKandVIxSection(const  G4WentzelOKa << 
116                                                << 
117 protected:                                     << 
118                                                   115 
119   void ComputeMaxElectronScattering(G4double c    116   void ComputeMaxElectronScattering(G4double cut);
120                                                   117 
121   void InitialiseA();                          << 118   //  hide assignment operator
122                                                << 119   G4WentzelOKandVIxSection & operator=(const  G4WentzelOKandVIxSection &right);
123   inline G4double FlatFormfactor(G4double x);  << 120   G4WentzelOKandVIxSection(const  G4WentzelOKandVIxSection&);
124                                                   121 
125   const G4ParticleDefinition* theProton;          122   const G4ParticleDefinition* theProton;
126   const G4ParticleDefinition* theElectron;        123   const G4ParticleDefinition* theElectron;
127   const G4ParticleDefinition* thePositron;        124   const G4ParticleDefinition* thePositron;
128   const G4ParticleDefinition* particle = nullp << 125   const G4Material* currentMaterial;
129   const G4Material* currentMaterial = nullptr; << 
130                                                   126 
131   G4NistManager* fNistManager;                 << 127   G4NistManager*  fNistManager;
132   G4Pow*         fG4pow;                       << 128   G4Pow*          fG4pow;
133                                                   129 
134   G4ScreeningMottCrossSection* fMottXSection = << 130   G4double numlimit;
135                                                   131 
136   G4ThreeVector temp;                          << 132   G4double elecXSRatio;
                                                   >> 133 
                                                   >> 134   // integer parameters
                                                   >> 135   G4int    nwarnings;
                                                   >> 136   G4int    nwarnlimit;
137                                                   137 
138   // single scattering parameters                 138   // single scattering parameters
139   G4double coeff;                                 139   G4double coeff;
140   G4double cosTetMaxElec = 1.0;                << 140   G4double cosTetMaxElec;
141   G4double cosTetMaxNuc = 1.0;                 << 141   G4double cosTetMaxNuc;
142                                                << 142   G4double cosThetaMax;
143   // for the combined mode it is cos(thetaMax) << 143   G4double alpha2;
144   // for single scattering it is cos(thetaMin) << 144 
145   G4double cosThetaMax = 1.0;                  << 145   // projectile
146                                                << 146   const G4ParticleDefinition* particle;
147   G4double chargeSquare = 0.0;                 << 147 
148   G4double charge3 = 0.0;                      << 148   G4double chargeSquare;
149   G4double spin = 0.0;                         << 149   G4double charge3;
150   G4double mass = 0.0;                         << 150   G4double spin;
151   G4double tkin = 0.0;                         << 151   G4double mass;
152   G4double mom2 = 0.0;                         << 152   G4double tkin;
153   G4double momCM2 = 0.0;                       << 153   G4double mom2;
154   G4double invbeta2 = 1.0;                     << 154   G4double momCM2;
155   G4double kinFactor = 1.0;                    << 155   G4double invbeta2;
156   G4double etag = DBL_MAX;                     << 156   G4double kinFactor;
157   G4double ecut = DBL_MAX;                     << 157   G4double etag;
                                                   >> 158   G4double ecut;
                                                   >> 159   G4double lowEnergyLimit;
158                                                   160 
159   // target                                       161   // target
                                                   >> 162   G4int    targetZ;
160   G4double targetMass;                            163   G4double targetMass;
161   G4double screenZ = 0.0;                      << 164   G4double screenZ;
162   G4double formfactA = 0.0;                    << 165   G4double formfactA;
163   G4double factorA2 = 0.0;                     << 166   G4double factorA2;
164   G4double factB = 0.0;                        << 167   G4double factB;
165   G4double factD = 0.0;                        << 168   G4double factB1;
166   G4double fMottFactor = 1.0;                  << 169   G4double factD;
167   G4double gam0pcmp = 1.0;                     << 170   G4double gam0pcmp;
168   G4double pcmp2 = 1.0;                        << 171   G4double pcmp2;
169                                                << 
170   // integer parameters                        << 
171   G4int targetZ = 0;                           << 
172   G4int nwarnings = 0;                         << 
173                                                   172 
174   G4NuclearFormfactorType fNucFormfactor = fEx << 
175                                                << 
176   G4bool isCombined;                           << 
177                                                << 
178   static G4double ScreenRSquareElec[100];      << 
179   static G4double ScreenRSquare[100];             173   static G4double ScreenRSquare[100];
180   static G4double FormFactor[100];                174   static G4double FormFactor[100];
181 };                                                175 };
182                                                   176 
                                                   >> 177 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
                                                   >> 178 
                                                   >> 179 inline G4double 
                                                   >> 180 G4WentzelOKandVIxSection::SetupKinematic(G4double ekin, const G4Material* mat)
                                                   >> 181 {
                                                   >> 182   if(ekin != tkin || mat != currentMaterial) { 
                                                   >> 183     currentMaterial = mat;
                                                   >> 184     tkin  = ekin;
                                                   >> 185     mom2  = tkin*(tkin + 2.0*mass);
                                                   >> 186     invbeta2 = 1.0 +  mass*mass/mom2;
                                                   >> 187     factB = spin/invbeta2;
                                                   >> 188     cosTetMaxNuc = 
                                                   >> 189   std::max(cosThetaMax,1.-factorA2*mat->GetIonisation()->GetInvA23()/mom2);
                                                   >> 190   } 
                                                   >> 191   return cosTetMaxNuc;
                                                   >> 192 }
                                                   >> 193 
183 //....oooOO0OOooo........oooOO0OOooo........oo    194 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
184                                                   195 
185 inline void G4WentzelOKandVIxSection::SetTarge    196 inline void G4WentzelOKandVIxSection::SetTargetMass(G4double value)
186 {                                                 197 {
187   targetMass = value;                             198   targetMass = value;
188   factD = std::sqrt(mom2)/value;                  199   factD = std::sqrt(mom2)/value;
189 }                                                 200 }
190                                                   201 
191 //....oooOO0OOooo........oooOO0OOooo........oo    202 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
192                                                   203 
                                                   >> 204 inline void G4WentzelOKandVIxSection::SetRelativisticMass(G4double value)
                                                   >> 205 {
                                                   >> 206   mass = value;
                                                   >> 207 }
                                                   >> 208 
                                                   >> 209 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
                                                   >> 210 
193 inline G4double G4WentzelOKandVIxSection::GetM    211 inline G4double G4WentzelOKandVIxSection::GetMomentumSquare() const
194 {                                                 212 {
195   return mom2;                                    213   return mom2;
196 }                                                 214 }
197                                                   215 
198 //....oooOO0OOooo........oooOO0OOooo........oo    216 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
199                                                   217 
200 inline G4double G4WentzelOKandVIxSection::GetC    218 inline G4double G4WentzelOKandVIxSection::GetCosThetaNuc() const
201 {                                                 219 {
202   return cosTetMaxNuc;                            220   return cosTetMaxNuc;
203 }                                                 221 }
204                                                   222 
205 //....oooOO0OOooo........oooOO0OOooo........oo    223 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
206                                                   224 
207 inline G4double G4WentzelOKandVIxSection::GetC    225 inline G4double G4WentzelOKandVIxSection::GetCosThetaElec() const
208 {                                                 226 {
209   return cosTetMaxElec;                           227   return cosTetMaxElec;
210 }                                                 228 }
211                                                   229 
212 //....oooOO0OOooo........oooOO0OOooo........oo    230 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
213                                                   231 
214 inline G4double                                   232 inline G4double 
215 G4WentzelOKandVIxSection::ComputeNuclearCrossS    233 G4WentzelOKandVIxSection::ComputeNuclearCrossSection(G4double cosTMin,
216                  G4double cosTMax)                234                  G4double cosTMax)
217 {                                                 235 {
218   return targetZ*kinFactor*fMottFactor*(cosTMi << 236   G4double xsec = 0.0;
219     ((1.0 - cosTMin + screenZ)*(1.0 - cosTMax  << 237   if(cosTMax < cosTMin) {
                                                   >> 238     xsec = targetZ*kinFactor*(cosTMin - cosTMax)/
                                                   >> 239       ((1.0 - cosTMin + screenZ)*(1.0 - cosTMax + screenZ));
                                                   >> 240   }
                                                   >> 241   return xsec;
220 }                                                 242 }
221                                                   243 
222 //....oooOO0OOooo........oooOO0OOooo........oo    244 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
223                                                   245 
224 inline G4double                                   246 inline G4double 
225 G4WentzelOKandVIxSection::ComputeElectronCross    247 G4WentzelOKandVIxSection::ComputeElectronCrossSection(G4double cosTMin,
226                   G4double cosTMax)               248                   G4double cosTMax)
227 {                                                 249 {
                                                   >> 250   G4double xsec = 0.0;
228   G4double cost1 = std::max(cosTMin,cosTetMaxE    251   G4double cost1 = std::max(cosTMin,cosTetMaxElec);
229   G4double cost2 = std::max(cosTMax,cosTetMaxE    252   G4double cost2 = std::max(cosTMax,cosTetMaxElec);
230   return (cost1 <= cost2) ? 0.0 : kinFactor*fM << 253   if(cost1 > cost2) {
231     ((1.0 - cost1 + screenZ)*(1.0 - cost2 + sc << 254     xsec = kinFactor*(cost1 - cost2)/((1.0 - cost1 + screenZ)*(1.0 - cost2 + screenZ));
                                                   >> 255   }
                                                   >> 256   return xsec;
232 }                                                 257 }
233                                                << 
234 inline G4double G4WentzelOKandVIxSection::Flat << 
235 {                                              << 
236   return 3.0*(std::sin(x) - x*std::cos(x))/(x* << 
237 }                                              << 
238                                                << 
239 //....oooOO0OOooo........oooOO0OOooo........oo    258 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
240                                                   259 
241 #endif                                            260 #endif
242                                                   261 
243                                                   262