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