G4ShellEMDataSet.hh

Go to the documentation of this file.
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: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
00030 //
00031 // History:
00032 // -----------
00033 // 31 Jul 2001   MGP                 Created
00034 //  9 Mar 2008   MGP                 Cleaned up unreadable code modified by former developer
00035 //                                   (Further clean-up needed)
00036 // 15 Jul 2009   N.A.Karakatsanis    New methods added for loading logarithmic data
00037 //                                   to enhance computing performance of interpolation 
00038 //
00039 // -------------------------------------------------------------------
00040 
00041 // Class description:
00042 // Low Energy Electromagnetic Physics
00043 // Data set for an electromagnetic physics process
00044 // A strategy pattern is used to encapsulate algorithms for data interpolation
00045 // Further documentation available from http://www.ge.infn.it/geant4/lowE
00046 
00047 // -------------------------------------------------------------------
00048 
00049 #ifndef  G4SHELLEMDATASET_HH
00050 #define  G4SHELLEMDATASET_HH 1
00051 
00052 #include <vector>
00053 #include <CLHEP/Units/SystemOfUnits.h>
00054 
00055 #include "globals.hh"
00056 #include "G4VEMDataSet.hh"
00057 
00058 class G4VDataSetAlgorithm;
00059 
00060 class G4ShellEMDataSet : public G4VEMDataSet 
00061 { 
00062 public:
00063   G4ShellEMDataSet(G4int Z, 
00064                    G4VDataSetAlgorithm* algo, 
00065                    G4double eUnit=CLHEP::MeV, 
00066                    G4double dataUnit=CLHEP::barn);
00067 
00068   virtual ~G4ShellEMDataSet();
00069  
00070   virtual G4double FindValue(G4double energy, G4int componentId=0) const;
00071   
00072   virtual void PrintData(void) const;
00073 
00074   virtual const G4VEMDataSet*  GetComponent(G4int componentId) const { return components[componentId]; }
00075   virtual void AddComponent(G4VEMDataSet* dataSet) { components.push_back(dataSet); }
00076   virtual size_t NumberOfComponents(void) const { return components.size(); }
00077 
00078   virtual const G4DataVector& GetEnergies(G4int componentId) const { return GetComponent(componentId)->GetEnergies(0); }
00079   virtual const G4DataVector& GetData(G4int componentId) const { return GetComponent(componentId)->GetData(0); }
00080   virtual const G4DataVector& GetLogEnergies(G4int componentId) const { return GetComponent(componentId)->GetLogEnergies(0); }
00081   virtual const G4DataVector& GetLogData(G4int componentId) const { return GetComponent(componentId)->GetLogData(0); }
00082 
00083   virtual void SetEnergiesData(G4DataVector* energies, G4DataVector* data, G4int componentId);
00084   virtual void SetLogEnergiesData(G4DataVector* energies,
00085                                   G4DataVector* data,
00086                                   G4DataVector* log_energies, 
00087                                   G4DataVector* log_data,
00088                                   G4int componentId);
00089 
00090   virtual G4bool LoadData(const G4String& fileName);
00091   virtual G4bool LoadNonLogData(const G4String& fileName);
00092 
00093   virtual G4bool SaveData(const G4String& fileName) const;
00094 
00095   virtual G4double RandomSelect(G4int /*componentId = 0*/) const { return -1.; };
00096    
00097 protected:
00098 
00099   G4double GetUnitEnergies() const { return unitEnergies; }
00100   G4double GetUnitData() const { return unitData; }
00101   const G4VDataSetAlgorithm* GetAlgorithm() const { return algorithm; }
00102    
00103   void CleanUpComponents(void);
00104 
00105 private:
00106 
00107   G4String FullFileName(const G4String& fileName) const;
00108   
00109   // Hide copy constructor and assignment operator 
00110   G4ShellEMDataSet();
00111   G4ShellEMDataSet(const G4ShellEMDataSet& copy);
00112   G4ShellEMDataSet& operator=(const G4ShellEMDataSet& right);
00113 
00114   std::vector<G4VEMDataSet*> components;          // Owned pointers
00115 
00116   G4int z;
00117 
00118   G4VDataSetAlgorithm* algorithm;           // Owned pointer 
00119   
00120   G4double unitEnergies;
00121   G4double unitData;
00122 };
00123 #endif /* G4SHELLEMDATASET_HH */

Generated on Mon May 27 17:49:49 2013 for Geant4 by  doxygen 1.4.7