#include <CCalMaterialFactory.hh>
Definition at line 47 of file CCalMaterialFactory.hh.
CCalMaterialFactory::~CCalMaterialFactory |
( |
| ) |
|
Definition at line 96 of file CCalMaterialFactory.cc.
97 CCalMaterialTable::iterator ite;
98 for(ite = theCCalMaterials.begin(); ite != theCCalMaterials.end(); ite++ ){
101 theCCalMaterials.clear();
102 CCalAMaterialTable::iterator itea;
103 for(itea = theCCalAMaterials.begin(); itea != theCCalAMaterials.end();
107 theCCalAMaterials.clear();
Definition at line 162 of file CCalMaterialFactory.cc.
170 theCCalAMaterials.push_back(theMat);
G4GLOB_DLL std::ostream G4cout
double A(double temperature)
static constexpr double mole
Definition at line 179 of file CCalMaterialFactory.cc.
185 addCCalMaterial(
name, density, nconst, mats, prop, md);
G4Material * findMaterial(const G4String &) const
Definition at line 149 of file CCalMaterialFactory.cc.
151 for (
unsigned int i=0; i<theElements.size(); i++)
152 if (theElements[i]->GetName()==mat){
156 return theElements[i];
G4GLOB_DLL std::ostream G4cout
std::vector< G4Element * > G4ElementTable
static G4ElementTable * GetElementTable()
Definition at line 111 of file CCalMaterialFactory.cc.
116 G4cout <<
"Material " << mat <<
" already defined. Returning previous "
130 ed <<
" Could not build material " << mat <<
"." <<
G4endl;
131 G4Exception(
"CCalMaterialFactory::findMaterial()",
"ccal001",
137 G4cout <<
"Material " << mat <<
" has been built successfully." <<
G4endl;
141 G4cerr <<
"ERROR: Material " << mat <<
" not found in CCal database!!!"
double Weight(int i) const
std::ostringstream G4ExceptionDescription
G4GLOB_DLL std::ostream G4cout
static constexpr double cm3
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4String Element(int i) const
void AddElement(G4Element *element, G4int nAtoms)
G4Element * findElement(const G4String &) const
G4GLOB_DLL std::ostream G4cerr
Definition at line 53 of file CCalMaterialFactory.cc.
55 if ((matfile==
"" || matfile==elementfile) &&
56 (mixfile==
"" || mixfile==mixturefile))
58 else if ((matfile !=
"" && elementfile !=
"" && matfile != elementfile) ||
59 (mixfile !=
"" && mixturefile !=
"" && mixfile != mixturefile)) {
60 G4cerr <<
"ERROR: Trying to get materials from " << matfile <<
" and "
61 << mixfile <<
" while previously were retrieved from "
62 << elementfile <<
" and " << mixturefile <<
"." <<
G4endl;
65 if (elementfile ==
"")
67 if (mixturefile ==
"")
static CCalMaterialFactory * getInstance()
G4GLOB_DLL std::ostream G4cerr
Definition at line 79 of file CCalMaterialFactory.cc.
80 if (elementfile==
"" || mixturefile==
"") {
81 G4cerr <<
"ERROR: You haven't defined files to be used for materials in "
82 <<
"CCalMaterialFactory::getInstance(const G4String&,const G4String&)"
static MCTruthManager * instance
G4GLOB_DLL std::ostream G4cerr
void CCalMaterialFactory::readElements |
( |
const G4String & |
matfile | ) |
|
Definition at line 190 of file CCalMaterialFactory.cc.
193 if (getenv(
"CCAL_GLOBALPATH"))
194 path = getenv(
"CCAL_GLOBALPATH");
196 G4cout <<
" ==> Opening file " << matfile <<
" to read elements..." <<
G4endl;
200 G4cerr <<
"ERROR: Could not open file " << matfile <<
G4endl;
void readElements(const G4String &)
bool openGeomFile(std::ifstream &is, const G4String &pathname, const G4String &filename)
std::ifstream & findDO(std::ifstream &, const G4String &)
G4GLOB_DLL std::ostream G4cout
G4GLOB_DLL std::ostream G4cerr
void CCalMaterialFactory::readElements |
( |
std::ifstream & |
is | ) |
|
|
protected |
Definition at line 346 of file CCalMaterialFactory.cc.
351 G4cout <<
" Element \tsymbol\tA\tZ\tdensity\tX_0 abs_l"<<
G4endl;
357 while (name !=
"*ENDDO") {
360 is >> symbol >> A >> Z >> density >>
jump;
362 G4cout <<
" " << name <<
" \t" << symbol <<
"\t"
363 << A <<
"\t" << Z <<
"\t" << density <<
G4endl;
369 <<
" elements read from file" << G4endl <<
G4endl;
G4Element * addElement(const G4String &, const G4String &, G4double, G4double, G4double)
std::istream & jump(std::istream &)
std::ifstream & readName(std::ifstream &, G4String &)
G4GLOB_DLL std::ostream G4cout
double A(double temperature)
static G4ElementTable * GetElementTable()
void CCalMaterialFactory::readMaterials |
( |
const G4String & |
matfile | ) |
|
Definition at line 213 of file CCalMaterialFactory.cc.
216 if (getenv(
"CCAL_GLOBALPATH"))
217 path = getenv(
"CCAL_GLOBALPATH");
219 G4cout <<
" ==> Opening file " << matfile <<
" to read materials..." <<
G4endl;
223 G4cerr <<
"ERROR: Could not open file " << matfile <<
G4endl;
bool openGeomFile(std::ifstream &is, const G4String &pathname, const G4String &filename)
std::ifstream & findDO(std::ifstream &, const G4String &)
G4GLOB_DLL std::ostream G4cout
void readMaterials(const G4String &)
G4GLOB_DLL std::ostream G4cerr
void CCalMaterialFactory::readMaterials |
( |
std::ifstream & |
is | ) |
|
|
protected |
Definition at line 373 of file CCalMaterialFactory.cc.
386 density,
kStateGas, temperature, pressure);
391 while (name !=
"*ENDDO") {
396 is >> nElem >> dens >>
jump;
400 <<
" made of " << nElem
401 <<
" elements. Density=" << dens
405 G4int absnelem = std::abs(nElem);
411 for(
int i=0; i<absnelem; i++) {
415 weights[i]=std::abs(prop);
418 if (nElem>0 && prop<0)
425 addCCalMaterial(matname, dens, absnelem, mats, weights, md);
432 G4cout <<
" " << theCCalMaterials.size() <<
" materials read from "
433 << mixturefile << G4endl <<
G4endl;
int universe_mean_density
std::istream & jump(std::istream &)
std::ifstream & readName(std::ifstream &, G4String &)
G4GLOB_DLL std::ostream G4cout
static constexpr double kelvin
static constexpr double mole
The documentation for this class was generated from the following files: