Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 79184 2014-02-20 09:14:38Z gcosmo $
27 //
28 #ifndef G4DNAMolecularMaterial_HH
29 #define G4DNAMolecularMaterial_HH
30 
31 #include "globals.hh"
32 #include "G4ios.hh"
33 #include <map>
34 #include <vector>
35 #include "G4VStateDependent.hh"
36 
37 class G4Material;
38 
40 {
41  // If the materials derives from a base material,
42  // it should be able to find the derived material using the base material.
43  bool operator() (const G4Material* mat1, const G4Material* mat2) const;
44 };
45 
46 typedef std::map<const G4Material*, double,CompareMaterial> ComponentMap;
47 
48 // G4DNAMolecularMaterial is initialized when G4ApplicationState == G4State_Idle
49 
51 {
52 public:
54  void DeleteInstance();
55  void Initialize();
56 
57  virtual G4bool Notify(G4ApplicationState requestedState) ;
58 
59  inline const std::vector<ComponentMap>* GetMassFractionTable() const;
60  inline const std::vector<ComponentMap>* GetDensityTable() const;
61 // const std::vector<double>* GetMassFractionTableFor(const G4Material*) const;
62  const std::vector<double>* GetDensityTableFor(const G4Material*) const;
63  const std::vector<double>* GetNumMolPerVolTableFor(const G4Material*) const;
64 
65 protected :
67 // static G4ThreadLocal G4DNAMolecularMaterial* fInstance;
71  virtual ~G4DNAMolecularMaterial();
72  void Create();
74  void InitializeDensity();
75  void RecordMolecularMaterial(G4Material* parentMaterial, G4Material* molecularMaterial, G4double fraction);
76  void SearchMolecularMaterial(G4Material* parentMaterial, G4Material* material, double currentFraction);
77 
78  void AddMaterial(const G4Material*, double fraction);
79 
80  void PrintNotAMolecularMaterial(const char* methodName, const G4Material* lookForMaterial) const;
81 
82  std::vector<ComponentMap>* fpCompFractionTable;
83  std::vector<ComponentMap>* fpCompDensityTable;
84  std::vector<ComponentMap>* fpCompNumMolPerVolTable;
85 
86  mutable std::map<const G4Material*,std::vector<double>*,CompareMaterial> fAskedDensityTable;
87  mutable std::map<const G4Material*,std::vector<double>*,CompareMaterial> fAskedNumPerVolTable;
88  mutable std::map<const G4Material*,bool,CompareMaterial> fWarningPrinted;
89 
91  size_t fNMaterials;
92 };
93 
94 inline const std::vector<ComponentMap> *G4DNAMolecularMaterial::GetMassFractionTable() const
95 {
96  return fpCompFractionTable;
97 }
98 
99 inline const std::vector<ComponentMap>* G4DNAMolecularMaterial::GetDensityTable() const
100 {
101  return fpCompDensityTable;
102 }
103 
104 #endif // G4DNAMolecularMaterial_HH
const std::vector< double > * GetDensityTableFor(const G4Material *) const
void SearchMolecularMaterial(G4Material *parentMaterial, G4Material *material, double currentFraction)
virtual G4bool Notify(G4ApplicationState requestedState)
void RecordMolecularMaterial(G4Material *parentMaterial, G4Material *molecularMaterial, G4double fraction)
const std::vector< ComponentMap > * GetMassFractionTable() const
std::map< const G4Material *, double, CompareMaterial > ComponentMap
bool operator()(const G4Material *mat1, const G4Material *mat2) const
void PrintNotAMolecularMaterial(const char *methodName, const G4Material *lookForMaterial) const
void AddMaterial(const G4Material *, double fraction)
std::vector< ComponentMap > * fpCompNumMolPerVolTable
string material
Definition: eplot.py:19
static G4DNAMolecularMaterial * fInstance
std::map< const G4Material *, std::vector< double > *, CompareMaterial > fAskedNumPerVolTable
const std::vector< double > * GetNumMolPerVolTableFor(const G4Material *) const
std::map< const G4Material *, std::vector< double > *, CompareMaterial > fAskedDensityTable
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