58 if (regionSensitive && (region != theRegion))
return;
68 shape_mat_info_v.push_back({});
70 shape_mat_info_t & thisMaterialInfo = shape_mat_info_v.back();
74 const std::vector<const G4Element*> * ElementVector_ptr = material->
GetElementVector();
75 for(
auto & element : *ElementVector_ptr)
77 thisMaterialInfo.aveA += element->GetA();
78 thisMaterialInfo.aveZ += element->GetZ();
80 thisMaterialInfo.aveA /= ElementVector_ptr->size();
81 thisMaterialInfo.aveZ /= ElementVector_ptr->size();
83 thisMaterialInfo.density = material->
GetDensity();
84 thisMaterialInfo.radiation_length = material->
GetRadlen();
87 thisMaterialInfo.integrated_thickness = length;
89 thisMaterialInfo.x0 = stlen / (material->
GetRadlen());
90 thisMaterialInfo.integrated_lambda = lambda;
91 thisMaterialInfo.integrated_x0 = x0;
92 thisMaterialInfo.entry_point = preStepPoint->
GetPosition();
94 thisMaterialInfo.material_name = material->
GetName();
103 G4int matname_colwidth = 15;
106 oss <<
" Material Atomic properties (averaged) Radiation Interaction Integr. Lambda X0 Entry point Exit point\n name Mass Z density length length Thickness Thickness (cm) (cm)\n (g/mole) (g/cm3) (cm) (cm) (cm) (cm) \n";
110 std::ios::fmtflags os_flags (oss.flags());
111 for(
auto & matInfo : shape_mat_info_v)
113 oss << std::setw(matname_colwidth) << std::left << matInfo.GetName(matname_colwidth) <<
" ";
115 oss << std::setw(colwidth) << std::fixed << std::setprecision(2) << matInfo.aveA / (CLHEP::g/CLHEP::mole);
116 oss << std::setw(colwidth) << std::fixed << std::setprecision(2) << matInfo.aveZ;
117 oss << std::setw(colwidth) << std::scientific << std::setprecision(2) << matInfo.density / (CLHEP::g/CLHEP::cm3);
118 oss << std::setw(colwidth) << std::scientific << matInfo.radiation_length / CLHEP::cm;
119 oss << std::setw(colwidth) << std::scientific << matInfo.interaction_length / CLHEP::cm;
120 oss << std::setw(colwidth) << std::scientific << matInfo.thickness/CLHEP::cm;
121 oss << std::setw(colwidth) << std::scientific << matInfo.integrated_thickness/CLHEP::cm;
122 oss << std::setw(colwidth) << std::scientific << matInfo.lambda;
123 oss << std::setw(colwidth) << std::scientific << matInfo.x0;
124 oss << std::setw(colwidth) <<
" ";
125 oss << std::scientific << std::right <<
"(";
126 oss << std::scientific << std::left << matInfo.entry_point.x()/CLHEP::cm;
127 oss <<
", " << matInfo.entry_point.y()/CLHEP::cm;
128 oss <<
", " << matInfo.entry_point.z()/CLHEP::cm <<
")";
129 oss << std::setw(colwidth) <<
" ";
130 oss << std::scientific << std::right <<
"(";
131 oss << std::scientific << std::left << matInfo.exit_point.x()/CLHEP::cm;
132 oss <<
", " << matInfo.exit_point.y()/CLHEP::cm;
133 oss <<
", " << matInfo.exit_point.z()/CLHEP::cm <<
")";
143 std::map<G4String, shape_mat_info_t> mat_db;
145 for(
auto & matInfo : shape_mat_info_v)
147 G4String key = matInfo.material_name;
148 if( 0 == mat_db.count( key ) )
150 mat_db[key] = shape_mat_info_t{};
153 mat_db[key].x0 += matInfo.x0;
154 mat_db[key].thickness += matInfo.thickness;
155 mat_db[key].lambda += matInfo.lambda;
158 std::ios::fmtflags os_flags (oss.flags());
159 oss << std::scientific << std::setprecision(2) <<
'\t';
160 for(
auto & [key,mat] : mat_db)
162 <<
'\t'<< mat.thickness/CLHEP::mm
164 <<
'\t'<< mat.lambda;