Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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>
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,
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 
101  G4double GetUnitEnergies() const { return unitEnergies; }
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
116  G4PixeShellDataSet& operator=(const G4PixeShellDataSet& right);
117 
118  std::vector<G4IDataSet*> components; // Owned pointers
119 
120  G4int z;
121  G4IInterpolator* algorithm; // Owned pointer
122  // G4String particle;
123  // G4String crossModelK;
124  // G4String crossModelL;
125  // G4String crossModelM;
126  std::vector<G4String> crossModel;
127  G4double unitEnergies;
128  G4double unitData;
129  std::vector<G4String> shellName;
130  std::vector<G4String> subShellName;
131 
132 };
133 #endif /* G4PIXESHELLDATASET_HH */
G4double GetUnitEnergies() const
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
virtual G4double RandomSelect(G4int) const
virtual const G4DataVector & GetEnergies(G4int componentId) const =0
int G4int
Definition: G4Types.hh:78
const XML_Char const XML_Char * data
Definition: expat.h:268
virtual const G4DataVector & GetData(G4int componentId) const =0
virtual const G4DataVector & GetData(G4int componentId) const
static constexpr double barn
Definition: SystemOfUnits.h:85
bool G4bool
Definition: G4Types.hh:79
virtual const G4IDataSet * GetComponent(G4int componentId) const
static constexpr double MeV
G4double GetUnitData() const
G4double energy(const ThreeVector &p, const G4double m)
const G4IInterpolator * GetAlgorithm() const
virtual G4bool LoadData(const G4String &fileName)
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