18 : m_splitFactor(splitFactor) {
25 const BinUtility& binUtility,
double splitFactor)
26 : m_binUtility(binUtility), m_splitFactor(splitFactor) {
36 if (m_binUtility.dimensions() == 0) {
37 m_accumulatedMaterial[0][0].accumulate(mp, pathCorrection);
40 size_t bin0 = m_binUtility.bin(lp, 0);
41 size_t bin1 = m_binUtility.bin(lp, 1);
42 m_accumulatedMaterial[bin1][bin0].accumulate(mp, pathCorrection);
43 return {bin0, bin1, 0};
49 if (m_binUtility.dimensions() == 0) {
50 m_accumulatedMaterial[0][0].accumulate(mp, pathCorrection);
53 std::array<size_t, 3> bTriple = m_binUtility.binTriple(gp);
54 m_accumulatedMaterial[bTriple[1]][bTriple[0]].accumulate(mp, pathCorrection);
62 if (m_binUtility.dimensions() == 0) {
63 m_accumulatedMaterial[0][0].trackVariance(slabReference, emptyHit);
66 std::array<size_t, 3> bTriple = m_binUtility.binTriple(gp);
67 std::vector<std::array<size_t, 3>> trackBins = {bTriple};
68 trackVariance(trackBins, slabReference);
73 const std::vector<std::array<size_t, 3>>& trackBins,
76 if (m_binUtility.dimensions() == 0) {
77 m_accumulatedMaterial[0][0].trackVariance(slabReference, emptyHit);
81 if (not trackBins.empty()) {
82 for (
auto bin : trackBins) {
83 m_accumulatedMaterial[bin[1]][bin[0]].trackVariance(slabReference);
87 for (
auto& matVec : m_accumulatedMaterial) {
88 for (
auto& mat : matVec) {
89 mat.trackVariance(slabReference);
98 if (m_binUtility.dimensions() == 0) {
99 m_accumulatedMaterial[0][0].trackAverage(emptyHit);
103 std::array<size_t, 3> bTriple = m_binUtility.binTriple(gp);
104 std::vector<std::array<size_t, 3>> trackBins = {bTriple};
105 trackAverage(trackBins, emptyHit);
110 const std::vector<std::array<size_t, 3>>& trackBins,
bool emptyHit) {
112 if (m_binUtility.dimensions() == 0) {
113 m_accumulatedMaterial[0][0].trackAverage(emptyHit);
118 if (not trackBins.empty()) {
119 for (
auto bin : trackBins) {
120 m_accumulatedMaterial[bin[1]][bin[0]].trackAverage(emptyHit);
124 for (
auto& matVec : m_accumulatedMaterial) {
125 for (
auto& mat : matVec) {
126 mat.trackAverage(emptyHit);
133 std::unique_ptr<const Acts::ISurfaceMaterial>
135 if (m_binUtility.bins() == 1) {
137 return std::make_unique<HomogeneousSurfaceMaterial>(
138 m_accumulatedMaterial[0][0].totalAverage().first, m_splitFactor);
142 m_binUtility.bins(1),
145 for (
size_t ib1 = 0; ib1 < m_binUtility.bins(1); ++ib1) {
146 for (
size_t ib0 = 0; ib0 < m_binUtility.bins(0); ++ib0) {
147 mpMatrix[ib1][ib0] = m_accumulatedMaterial[ib1][ib0].totalAverage().first;
151 return std::make_unique<const BinnedSurfaceMaterial>(
152 m_binUtility,
std::move(mpMatrix), m_splitFactor);