23 const std::vector<unsigned short int>& materialIndices,
double splitFactor)
25 m_binUtility(binutility.
clone()),
26 m_fullMaterial(fullProperties),
27 m_materialBins(materialIndices) {}
30 std::unique_ptr<Trk::BinUtility> binutility,
32 const std::vector<unsigned short int>& materialIndices,
double splitFactor)
34 m_binUtility(binutility.
release()),
35 m_fullMaterial(fullProperties),
36 m_materialBins(materialIndices) {}
46 m_binUtility(lmp.m_binUtility->
clone()),
47 m_materialBins(lmp.m_materialBins) {
57 Trk::LayerMaterialProperties::operator=(lmp);
76 for (
auto& matIter : m_fullMaterial)
delete matIter;
77 m_fullMaterial.clear();
83 m_fullMaterial.clear();
84 m_fullMaterial.reserve(matVector.size());
85 for (
const auto& matIter : matVector)
86 m_fullMaterial.push_back(matIter ? matIter->clone() :
nullptr);
93 for (
auto& matIter : m_fullMaterial) {
99 m_fullMaterial[imat1] = mprop;
109 if (m_fullMaterial.empty() || !m_binUtility)
return nullptr;
111 size_t ibin1 = m_binUtility->bin(gp, 0);
113 size_t ibin2 = (m_binUtility->max(1) == 0) ? 0 : m_binUtility->bin(gp, 1);
115 return (ibin2 > m_binUtility->max(1)) ?
nullptr : material(ibin1, ibin2);
119 sl <<
"Trk::CompressedLayerMaterial : " << std::endl;
120 sl <<
" - Number of Material bins (1/2) : " << m_binUtility->max(0) + 1
121 <<
" / " << m_binUtility->max(1) + 1 << std::endl;
122 sl <<
" - Parse full update material : " << std::endl;
125 for (
const auto& matIter : m_fullMaterial) {
127 sl <<
" Bin [" << imat1 <<
"] - " << matIter << std::endl;
129 sl <<
" Bin [" << imat1 <<
"] - empty " << std::endl;
136 sl <<
"Trk::CompressedLayerMaterial : " << std::endl;
137 sl <<
" - Number of Material bins (1/2) : " << m_binUtility->max(0) + 1
138 <<
" / " << m_binUtility->max(1) + 1 << std::endl;
139 sl <<
" - Parse full update material : " << std::endl;
141 for (
const auto& matIter : m_fullMaterial) {
143 sl <<
" Bin [" << imat1 <<
"] - " << matIter << std::endl;
145 sl <<
" Bin [" << imat1 <<
"] - empty " << std::endl;