Geant4  10.02.p02
G4PixeShellDataSet.hh
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 // $Id: G4PixeShellDataSet.hh 70904 2013-06-07 10:34:25Z gcosmo $
28 //
29 // Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
30 //
31 // History:
32 // -----------
33 // 31 Jul 2001 MGP Created as G4EMShellDataSe
34 // 9 Mar 2008 MGP Cleaned up unreadable code modified by former developer
35 // (Further clean-up needed)
36 // 31 Jul 2008 MGP Revised and renamed to G4PixeShellDataSet
37 //
38 // -------------------------------------------------------------------
39 
40 // Class description:
41 // Shell data set
42 // Applies a Composite design pattern for data library management
43 
44 // -------------------------------------------------------------------
45 
46 #ifndef G4PIXESHELLDATASET_HH
47 #define G4PIXESHELLDATASET_HH 1
48 
49 #include <vector>
50 #include <CLHEP/Units/SystemOfUnits.h>
51 
52 #include "globals.hh"
53 #include "G4IDataSet.hh"
54 
55 class G4IInterpolator;
56 
58 {
59 public:
61  G4IInterpolator* algo,
62  //const G4String& particleTpye="proton",
63  const G4String& modelK="ecpssr",
64  const G4String& modelL="ecpssr",
65  const G4String& modelM="ecpssr",
66  G4double eUnit=CLHEP::MeV,
67  G4double dataUnit=CLHEP::barn);
68 
69  virtual ~G4PixeShellDataSet();
70 
71  virtual G4double FindValue(G4double energy, G4int componentId=0) const;
72 
73  virtual void PrintData(void) const;
74 
75  virtual const G4IDataSet* GetComponent(G4int componentId) const
76  { return components[componentId]; }
77 
78  virtual void AddComponent(G4IDataSet* dataSet)
79  { components.push_back(dataSet); }
80 
81  virtual size_t NumberOfComponents(void) const
82  { return components.size(); }
83 
84  virtual const G4DataVector& GetEnergies(G4int componentId) const
85  { return GetComponent(componentId)->GetEnergies(0); }
86 
87  virtual const G4DataVector& GetData(G4int componentId) const
88  { return GetComponent(componentId)->GetData(0); }
89 
90  virtual void SetEnergiesData(G4DataVector* energies,
91  G4DataVector* data,
92  G4int componentId);
93 
94  virtual G4bool LoadData(const G4String& fileName);
95  virtual G4bool SaveData(const G4String& fileName) const;
96 
97  virtual G4double RandomSelect(G4int /*componentId = 0*/) const {return -1.;};
98 
99 protected:
100 
102  G4double GetUnitData() const { return unitData; }
103  const G4IInterpolator* GetAlgorithm() const { return algorithm; }
104 
105  void CleanUpComponents(void);
106 
107 private:
108 
109  G4String FullFileName(const G4String& particleType,
110  const G4String& subShell) const;
111  G4int TranslateShell(const G4String& subShell) const;
112 
113  // Hide copy constructor and assignment operator
117 
118  std::vector<G4IDataSet*> components; // Owned pointers
119 
121  G4IInterpolator* algorithm; // Owned pointer
122  // G4String particle;
123  // G4String crossModelK;
124  // G4String crossModelL;
125  // G4String crossModelM;
126  std::vector<G4String> crossModel;
129  std::vector<G4String> shellName;
130  std::vector<G4String> subShellName;
131 
132 };
133 #endif /* G4PIXESHELLDATASET_HH */
G4double GetUnitEnergies() const
G4PixeShellDataSet & operator=(const G4PixeShellDataSet &right)
G4IInterpolator * algorithm
static const double MeV
Definition: G4SIunits.hh:211
std::vector< G4String > crossModel
virtual void SetEnergiesData(G4DataVector *energies, G4DataVector *data, G4int componentId)
virtual const G4DataVector & GetEnergies(G4int componentId) const
virtual G4double FindValue(G4double energy, G4int componentId=0) const
std::vector< G4String > subShellName
virtual G4double RandomSelect(G4int) const
std::vector< G4IDataSet * > components
virtual const G4DataVector & GetEnergies(G4int componentId) const =0
G4String FullFileName(const G4String &particleType, const G4String &subShell) const
int G4int
Definition: G4Types.hh:78
std::vector< G4String > shellName
virtual const G4DataVector & GetData(G4int componentId) const =0
virtual const G4DataVector & GetData(G4int componentId) const
bool G4bool
Definition: G4Types.hh:79
virtual const G4IDataSet * GetComponent(G4int componentId) const
G4double GetUnitData() const
G4int TranslateShell(const G4String &subShell) const
G4double energy(const ThreeVector &p, const G4double m)
const G4IInterpolator * GetAlgorithm() const
virtual G4bool LoadData(const G4String &fileName)
static const double barn
Definition: G4SIunits.hh:104
virtual void PrintData(void) const
double G4double
Definition: G4Types.hh:76
virtual G4bool SaveData(const G4String &fileName) const
virtual void AddComponent(G4IDataSet *dataSet)
virtual size_t NumberOfComponents(void) const