G4PixeShellDataSet.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 as G4EMShellDataSe
00034 //  9 Mar 2008   MGP        Cleaned up unreadable code modified by former developer
00035 //                          (Further clean-up needed) 
00036 // 31 Jul 2008   MGP        Revised and renamed to G4PixeShellDataSet
00037 //
00038 // -------------------------------------------------------------------
00039 
00040 // Class description:
00041 // Shell data set 
00042 // Applies a Composite design pattern for data library management
00043 
00044 // -------------------------------------------------------------------
00045 
00046 #ifndef  G4PIXESHELLDATASET_HH
00047 #define  G4PIXESHELLDATASET_HH 1
00048 
00049 #include <vector>
00050 #include <CLHEP/Units/SystemOfUnits.h>
00051 
00052 #include "globals.hh"
00053 #include "G4IDataSet.hh"
00054 
00055 class G4IInterpolator;
00056 
00057 class G4PixeShellDataSet : public G4IDataSet 
00058 { 
00059 public:
00060   G4PixeShellDataSet(G4int Z, 
00061                      G4IInterpolator* algo, 
00062                      //const G4String& particleTpye="proton",
00063                      const G4String& modelK="ecpssr",
00064                      const G4String& modelL="ecpssr",
00065                      const G4String& modelM="ecpssr",
00066                      G4double eUnit=CLHEP::MeV, 
00067                      G4double dataUnit=CLHEP::barn);
00068 
00069   virtual ~G4PixeShellDataSet();
00070  
00071   virtual G4double FindValue(G4double energy, G4int componentId=0) const;
00072   
00073   virtual void PrintData(void) const;
00074 
00075   virtual const G4IDataSet* GetComponent(G4int componentId) const 
00076   { return components[componentId]; }
00077 
00078   virtual void AddComponent(G4IDataSet* dataSet) 
00079   { components.push_back(dataSet); }
00080 
00081   virtual size_t NumberOfComponents(void) const 
00082   { return components.size(); }
00083 
00084   virtual const G4DataVector& GetEnergies(G4int componentId) const 
00085   { return GetComponent(componentId)->GetEnergies(0); }
00086 
00087   virtual const G4DataVector& GetData(G4int componentId) const 
00088   { return GetComponent(componentId)->GetData(0); }
00089 
00090   virtual void SetEnergiesData(G4DataVector* energies, 
00091                                G4DataVector* data, 
00092                                G4int componentId);
00093 
00094   virtual G4bool LoadData(const G4String& fileName);
00095   virtual G4bool SaveData(const G4String& fileName) const;
00096 
00097   virtual G4double RandomSelect(G4int /*componentId = 0*/) const {return -1.;};
00098    
00099 protected:
00100 
00101   G4double GetUnitEnergies() const { return unitEnergies; }
00102   G4double GetUnitData() const { return unitData; }
00103   const G4IInterpolator* GetAlgorithm() const { return algorithm; }
00104    
00105   void CleanUpComponents(void);
00106 
00107 private:
00108 
00109   G4String FullFileName(const G4String& particleType,
00110                         const G4String& subShell) const;
00111   G4int TranslateShell(const G4String& subShell) const;
00112   
00113   // Hide copy constructor and assignment operator 
00114   G4PixeShellDataSet();
00115   G4PixeShellDataSet(const G4PixeShellDataSet& copy);
00116   G4PixeShellDataSet& operator=(const G4PixeShellDataSet& right);
00117 
00118   std::vector<G4IDataSet*> components;          // Owned pointers
00119 
00120   G4int z;
00121   G4IInterpolator* algorithm;           // Owned pointer 
00122   // G4String particle;
00123   // G4String crossModelK;
00124   // G4String crossModelL;
00125   // G4String crossModelM;
00126   std::vector<G4String> crossModel;
00127   G4double unitEnergies;
00128   G4double unitData;
00129   std::vector<G4String> shellName;
00130   std::vector<G4String> subShellName;
00131 
00132 };
00133 #endif /* G4PIXESHELLDATASET_HH */

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