G4DNAMolecularMaterial.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 // $Id: G4DNAMolecularMaterial.hh 64057 2012-10-30 15:04:49Z gcosmo $
00027 //
00028 #ifndef G4DNAMolecularMaterial_HH
00029 #define G4DNAMolecularMaterial_HH
00030 
00031 #include "globals.hh"
00032 #include "G4ios.hh"
00033 #include <map>
00034 #include <vector>
00035 #include "G4VStateDependent.hh"
00036 
00037 class G4Material;
00038 
00039 struct CompareMaterial
00040 {
00041     // If the materials derives from a base material,
00042     // it should be able to find the derived material using the base material.
00043     bool operator() (const G4Material* mat1, const G4Material* mat2) const;
00044 };
00045 
00046 typedef std::map<const G4Material*, double,CompareMaterial> ComponentMap;
00047 
00048 // G4DNAMolecularMaterial is initialized when G4ApplicationState == G4State_Idle
00049 
00050 class G4DNAMolecularMaterial : public G4VStateDependent
00051 {
00052 public:
00053     static G4DNAMolecularMaterial* Instance();
00054     void DeleteInstance();
00055     void Initialize();
00056 
00057     virtual G4bool Notify(G4ApplicationState requestedState) ;
00058 
00059     inline const std::vector<ComponentMap>* GetMassFractionTable() const;
00060     inline const std::vector<ComponentMap>* GetDensityTable() const;
00061 //    const std::vector<double>* GetMassFractionTableFor(const G4Material*) const;
00062     const std::vector<double>* GetDensityTableFor(const G4Material*) const;
00063     const std::vector<double>* GetNumMolPerVolTableFor(const G4Material*) const;
00064 
00065 protected :
00066     static G4DNAMolecularMaterial* fInstance;
00067     G4DNAMolecularMaterial();
00068     G4DNAMolecularMaterial(const G4DNAMolecularMaterial& right);
00069     G4DNAMolecularMaterial& operator=(const G4DNAMolecularMaterial&);
00070     virtual ~G4DNAMolecularMaterial();
00071     void Create();
00072     void InitializeNumMolPerVol();
00073     void InitializeDensity();
00074     void RecordMolecularMaterial(G4Material* parentMaterial, G4Material* molecularMaterial, G4double fraction);
00075     void SearchMolecularMaterial(G4Material* parentMaterial, G4Material* material, double currentFraction);
00076 
00077     void AddMaterial(const G4Material*, double fraction);
00078 
00079     void PrintNotAMolecularMaterial(const char* methodName, const G4Material* lookForMaterial) const;
00080 
00081     std::vector<ComponentMap>* fpCompFractionTable;
00082     std::vector<ComponentMap>* fpCompDensityTable;
00083     std::vector<ComponentMap>* fpCompNumMolPerVolTable;
00084 
00085     mutable std::map<const G4Material*,std::vector<double>*,CompareMaterial> fAskedDensityTable;
00086     mutable std::map<const G4Material*,std::vector<double>*,CompareMaterial> fAskedNumPerVolTable;
00087     mutable std::map<const G4Material*,bool,CompareMaterial> fWarningPrinted;
00088 
00089     G4bool fIsInitialized;
00090 };
00091 
00092 inline const std::vector<ComponentMap> *G4DNAMolecularMaterial::GetMassFractionTable() const
00093 {
00094     return fpCompFractionTable;
00095 }
00096 
00097 inline const std::vector<ComponentMap>* G4DNAMolecularMaterial::GetDensityTable() const
00098 {
00099     return fpCompDensityTable;
00100 }
00101 
00102 #endif // G4DNAMolecularMaterial_HH

Generated on Mon May 27 17:48:03 2013 for Geant4 by  doxygen 1.4.7