File indexing completed on 2025-01-18 09:59:19
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
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047 #ifndef G4VCROSSSECTIONHANDLER_HH
0048 #define G4VCROSSSECTIONHANDLER_HH 1
0049
0050 #include <map>
0051 #include <vector>
0052 #include <CLHEP/Units/SystemOfUnits.h>
0053
0054 #include "globals.hh"
0055 #include "G4DataVector.hh"
0056 #include "G4MaterialCutsCouple.hh"
0057
0058 class G4VDataSetAlgorithm;
0059 class G4VEMDataSet;
0060 class G4Material;
0061 class G4Element;
0062
0063 class G4VCrossSectionHandler {
0064
0065 public:
0066 explicit G4VCrossSectionHandler();
0067 explicit G4VCrossSectionHandler(G4VDataSetAlgorithm* interpolation,
0068 G4double minE = 250*CLHEP::eV,
0069 G4double maxE = 100*CLHEP::GeV,
0070 G4int nBins = 200,
0071 G4double unitE = CLHEP::MeV,
0072 G4double unitData = CLHEP::barn,
0073 G4int minZ = 1, G4int maxZ = 99);
0074
0075 virtual ~G4VCrossSectionHandler();
0076
0077 void Initialise(G4VDataSetAlgorithm* interpolation = nullptr,
0078 G4double minE = 250*CLHEP::eV,
0079 G4double maxE = 100*CLHEP::GeV,
0080 G4int numberOfBins = 200,
0081 G4double unitE = CLHEP::MeV,
0082 G4double unitData = CLHEP::barn,
0083 G4int minZ = 1, G4int maxZ = 99);
0084
0085 G4int SelectRandomAtom(const G4MaterialCutsCouple* couple, G4double e) const;
0086 const G4Element* SelectRandomElement(const G4MaterialCutsCouple* material,
0087 G4double e) const;
0088
0089 G4int SelectRandomShell(G4int Z, G4double e) const;
0090 G4VEMDataSet* BuildMeanFreePathForMaterials(const G4DataVector* energyCuts = nullptr);
0091 G4double FindValue(G4int Z, G4double e) const;
0092 G4double FindValue(G4int Z, G4double e, G4int shellIndex) const;
0093 G4double ValueForMaterial(const G4Material* material, G4double e) const;
0094 void LoadData(const G4String& dataFile);
0095 void LoadNonLogData(const G4String& dataFile);
0096 void LoadShellData(const G4String& dataFile);
0097 void PrintData() const;
0098 void Clear();
0099
0100 G4VCrossSectionHandler(const G4VCrossSectionHandler&) = delete;
0101 G4VCrossSectionHandler & operator=(const G4VCrossSectionHandler &right) = delete;
0102
0103 protected:
0104
0105 G4int NumberOfComponents(G4int Z) const;
0106 void ActiveElements();
0107
0108
0109 virtual std::vector<G4VEMDataSet*>* BuildCrossSectionsForMaterials(const G4DataVector& energyVector,
0110 const G4DataVector* energyCuts = nullptr) = 0;
0111
0112
0113 virtual G4VDataSetAlgorithm* CreateInterpolation();
0114 const G4VDataSetAlgorithm* GetInterpolation() const { return interpolation; }
0115
0116 private:
0117 G4VDataSetAlgorithm* interpolation;
0118 G4DataVector activeZ;
0119
0120 std::map<G4int,G4VEMDataSet*,std::less<G4int> > dataMap;
0121 std::vector<G4VEMDataSet*>* crossSections;
0122
0123 G4double eMin;
0124 G4double eMax;
0125 G4double unit1;
0126 G4double unit2;
0127
0128 G4int zMin;
0129 G4int zMax;
0130 G4int nBins;
0131 };
0132
0133 #endif
0134
0135
0136
0137
0138
0139
0140
0141
0142
0143
0144