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 // >> 26 // 25 27 26 // class description 28 // class description 27 // 29 // 28 // The class contains few (physical) quantitie 30 // The class contains few (physical) quantities related to the Ionisation 29 // process, for a material defined by its poin 31 // process, for a material defined by its pointer G4Material* 30 // 32 // >> 33 >> 34 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo.... >> 35 31 // 09-07-98: data moved from G4Material (mma) 36 // 09-07-98: data moved from G4Material (mma) 32 // 09-03-01: copy constructor and assignement 37 // 09-03-01: copy constructor and assignement operator in public (mma) 33 // 28-10-02: add setMeanExcitationEnergy (V.Iv 38 // 28-10-02: add setMeanExcitationEnergy (V.Ivanchenko) 34 // 27-09-07: add computation of parameters for 39 // 27-09-07: add computation of parameters for ions (V.Ivanchenko) 35 // 04-03-08: add fBirks constant (mma) 40 // 04-03-08: add fBirks constant (mma) 36 // 16-01-19, add exact computation of the dens 41 // 16-01-19, add exact computation of the density effect (M. Strait) 37 42 >> 43 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo.... >> 44 38 #ifndef G4IonisParamMat_HH 45 #ifndef G4IonisParamMat_HH 39 #define G4IonisParamMat_HH 46 #define G4IonisParamMat_HH 40 47 41 #include "G4DensityEffectCalculator.hh" << 42 #include "G4ios.hh" 48 #include "G4ios.hh" 43 #include "globals.hh" 49 #include "globals.hh" >> 50 #include "G4Log.hh" >> 51 #include "G4Exp.hh" >> 52 #include "G4Threading.hh" 44 53 45 class G4Material; 54 class G4Material; 46 class G4DensityEffectData; 55 class G4DensityEffectData; >> 56 class G4DensityEffectCalculator; >> 57 >> 58 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo.... 47 59 48 class G4IonisParamMat 60 class G4IonisParamMat 49 { 61 { 50 public: << 62 public: 51 G4IonisParamMat(const G4Material*); << 63 >> 64 G4IonisParamMat(const G4Material*); 52 ~G4IonisParamMat(); 65 ~G4IonisParamMat(); 53 G4IonisParamMat& operator=(const G4IonisPara << 54 G4IonisParamMat(const G4IonisParamMat&) = de << 55 66 56 // parameters for mean energy loss calculati 67 // parameters for mean energy loss calculation: 57 inline G4double GetMeanExcitationEnergy() co << 68 inline >> 69 G4double GetMeanExcitationEnergy() const {return fMeanExcitationEnergy;}; 58 70 59 void SetMeanExcitationEnergy(G4double value) << 71 void SetMeanExcitationEnergy(G4double value); 60 G4double FindMeanExcitationEnergy(const G4Ma << 72 G4double FindMeanExcitationEnergy(const G4Material*) const; 61 << 62 inline G4double GetLogMeanExcEnergy() const << 63 inline G4double* GetShellCorrectionVector() << 64 inline G4double GetTaul() const { return fTa << 65 73 >> 74 inline >> 75 G4double GetLogMeanExcEnergy() const {return fLogMeanExcEnergy;}; >> 76 inline >> 77 G4double* GetShellCorrectionVector() const {return fShellCorrectionVector;}; >> 78 inline >> 79 G4double GetTaul() const {return fTaul;}; >> 80 66 // parameters of the density correction: 81 // parameters of the density correction: 67 inline G4double GetPlasmaEnergy() const { re << 82 inline 68 inline G4double GetAdjustmentFactor() const << 83 G4double GetPlasmaEnergy() const {return fPlasmaEnergy;}; 69 inline G4double GetCdensity() const { return << 84 inline 70 inline G4double GetMdensity() const { return << 85 G4double GetAdjustmentFactor() const {return fAdjustmentFactor;}; 71 inline G4double GetAdensity() const { return << 86 inline 72 inline G4double GetX0density() const { retur << 87 G4double GetCdensity() const {return fCdensity;}; 73 inline G4double GetX1density() const { retur << 88 inline 74 inline G4double GetD0density() const { retur << 89 G4double GetMdensity() const {return fMdensity;}; >> 90 inline >> 91 G4double GetAdensity() const {return fAdensity;}; >> 92 inline >> 93 G4double GetX0density() const {return fX0density;}; >> 94 inline >> 95 G4double GetX1density() const {return fX1density;}; >> 96 inline >> 97 G4double GetD0density() const {return fD0density;}; 75 98 76 // user defined density correction parameter 99 // user defined density correction parameterisation 77 void SetDensityEffectParameters( << 100 void SetDensityEffectParameters(G4double cd, G4double md, G4double ad, 78 G4double cd, G4double md, G4double ad, G4d << 101 G4double x0, G4double x1, G4double d0); 79 102 80 // defined density correction parameterisati 103 // defined density correction parameterisation via base material 81 void SetDensityEffectParameters(const G4Mate 104 void SetDensityEffectParameters(const G4Material* bmat); 82 105 83 void ComputeDensityEffectOnFly(G4bool); 106 void ComputeDensityEffectOnFly(G4bool); 84 107 85 inline G4DensityEffectCalculator* GetDensity << 86 { << 87 return fDensityEffectCalc; << 88 } << 89 << 90 // compute density correction as a function 108 // compute density correction as a function of the kinematic variable 91 // x = log10(beta*gamma) using parameterisat << 109 // x = log10(beta*gamma) 92 inline G4double DensityCorrection(G4double x << 110 G4double DensityCorrection(G4double x); 93 { << 94 return (nullptr == fDensityEffectCalc) ? G << 95 : f << 96 } << 97 111 >> 112 inline G4DensityEffectCalculator* GetDensityEffectCalculator() >> 113 { return fDensityEffectCalc; } >> 114 98 // use parameterisation 115 // use parameterisation 99 G4double GetDensityCorrection(G4double x) co << 116 inline G4double GetDensityCorrection(G4double x); 100 117 101 static G4DensityEffectData* GetDensityEffect 118 static G4DensityEffectData* GetDensityEffectData(); 102 119 103 // parameters of the energy loss fluctuation 120 // parameters of the energy loss fluctuation model: 104 inline G4double GetF1fluct() const { return << 121 inline 105 inline G4double GetF2fluct() const { return << 122 G4double GetF1fluct() const {return fF1fluct;}; 106 inline G4double GetEnergy1fluct() const { re << 123 inline 107 inline G4double GetLogEnergy1fluct() const { << 124 G4double GetF2fluct() const {return fF2fluct;}; 108 inline G4double GetEnergy2fluct() const { re << 125 inline 109 inline G4double GetLogEnergy2fluct() const { << 126 G4double GetEnergy1fluct() const {return fEnergy1fluct;}; 110 inline G4double GetEnergy0fluct() const { re << 127 inline 111 inline G4double GetRateionexcfluct() const { << 128 G4double GetLogEnergy1fluct() const {return fLogEnergy1fluct;}; >> 129 inline >> 130 G4double GetEnergy2fluct() const {return fEnergy2fluct;}; >> 131 inline >> 132 G4double GetLogEnergy2fluct() const {return fLogEnergy2fluct;}; >> 133 inline >> 134 G4double GetEnergy0fluct() const {return fEnergy0fluct;}; >> 135 inline >> 136 G4double GetRateionexcfluct() const {return fRateionexcfluct;}; 112 137 113 // parameters for ion corrections computatio 138 // parameters for ion corrections computations 114 inline G4double GetZeffective() const { retu << 139 inline 115 inline G4double GetFermiEnergy() const { ret << 140 G4double GetZeffective() const {return fZeff;}; 116 inline G4double GetLFactor() const { return << 141 inline 117 inline G4double GetInvA23() const { return f << 142 G4double GetFermiEnergy() const {return fFermiEnergy;}; 118 << 143 inline >> 144 G4double GetLFactor() const {return fLfactor;}; >> 145 inline >> 146 G4double GetInvA23() const {return fInvA23;}; >> 147 119 // parameters for Birks attenuation: 148 // parameters for Birks attenuation: 120 inline void SetBirksConstant(G4double value) << 149 inline 121 inline G4double GetBirksConstant() const { r << 150 void SetBirksConstant(G4double value) {fBirks = value;}; 122 << 151 inline 123 // parameters for average energy per ion << 152 G4double GetBirksConstant() const {return fBirks;}; 124 inline void SetMeanEnergyPerIonPair(G4double << 153 125 inline G4double GetMeanEnergyPerIonPair() co << 154 // parameters for average energy per ion 126 << 155 inline 127 // parameter for sampling of positron annihi << 156 void SetMeanEnergyPerIonPair(G4double value) {fMeanEnergyPerIon = value;}; 128 inline void SetOrtoPositroniumFraction(G4dou << 157 inline 129 inline G4double GetOrtoPositroniumFraction() << 158 G4double GetMeanEnergyPerIonPair() const {return fMeanEnergyPerIon;}; >> 159 >> 160 G4IonisParamMat(__void__&); >> 161 // Fake default constructor for usage restricted to direct object >> 162 // persistency for clients requiring preallocation of memory for >> 163 // persistifiable objects. 130 164 131 << 132 // operators 165 // operators >> 166 G4IonisParamMat& operator=(const G4IonisParamMat&) = delete; 133 G4bool operator==(const G4IonisParamMat&) co 167 G4bool operator==(const G4IonisParamMat&) const = delete; 134 G4bool operator!=(const G4IonisParamMat&) co 168 G4bool operator!=(const G4IonisParamMat&) const = delete; >> 169 G4IonisParamMat(const G4IonisParamMat&) = delete; 135 170 136 private: << 171 private: >> 172 137 // Compute mean parameters : ExcitationEnerg 173 // Compute mean parameters : ExcitationEnergy,Shell corretion vector ... 138 void ComputeMeanParameters(); 174 void ComputeMeanParameters(); 139 175 140 // Compute parameters for the density effect 176 // Compute parameters for the density effect 141 void ComputeDensityEffectParameters(); 177 void ComputeDensityEffectParameters(); 142 178 143 // Compute parameters for the energy fluctua 179 // Compute parameters for the energy fluctuation model 144 void ComputeFluctModel(); 180 void ComputeFluctModel(); 145 181 146 // Compute parameters for ion parameterizati 182 // Compute parameters for ion parameterizations 147 void ComputeIonParameters(); 183 void ComputeIonParameters(); 148 184 149 // 185 // 150 // data members 186 // data members 151 // 187 // 152 const G4Material* fMaterial; // this materi << 188 const G4Material* fMaterial; // this material 153 189 154 G4DensityEffectCalculator* fDensityEffectCal << 190 G4DensityEffectCalculator* fDensityEffectCalc; // calculator of the density effect 155 G4double* fShellCorrectionVector; // shell << 191 G4double* fShellCorrectionVector; // shell correction coefficients 156 192 157 // parameters for mean energy loss calculati 193 // parameters for mean energy loss calculation 158 G4double fMeanExcitationEnergy; // << 194 G4double fMeanExcitationEnergy; // 159 G4double fLogMeanExcEnergy; // << 195 G4double fLogMeanExcEnergy; // 160 G4double fTaul; // lower limit of Bethe-Blo << 196 G4double fTaul; // lower limit of Bethe-Bloch formula 161 197 162 // parameters of the density correction 198 // parameters of the density correction 163 G4double fCdensity; // mat.constant << 199 G4double fCdensity; // mat.constant 164 G4double fMdensity; // exponent << 200 G4double fMdensity; // exponent 165 G4double fAdensity; // << 201 G4double fAdensity; // 166 G4double fX0density; // << 202 G4double fX0density; // 167 G4double fX1density; // << 203 G4double fX1density; // 168 G4double fD0density; 204 G4double fD0density; 169 205 170 G4double fPlasmaEnergy; 206 G4double fPlasmaEnergy; 171 G4double fAdjustmentFactor; 207 G4double fAdjustmentFactor; 172 208 173 // parameters of the energy loss fluctuation 209 // parameters of the energy loss fluctuation model 174 G4double fF1fluct; << 210 G4double fF1fluct; 175 G4double fF2fluct; << 211 G4double fF2fluct; 176 G4double fEnergy1fluct; 212 G4double fEnergy1fluct; 177 G4double fLogEnergy1fluct; 213 G4double fLogEnergy1fluct; 178 G4double fEnergy2fluct; 214 G4double fEnergy2fluct; 179 G4double fLogEnergy2fluct; 215 G4double fLogEnergy2fluct; 180 G4double fEnergy0fluct; 216 G4double fEnergy0fluct; 181 G4double fRateionexcfluct; 217 G4double fRateionexcfluct; 182 218 183 // parameters for ion corrections computatio 219 // parameters for ion corrections computations 184 G4double fZeff; 220 G4double fZeff; 185 G4double fFermiEnergy; 221 G4double fFermiEnergy; 186 G4double fLfactor; 222 G4double fLfactor; 187 G4double fInvA23; 223 G4double fInvA23; 188 << 224 189 // parameter for Birks attenuation 225 // parameter for Birks attenuation 190 G4double fBirks; 226 G4double fBirks; 191 // average energy per ion pair 227 // average energy per ion pair 192 G4double fMeanEnergyPerIon; 228 G4double fMeanEnergyPerIon; 193 G4double twoln10; << 194 // parameter for sampling of positron annihi << 195 G4double fOrtoPositroniumFraction{0.035}; << 196 229 197 // static data created only once 230 // static data created only once 198 static G4DensityEffectData* fDensityData; 231 static G4DensityEffectData* fDensityData; >> 232 G4double twoln10; >> 233 #ifdef G4MULTITHREADED >> 234 static G4Mutex ionisMutex; >> 235 #endif 199 }; 236 }; >> 237 >> 238 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo.... >> 239 >> 240 inline G4double G4IonisParamMat::GetDensityCorrection(G4double x) >> 241 { >> 242 // x = log10(beta*gamma) >> 243 G4double y = 0.0; >> 244 if(x < fX0density) { >> 245 if(fD0density > 0.0) { y = fD0density*G4Exp(twoln10*(x - fX0density)); } >> 246 } else if(x >= fX1density) { y = twoln10*x - fCdensity; } >> 247 else {y = twoln10*x - fCdensity + fAdensity*G4Exp(G4Log(fX1density - x)*fMdensity);} >> 248 return y; >> 249 } >> 250 >> 251 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo.... 200 252 201 #endif 253 #endif 202 254