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