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 // MR - 04/04/2012 00027 // Based on G4DNACrossSectionDataSet 00028 // 00029 00030 #ifndef G4MUELECCROSSSECTIONDATASET_HH 00031 #define G4MUELECCROSSSECTIONDATASET_HH 1 00032 00033 #include <CLHEP/Units/SystemOfUnits.h> 00034 00035 #include "G4ShellEMDataSet.hh" 00036 00037 class G4MuElecCrossSectionDataSet : public G4VEMDataSet 00038 { 00039 00040 public: 00041 G4MuElecCrossSectionDataSet(G4VDataSetAlgorithm* algo, 00042 G4double xUnit=CLHEP::MeV, 00043 G4double dataUnit=CLHEP::barn); 00044 00045 virtual ~G4MuElecCrossSectionDataSet(); 00046 00047 virtual G4double FindValue(G4double e, G4int componentId=0) const; 00048 00049 virtual void PrintData(void) const; 00050 00051 virtual const G4VEMDataSet* GetComponent(G4int componentId) const 00052 { return components[componentId]; } 00053 00054 virtual void AddComponent(G4VEMDataSet* dataSet) 00055 { components.push_back(dataSet); } 00056 00057 virtual size_t NumberOfComponents(void) const 00058 { return components.size(); } 00059 00060 virtual const G4DataVector& GetEnergies(G4int componentId) const 00061 { return GetComponent(componentId)->GetEnergies(0); } 00062 00063 virtual const G4DataVector& GetData(G4int componentId) const 00064 { return GetComponent(componentId)->GetData(0); } 00065 00066 virtual const G4DataVector& GetLogEnergies(G4int componentId) const 00067 { return GetComponent(componentId)->GetLogEnergies(0); } 00068 00069 virtual const G4DataVector& GetLogData(G4int componentId) const 00070 { return GetComponent(componentId)->GetLogData(0); } 00071 00072 virtual void SetEnergiesData(G4DataVector* x, G4DataVector* values, G4int componentId); 00073 00074 virtual void SetLogEnergiesData(G4DataVector* x, 00075 G4DataVector* values, 00076 G4DataVector* log_x, 00077 G4DataVector* log_values, 00078 G4int componentId); 00079 00080 virtual G4bool LoadData(const G4String & argFileName); 00081 virtual G4bool LoadNonLogData(const G4String & argFileName); 00082 00083 virtual G4bool SaveData(const G4String & argFileName) const; 00084 00085 virtual G4double RandomSelect(G4int /*componentId */) const { return -1.; }; 00086 00087 00088 // void CleanUpComponents(); 00089 00090 private: 00091 00092 G4String FullFileName(const G4String & argFileName) const; 00093 00094 // Hide copy constructor and assignment operator 00095 G4MuElecCrossSectionDataSet(); 00096 G4MuElecCrossSectionDataSet(const G4MuElecCrossSectionDataSet & copy); 00097 G4MuElecCrossSectionDataSet& operator=(const G4MuElecCrossSectionDataSet & right); 00098 00099 std::vector<G4VEMDataSet*> components; // Owned pointers 00100 00101 G4int z; 00102 00103 G4VDataSetAlgorithm* algorithm; // Owned pointer 00104 00105 G4double unitEnergies; 00106 G4double unitData; 00107 00108 G4double GetUnitEnergies() const { return unitEnergies; } 00109 G4double GetUnitData() const { return unitData; } 00110 const G4VDataSetAlgorithm* GetAlgorithm() const { return algorithm; } 00111 00112 void CleanUpComponents(void); 00113 00114 00115 }; 00116 #endif /* G4MuElecCrossSectionDataSet_HH */