Geant4  9.6.p02
 All Classes 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 64057 2012-10-30 15:04:49Z 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 :
70  virtual ~G4DNAMolecularMaterial();
71  void Create();
73  void InitializeDensity();
74  void RecordMolecularMaterial(G4Material* parentMaterial, G4Material* molecularMaterial, G4double fraction);
75  void SearchMolecularMaterial(G4Material* parentMaterial, G4Material* material, double currentFraction);
76 
77  void AddMaterial(const G4Material*, double fraction);
78 
79  void PrintNotAMolecularMaterial(const char* methodName, const G4Material* lookForMaterial) const;
80 
81  std::vector<ComponentMap>* fpCompFractionTable;
82  std::vector<ComponentMap>* fpCompDensityTable;
83  std::vector<ComponentMap>* fpCompNumMolPerVolTable;
84 
85  mutable std::map<const G4Material*,std::vector<double>*,CompareMaterial> fAskedDensityTable;
86  mutable std::map<const G4Material*,std::vector<double>*,CompareMaterial> fAskedNumPerVolTable;
87  mutable std::map<const G4Material*,bool,CompareMaterial> fWarningPrinted;
88 
90 };
91 
92 inline const std::vector<ComponentMap> *G4DNAMolecularMaterial::GetMassFractionTable() const
93 {
94  return fpCompFractionTable;
95 }
96 
97 inline const std::vector<ComponentMap>* G4DNAMolecularMaterial::GetDensityTable() const
98 {
99  return fpCompDensityTable;
100 }
101 
102 #endif // G4DNAMolecularMaterial_HH