60 G4cerr <<
"ERROR: Trying to get materials from " << matfile <<
" and "
61 << mixfile <<
" while previously were retrieved from "
81 G4cerr <<
"ERROR: You haven't defined files to be used for materials in "
82 <<
"CCalMaterialFactory::getInstance(const G4String&,const G4String&)"
97 CCalMaterialTable::iterator ite;
102 CCalAMaterialTable::iterator itea;
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!!!"
151 for (
unsigned int i=0; i<theElements.size(); i++)
152 if (theElements[i]->GetName()==
mat){
156 return theElements[i];
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;
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;
242 for (
unsigned int i=0; i<theG4Materials.size(); i++) {
243 if (theG4Materials[i]->GetName()==
mat){
244 return theG4Materials[i];
256 G4cout <<
"CCalMaterial " << mat <<
" found!" <<
G4endl;
269 G4cout <<
"CCalMaterial " << mat <<
" found!" <<
G4endl;
291 for (
G4int i=0; i<nconst; i++){
297 G4cerr <<
"ERROR: Trying to build" << name <<
" out of unknown "
298 << mats[i] <<
"." <<
G4endl
299 <<
"Skiping this material!" <<
G4endl;
309 G4cerr <<
"ERROR: Trying to build" <<name <<
" out of unknown "
310 << mats[i] <<
"." <<
G4endl
311 <<
"Skiping this material!" <<
G4endl;
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;
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)
static constexpr double kelvin
static CCalMaterialFactory * instance
std::ostringstream G4ExceptionDescription
G4Element * addElement(const G4String &, const G4String &, G4double, G4double, G4double)
G4Material * addMaterial(const G4String &nam, G4double density, G4int nconst, G4String mats[], G4double prop[], MatDescription md=byWeight)
static G4MaterialTable * GetMaterialTable()
static G4String mixturefile
CCalAMaterial * ptrCCalAMaterial
G4Element * findElement(const G4String &) const
CCalMaterial * ptrCCalMaterial
static constexpr double universe_mean_density
std::ifstream & readName(std::ifstream &, G4String &)
static constexpr double g
CCalMaterial * findCCalMaterial(const G4String &) const
CCalMaterial * addCCalMaterial(const G4String &nam, G4double density, G4int nconst, G4String mats[], G4double prop[], MatDescription md=byWeight)
CCalAMaterial * findCCalAMaterial(const G4String &) const
void readElements(const G4String &)
CCalMaterialTable theCCalMaterials
void readMaterials(const G4String &)
std::vector< G4Element * > G4ElementTable
bool openGeomFile(std::ifstream &is, const G4String &pathname, const G4String &filename)
double A(double temperature)
std::ifstream & findDO(std::ifstream &, const G4String &)
G4Material * findMaterial(const G4String &) const
double Weight(int i) const
G4GLOB_DLL std::ostream G4cerr
std::vector< G4Material * > G4MaterialTable
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
CCalAMaterialTable theCCalAMaterials
std::istream & jump(std::istream &)
void AddElement(G4Element *element, G4int nAtoms)
G4Material * findG4Material(const G4String &) const
static G4String elementfile
G4GLOB_DLL std::ostream G4cout
G4String Element(int i) const
static constexpr double mole
static constexpr double cm3
static G4ElementTable * GetElementTable()
static CCalMaterialFactory * getInstance()