Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4DNAMolecularMaterial.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 // $Id: G4DNAMolecularMaterial.hh 101354 2016-11-15 08:27:51Z gcosmo $
27 //
28 // Author: Mathieu Karamitros
29 //
30 // We would be very happy hearing from you, send us your feedback! :)
31 //
32 // In order for Geant4-DNA to be maintained and still open-source,
33 // article citations are crucial.
34 // If you use Geant4-DNA chemistry and you publish papers about your software,
35 // in addition to the general paper on Geant4-DNA:
36 //
37 // Int. J. Model. Simul. Sci. Comput. 1 (2010) 157–178
38 //
39 // we would be very happy if you could please also cite the following
40 // reference papers on chemistry:
41 //
42 // J. Comput. Phys. 274 (2014) 841-882
43 // Prog. Nucl. Sci. Tec. 2 (2011) 503-508
44 
45 #ifndef G4DNAMolecularMaterial_HH
46 #define G4DNAMolecularMaterial_HH
47 
48 #include "globals.hh"
49 #include "G4ios.hh"
50 #include <map>
51 #include <vector>
52 #include "G4VStateDependent.hh"
53 
54 class G4Material;
56 
58 {
59  // If the materials derives from a base material,
60  // it should be able to find the derived material using the base material.
61  bool operator()(const G4Material* mat1, const G4Material* mat2) const;
62 };
63 
64 typedef std::map<const G4Material*, double, CompareMaterial> ComponentMap;
65 
66 // G4DNAMolecularMaterial is initialized when G4ApplicationState == G4State_Idle
67 
69 {
70 public:
72  static void DeleteInstance();
73  void Initialize();
74  void Clear();
75 
76  virtual G4bool Notify(G4ApplicationState requestedState);
77 
78  //----------------------------------------------------------------------------
79 
80  const std::vector<double>* GetDensityTableFor(const G4Material*) const;
81  const std::vector<double>* GetNumMolPerVolTableFor(const G4Material*) const;
82 
83  inline const std::vector<ComponentMap>* GetMassFractionTable() const{
84  return fpCompFractionTable;
85  }
86  inline const std::vector<ComponentMap>* GetDensityTable() const{
87  return fpCompDensityTable;
88  }
89 
90  //----------------------------------------------------------------------------
91 
96  const G4String&);
97 
98  void SetMolecularConfiguration(const G4String& materialName,
99  const G4String& molUserIF);
100 
101 protected:
106  virtual ~G4DNAMolecularMaterial();
107  void Create();
108  void InitializeNumMolPerVol();
109  void InitializeDensity();
110  void RecordMolecularMaterial(G4Material* parentMaterial,
111  G4Material* molecularMaterial,
112  G4double fraction);
113  void SearchMolecularMaterial(G4Material* parentMaterial,
114  G4Material* material,
115  double currentFraction);
116 
117  void AddMaterial(const G4Material*, double fraction);
118 
119  void PrintNotAMolecularMaterial(const char* methodName,
120  const G4Material* lookForMaterial) const;
121 
122  std::vector<ComponentMap>* fpCompFractionTable;
123  std::vector<ComponentMap>* fpCompDensityTable;
124  std::vector<ComponentMap>* fpCompNumMolPerVolTable;
125 
126  mutable std::map<const G4Material*, std::vector<double>*, CompareMaterial>
128  mutable std::map<const G4Material*, std::vector<double>*, CompareMaterial>
130  mutable std::map<const G4Material*, bool, CompareMaterial> fWarningPrinted;
131 
132  std::map<int /*Material ID*/,
134 
136  size_t fNMaterials;
137 };
138 
139 #endif // G4DNAMolecularMaterial_HH
const std::vector< double > * GetDensityTableFor(const G4Material *) const
std::map< const G4Material *, double, CompareMaterial > ComponentMap
void SearchMolecularMaterial(G4Material *parentMaterial, G4Material *material, double currentFraction)
void SetMolecularConfiguration(const G4Material *, G4MolecularConfiguration *)
virtual G4bool Notify(G4ApplicationState requestedState)
std::map< const G4Material *, std::vector< double > *, CompareMaterial > fAskedNumPerVolTable
void RecordMolecularMaterial(G4Material *parentMaterial, G4Material *molecularMaterial, G4double fraction)
bool operator()(const G4Material *mat1, const G4Material *mat2) const
void PrintNotAMolecularMaterial(const char *methodName, const G4Material *lookForMaterial) const
std::map< int, G4MolecularConfiguration * > fMaterialToMolecularConf
const std::vector< ComponentMap > * GetMassFractionTable() const
void AddMaterial(const G4Material *, double fraction)
std::vector< ComponentMap > * fpCompNumMolPerVolTable
std::map< const G4Material *, std::vector< double > *, CompareMaterial > fAskedDensityTable
static G4DNAMolecularMaterial * fInstance
const std::vector< double > * GetNumMolPerVolTableFor(const G4Material *) const
bool G4bool
Definition: G4Types.hh:79
G4DNAMolecularMaterial & operator=(const G4DNAMolecularMaterial &)
std::map< const G4Material *, bool, CompareMaterial > fWarningPrinted
static G4DNAMolecularMaterial * Instance()
std::vector< ComponentMap > * fpCompFractionTable
std::vector< ComponentMap > * fpCompDensityTable
double G4double
Definition: G4Types.hh:76
const std::vector< ComponentMap > * GetDensityTable() const
G4ApplicationState
G4MolecularConfiguration * GetMolecularConfiguration(const G4Material *) const