00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048 #ifndef G4VCROSSSECTIONHANDLER_HH
00049 #define G4VCROSSSECTIONHANDLER_HH 1
00050
00051 #include <map>
00052 #include <vector>
00053 #include <CLHEP/Units/SystemOfUnits.h>
00054
00055 #include "globals.hh"
00056 #include "G4DataVector.hh"
00057 #include "G4MaterialCutsCouple.hh"
00058
00059 class G4VDataSetAlgorithm;
00060 class G4VEMDataSet;
00061 class G4Material;
00062 class G4Element;
00063
00064 class G4VCrossSectionHandler {
00065
00066 public:
00067
00068 G4VCrossSectionHandler();
00069
00070 G4VCrossSectionHandler(G4VDataSetAlgorithm* interpolation,
00071 G4double minE = 250*CLHEP::eV,
00072 G4double maxE = 100*CLHEP::GeV,
00073 G4int nBins = 200,
00074 G4double unitE = CLHEP::MeV,
00075 G4double unitData = CLHEP::barn,
00076 G4int minZ = 1, G4int maxZ = 99);
00077
00078 virtual ~G4VCrossSectionHandler();
00079
00080 void Initialise(G4VDataSetAlgorithm* interpolation = 0,
00081 G4double minE = 250*CLHEP::eV,
00082 G4double maxE = 100*CLHEP::GeV,
00083 G4int numberOfBins = 200,
00084 G4double unitE = CLHEP::MeV,
00085 G4double unitData = CLHEP::barn,
00086 G4int minZ = 1, G4int maxZ = 99);
00087
00088 G4int SelectRandomAtom(const G4MaterialCutsCouple* couple, G4double e) const;
00089
00090 const G4Element* SelectRandomElement(const G4MaterialCutsCouple* material,
00091 G4double e) const;
00092
00093 G4int SelectRandomShell(G4int Z, G4double e) const;
00094
00095 G4VEMDataSet* BuildMeanFreePathForMaterials(const G4DataVector* energyCuts = 0);
00096
00097 G4double FindValue(G4int Z, G4double e) const;
00098
00099 G4double FindValue(G4int Z, G4double e, G4int shellIndex) const;
00100
00101 G4double ValueForMaterial(const G4Material* material, G4double e) const;
00102
00103 void LoadData(const G4String& dataFile);
00104
00105 void LoadNonLogData(const G4String& dataFile);
00106
00107 void LoadShellData(const G4String& dataFile);
00108
00109 void PrintData() const;
00110
00111 void Clear();
00112
00113 protected:
00114
00115 G4int NumberOfComponents(G4int Z) const;
00116
00117 void ActiveElements();
00118
00119
00120 virtual std::vector<G4VEMDataSet*>* BuildCrossSectionsForMaterials(const G4DataVector& energyVector,
00121 const G4DataVector* energyCuts = 0) = 0;
00122
00123
00124 virtual G4VDataSetAlgorithm* CreateInterpolation();
00125
00126 const G4VDataSetAlgorithm* GetInterpolation() const { return interpolation; }
00127
00128
00129 private:
00130
00131
00132 G4VCrossSectionHandler(const G4VCrossSectionHandler&);
00133 G4VCrossSectionHandler & operator=(const G4VCrossSectionHandler &right);
00134
00135 G4VDataSetAlgorithm* interpolation;
00136
00137 G4double eMin;
00138 G4double eMax;
00139 G4int nBins;
00140
00141 G4double unit1;
00142 G4double unit2;
00143
00144 G4int zMin;
00145 G4int zMax;
00146
00147 G4DataVector activeZ;
00148
00149 std::map<G4int,G4VEMDataSet*,std::less<G4int> > dataMap;
00150
00151 std::vector<G4VEMDataSet*>* crossSections;
00152 };
00153
00154 #endif
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165