00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // 00027 // $Id$ 00028 // 00029 // Author: Riccardo Capra <capra@ge.infn.it> 00030 // 00031 // History: 00032 // ----------- 00033 // 30 Jun 2005 RC Created 00034 // 14 Oct 2007 MGP Removed inheritance from concrete class G4ShellEMDataSet 00035 // 15 Jul 2009 N.A.Karakatsanis New methods added for loading logarithmic data 00036 // to enhance computing performance of interpolation 00037 // 00038 // ------------------------------------------------------------------- 00039 00040 // Class description: 00041 // Low Energy Electromagnetic Physics 00042 // Data set for an electromagnetic physics process 00043 // A strategy pattern is used to encapsulate algorithms for data interpolation 00044 // Further documentation available from http://www.ge.infn.it/geant4/lowE 00045 00046 // ------------------------------------------------------------------- 00047 00048 #ifndef G4CrossSectionDataSet_HH 00049 #define G4CrossSectionDataSet_HH 1 00050 00051 #include <CLHEP/Units/SystemOfUnits.h> 00052 00053 #include "G4ShellEMDataSet.hh" 00054 00055 class G4CrossSectionDataSet : public G4VEMDataSet 00056 { 00057 00058 public: 00059 G4CrossSectionDataSet(G4VDataSetAlgorithm* algo, 00060 G4double xUnit=CLHEP::MeV, 00061 G4double dataUnit=CLHEP::barn); 00062 00063 virtual ~G4CrossSectionDataSet(); 00064 00065 virtual G4double FindValue(G4double e, G4int componentId=0) const; 00066 00067 virtual void PrintData(void) const; 00068 00069 virtual const G4VEMDataSet* GetComponent(G4int componentId) const 00070 { return components[componentId]; } 00071 00072 virtual void AddComponent(G4VEMDataSet* dataSet) 00073 { components.push_back(dataSet); } 00074 00075 virtual size_t NumberOfComponents(void) const 00076 { return components.size(); } 00077 00078 virtual const G4DataVector& GetEnergies(G4int componentId) const 00079 { return GetComponent(componentId)->GetEnergies(0); } 00080 00081 virtual const G4DataVector& GetData(G4int componentId) const 00082 { return GetComponent(componentId)->GetData(0); } 00083 00084 virtual const G4DataVector& GetLogEnergies(G4int componentId) const 00085 { return GetComponent(componentId)->GetLogEnergies(0); } 00086 00087 virtual const G4DataVector& GetLogData(G4int componentId) const 00088 { return GetComponent(componentId)->GetLogData(0); } 00089 00090 virtual void SetEnergiesData(G4DataVector* x, G4DataVector* values, G4int componentId); 00091 00092 virtual void SetLogEnergiesData(G4DataVector* x, 00093 G4DataVector* values, 00094 G4DataVector* log_x, 00095 G4DataVector* log_values, 00096 G4int componentId); 00097 00098 virtual G4bool LoadData(const G4String & argFileName); 00099 virtual G4bool LoadNonLogData(const G4String & argFileName); 00100 00101 virtual G4bool SaveData(const G4String & argFileName) const; 00102 00103 virtual G4double RandomSelect(G4int /*componentId */) const { return -1.; }; 00104 00105 00106 // void CleanUpComponents(); 00107 00108 private: 00109 00110 G4String FullFileName(const G4String & argFileName) const; 00111 00112 // Hide copy constructor and assignment operator 00113 G4CrossSectionDataSet(); 00114 G4CrossSectionDataSet(const G4CrossSectionDataSet & copy); 00115 G4CrossSectionDataSet& operator=(const G4CrossSectionDataSet & right); 00116 00117 std::vector<G4VEMDataSet*> components; // Owned pointers 00118 00119 G4int z; 00120 00121 G4VDataSetAlgorithm* algorithm; // Owned pointer 00122 00123 G4double unitEnergies; 00124 G4double unitData; 00125 00126 G4double GetUnitEnergies() const { return unitEnergies; } 00127 G4double GetUnitData() const { return unitData; } 00128 const G4VDataSetAlgorithm* GetAlgorithm() const { return algorithm; } 00129 00130 void CleanUpComponents(void); 00131 00132 00133 }; 00134 #endif /* G4CrossSectionDataSet_HH */