File indexing completed on 2025-01-18 09:58:04
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 #ifndef G4CrossSectionDataSet_HH
0046 #define G4CrossSectionDataSet_HH 1
0047
0048 #include <CLHEP/Units/SystemOfUnits.h>
0049
0050 #include "G4ShellEMDataSet.hh"
0051
0052 class G4CrossSectionDataSet : public G4VEMDataSet
0053 {
0054
0055 public:
0056 explicit G4CrossSectionDataSet(G4VDataSetAlgorithm* algo,
0057 G4double xUnit=CLHEP::MeV,
0058 G4double dataUnit=CLHEP::barn);
0059
0060 virtual ~G4CrossSectionDataSet();
0061
0062 virtual G4double FindValue(G4double e, G4int componentId=0) const;
0063
0064 virtual void PrintData(void) const;
0065
0066 virtual const G4VEMDataSet* GetComponent(G4int componentId) const
0067 { return components[componentId]; }
0068
0069 virtual void AddComponent(G4VEMDataSet* dataSet)
0070 { components.push_back(dataSet); }
0071
0072 virtual size_t NumberOfComponents(void) const
0073 { return components.size(); }
0074
0075 virtual const G4DataVector& GetEnergies(G4int componentId) const
0076 { return GetComponent(componentId)->GetEnergies(0); }
0077
0078 virtual const G4DataVector& GetData(G4int componentId) const
0079 { return GetComponent(componentId)->GetData(0); }
0080
0081 virtual const G4DataVector& GetLogEnergies(G4int componentId) const
0082 { return GetComponent(componentId)->GetLogEnergies(0); }
0083
0084 virtual const G4DataVector& GetLogData(G4int componentId) const
0085 { return GetComponent(componentId)->GetLogData(0); }
0086
0087 virtual void SetEnergiesData(G4DataVector* x, G4DataVector* values, G4int componentId);
0088
0089 virtual void SetLogEnergiesData(G4DataVector* x,
0090 G4DataVector* values,
0091 G4DataVector* log_x,
0092 G4DataVector* log_values,
0093 G4int componentId);
0094
0095 virtual G4bool LoadData(const G4String & argFileName);
0096 virtual G4bool LoadNonLogData(const G4String & argFileName);
0097
0098 virtual G4bool SaveData(const G4String & argFileName) const;
0099
0100 virtual G4double RandomSelect(G4int ) const { return -1.; };
0101
0102 private:
0103
0104 G4String FullFileName(const G4String & argFileName) const;
0105
0106
0107 explicit G4CrossSectionDataSet();
0108 G4CrossSectionDataSet(const G4CrossSectionDataSet & copy) = delete;
0109 G4CrossSectionDataSet& operator=(const G4CrossSectionDataSet & right) = delete;
0110
0111 G4double GetUnitEnergies() const { return unitEnergies; }
0112 G4double GetUnitData() const { return unitData; }
0113 const G4VDataSetAlgorithm* GetAlgorithm() const { return algorithm; }
0114
0115 void CleanUpComponents(void);
0116
0117 std::vector<G4VEMDataSet*> components;
0118
0119 G4VDataSetAlgorithm* algorithm;
0120
0121 G4double unitEnergies;
0122 G4double unitData;
0123
0124 G4int z = 0;
0125 };
0126 #endif