Geant4  10.01.p02
CCalMaterialFactory.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 //
27 // File: CCalMaterialFactory.hh
28 // Description: CCalMaterialFactory is a singleton class to get from a file
29 // the information to build CMS Materials. A G4Material is built
30 // only if asked. A parallel structure with the file information
31 // is keeped in a CCalMaterial pointer vector (CCalMaterialTable).
33 #ifndef CCalMaterialFactory_h
34 #define CCalMaterialFactory_h 1
35 
36 #include <fstream>
37 
38 #include "CCalMaterial.hh"
39 #include "CCalAMaterial.hh"
40 
41 #include "G4MaterialTable.hh"
42 #include "G4ElementTable.hh"
43 
44 typedef std::vector<CCalMaterial*> CCalMaterialTable;
45 typedef std::vector<CCalAMaterial*> CCalAMaterialTable;
46 
48 public:
50 
52 
53  static CCalMaterialFactory* getInstance(const G4String&, const G4String&);
56 
57  G4Material* findMaterial(const G4String& ) const;
58  G4Element* findElement (const G4String& ) const;
59 
60  //Adds a new CCal Material to the list and returns a G4Material.
61  G4Element* addElement (const G4String&, const G4String&, G4double,
62  G4double, G4double );
63  //Adds a new CCal Material to the list and returns a G4Material.
65  G4int nconst, G4String mats[], G4double prop[],
67 
68  void readElements (const G4String&);
69  void readMaterials(const G4String&);
70 
71 protected:
72  void readElements(std::ifstream&);
73  void readMaterials(std::ifstream&);
74 
75 private:
76  //Constructor
78 
79  G4Material* findG4Material (const G4String& ) const;
80  CCalMaterial* findCCalMaterial (const G4String& ) const;
82 
83  //Adds a CCalMaterial to the list. Used by readMaterials and addMaterial.
85  G4int nconst, G4String mats[], G4double prop[],
87 
88 
89 private:
91 
92  static G4String elementfile; //File with the elements.
93  static G4String mixturefile; //File with the materials.
94 
95  CCalMaterialTable theCCalMaterials; //Where the CCalMaterials are stored
96  CCalAMaterialTable theCCalAMaterials; //Where the CCalAMaterials are stored
97 
98 };
99 
100 #endif
static G4String mixturefile
void readElements(const G4String &)
static CCalMaterialFactory * instance
G4Element * addElement(const G4String &, const G4String &, G4double, G4double, G4double)
int G4int
Definition: G4Types.hh:78
CCalAMaterialTable theCCalAMaterials
std::vector< CCalAMaterial * > CCalAMaterialTable
G4double density
Definition: TRTMaterials.hh:39
G4Material * addMaterial(const G4String &nam, G4double density, G4int nconst, G4String mats[], G4double prop[], MatDescription md=byWeight)
G4Material * findMaterial(const G4String &) const
static G4String elementfile
CCalMaterial * addCCalMaterial(const G4String &nam, G4double density, G4int nconst, G4String mats[], G4double prop[], MatDescription md=byWeight)
CCalAMaterial * findCCalAMaterial(const G4String &) const
CCalMaterialTable theCCalMaterials
G4Material * findG4Material(const G4String &) const
std::vector< CCalMaterial * > CCalMaterialTable
void readMaterials(const G4String &)
static CCalMaterialFactory * getInstance()
double G4double
Definition: G4Types.hh:76
CCalMaterial * findCCalMaterial(const G4String &) const
G4Element * findElement(const G4String &) const