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