File indexing completed on 2025-01-18 09:58:40
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037 #ifndef G4MicroElecElasticModel_h
0038 #define G4MicroElecElasticModel_h 1
0039
0040 #include <map>
0041 #include <CLHEP/Units/SystemOfUnits.h>
0042
0043 #include "G4MicroElecCrossSectionDataSet.hh"
0044 #include "G4VEmModel.hh"
0045 #include "G4Electron.hh"
0046 #include "G4ParticleChangeForGamma.hh"
0047 #include "G4LogLogInterpolation.hh"
0048 #include "G4ProductionCutsTable.hh"
0049 #include "G4NistManager.hh"
0050
0051 class G4MicroElecElasticModel : public G4VEmModel
0052 {
0053
0054 public:
0055 G4MicroElecElasticModel(const G4ParticleDefinition* p = nullptr,
0056 const G4String& nam = "MicroElecElasticModel");
0057 virtual ~G4MicroElecElasticModel();
0058
0059 void Initialise(const G4ParticleDefinition*, const G4DataVector&) override;
0060
0061 G4double CrossSectionPerVolume(const G4Material* material,
0062 const G4ParticleDefinition* p,
0063 G4double ekin,
0064 G4double emin,
0065 G4double emax) override;
0066
0067 void SampleSecondaries(std::vector<G4DynamicParticle*>*,
0068 const G4MaterialCutsCouple*,
0069 const G4DynamicParticle*,
0070 G4double tmin,
0071 G4double maxEnergy) override;
0072
0073 inline void SetKillBelowThreshold (G4double threshold);
0074 G4double GetKillBelowThreshold () { return killBelowEnergy; }
0075
0076 G4MicroElecElasticModel & operator=(const G4MicroElecElasticModel &right) = delete;
0077 G4MicroElecElasticModel(const G4MicroElecElasticModel&) = delete;
0078
0079 protected:
0080 G4ParticleChangeForGamma* fParticleChangeForGamma;
0081
0082 private:
0083
0084 G4double Theta(G4ParticleDefinition * aParticleDefinition, G4double k, G4double integrDiff);
0085 G4double LinLinInterpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2);
0086 G4double LogLogInterpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2);
0087 G4double LinLogInterpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2);
0088 G4double QuadInterpolator(G4double e11,
0089 G4double e12,
0090 G4double e21,
0091 G4double e22,
0092 G4double x11,
0093 G4double x12,
0094 G4double x21,
0095 G4double x22,
0096 G4double t1,
0097 G4double t2,
0098 G4double t,
0099 G4double e);
0100 G4double RandomizeCosTheta(G4double k);
0101
0102
0103 typedef std::map<G4String,G4String,std::less<G4String> > MapFile;
0104 MapFile tableFile;
0105
0106 typedef std::map<G4String,G4MicroElecCrossSectionDataSet*,std::less<G4String> > MapData;
0107 MapData tableData;
0108
0109 typedef std::map<G4double, std::map<G4double, G4double> > TriDimensionMap;
0110 TriDimensionMap eDiffCrossSectionData;
0111 std::vector<G4double> eTdummyVec;
0112
0113 typedef std::map<G4double, std::vector<G4double> > VecMap;
0114 VecMap eVecm;
0115
0116 G4Material* nistSi;
0117 G4double killBelowEnergy;
0118 G4double lowEnergyLimit;
0119 G4double lowEnergyLimitOfModel;
0120 G4double highEnergyLimit;
0121 G4int verboseLevel;
0122 G4bool isInitialised;
0123 };
0124
0125 inline void G4MicroElecElasticModel::SetKillBelowThreshold (G4double threshold)
0126 {
0127 killBelowEnergy = threshold;
0128
0129 if (threshold < 5*CLHEP::eV)
0130 {
0131 G4Exception ("*** WARNING : the G4MicroElecElasticModel class is not validated below 5 eV !","",JustWarning,"") ;
0132 threshold = 5*CLHEP::eV;
0133 }
0134
0135 }
0136
0137
0138
0139
0140 #endif