|
|
|||
File indexing completed on 2025-12-16 09:28:59
0001 // 0002 // ******************************************************************** 0003 // * License and Disclaimer * 0004 // * * 0005 // * The Geant4 software is copyright of the Copyright Holders of * 0006 // * the Geant4 Collaboration. It is provided under the terms and * 0007 // * conditions of the Geant4 Software License, included in the file * 0008 // * LICENSE and available at http://cern.ch/geant4/license . These * 0009 // * include a list of copyright holders. * 0010 // * * 0011 // * Neither the authors of this software system, nor their employing * 0012 // * institutes,nor the agencies providing financial support for this * 0013 // * work make any representation or warranty, express or implied, * 0014 // * regarding this software system or assume any liability for its * 0015 // * use. Please see the license in the file LICENSE and URL above * 0016 // * for the full disclaimer and the limitation of liability. * 0017 // * * 0018 // * This code implementation is the result of the scientific and * 0019 // * technical work of the GEANT4 collaboration. * 0020 // * By using, copying, modifying or distributing the software (or * 0021 // * any work based on the software) you agree to acknowledge its * 0022 // * use in resulting scientific publications, and indicate your * 0023 // * acceptance of all terms of the Geant4 Software license. * 0024 // ******************************************************************** 0025 // 0026 /////////////////////////////////////////////////////////////////////////////// 0027 // File: CCalMaterialFactory.hh 0028 // Description: CCalMaterialFactory is a singleton class to get from a file 0029 // the information to build CMS Materials. A G4Material is built 0030 // only if asked. A parallel structure with the file information 0031 // is keeped in a CCalMaterial pointer vector (CCalMaterialTable). 0032 /////////////////////////////////////////////////////////////////////////////// 0033 #ifndef CCalMaterialFactory_h 0034 #define CCalMaterialFactory_h 1 0035 0036 #include <fstream> 0037 0038 #include "CCalMaterial.hh" 0039 #include "CCalAMaterial.hh" 0040 0041 #include "G4MaterialTable.hh" 0042 #include "G4ElementTable.hh" 0043 0044 typedef std::vector<CCalMaterial*> CCalMaterialTable; 0045 typedef std::vector<CCalAMaterial*> CCalAMaterialTable; 0046 0047 class CCalMaterialFactory { 0048 public: 0049 enum MatDescription {byWeight, byVolume, byAtomic}; 0050 0051 ~CCalMaterialFactory(); 0052 0053 static CCalMaterialFactory* getInstance(const G4String&, const G4String&); 0054 static CCalMaterialFactory* getInstance(const G4String&); 0055 static CCalMaterialFactory* getInstance(); 0056 0057 G4Material* findMaterial(const G4String& ) const; 0058 G4Element* findElement (const G4String& ) const; 0059 0060 //Adds a new CCal Material to the list and returns a G4Material. 0061 G4Element* addElement (const G4String&, const G4String&, G4double, 0062 G4double, G4double ); 0063 //Adds a new CCal Material to the list and returns a G4Material. 0064 G4Material* addMaterial(const G4String& nam, G4double density, 0065 G4int nconst, G4String mats[], G4double prop[], 0066 MatDescription md=byWeight); 0067 0068 void readElements (const G4String&); 0069 void readMaterials(const G4String&); 0070 0071 protected: 0072 void readElements(std::ifstream&); 0073 void readMaterials(std::ifstream&); 0074 0075 private: 0076 //Constructor 0077 CCalMaterialFactory(); 0078 0079 G4Material* findG4Material (const G4String& ) const; 0080 CCalMaterial* findCCalMaterial (const G4String& ) const; 0081 CCalAMaterial* findCCalAMaterial(const G4String& ) const; 0082 0083 //Adds a CCalMaterial to the list. Used by readMaterials and addMaterial. 0084 CCalMaterial* addCCalMaterial(const G4String& nam, G4double density, 0085 G4int nconst, G4String mats[], G4double prop[], 0086 MatDescription md=byWeight); 0087 0088 private: 0089 static CCalMaterialFactory* instance; 0090 0091 static G4String elementfile; //File with the elements. 0092 static G4String mixturefile; //File with the materials. 0093 0094 CCalMaterialTable theCCalMaterials; //Where the CCalMaterials are stored 0095 CCalAMaterialTable theCCalAMaterials; //Where the CCalAMaterials are stored 0096 0097 }; 0098 0099 #endif
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|