9 #include <boost/test/unit_test.hpp>
33 BOOST_CHECK_EQUAL(accMat0D.size(), 1
u);
34 BOOST_CHECK_EQUAL(accMat0D[0].
size(), 1
u);
35 BOOST_CHECK_EQUAL(material0D.splitFactor(), 0.);
41 auto accMat1D = material1D.accumulatedMaterial();
42 BOOST_CHECK_EQUAL(accMat1D.size(), 1
u);
43 BOOST_CHECK_EQUAL(accMat1D[0].
size(), 10
u);
50 auto accMat2D = material2D.accumulatedMaterial();
51 BOOST_CHECK_EQUAL(accMat2D.size(), 20
u);
52 for (
size_t ib = 0;
ib < accMat2D.size(); ++
ib) {
53 BOOST_CHECK_EQUAL(accMat2D[
ib].
size(), 10
u);
64 const std::vector<std::array<size_t, 3>> bin;
67 material0D.accumulate(
Vector2{0., 0.}, one);
68 material0D.trackVariance(bin, one);
69 material0D.trackAverage();
71 material0D.accumulate(
Vector3(0., 0., 0.), two);
72 material0D.trackVariance(bin, one);
73 material0D.trackAverage();
75 auto accMat0D = material0D.accumulatedMaterial();
76 auto accMatProp0D = accMat0D[0][0];
77 auto [matProp0D, trackCount] = accMatProp0D.totalAverage();
78 auto [matVar0D, trackCount2] = accMatProp0D.totalVariance();
80 BOOST_CHECK_EQUAL(matVar0D, 0.0);
81 BOOST_CHECK_EQUAL(matProp0D.thicknessInX0(), two.
thicknessInX0());
82 BOOST_CHECK_EQUAL(trackCount, trackCount2);
83 BOOST_CHECK_EQUAL(trackCount, 2
u);
98 const std::vector<std::array<size_t, 3>> bin;
102 material2D.accumulate(
Vector2{-0.5, -0.5}, one);
103 material2D.accumulate(
Vector2{0.5, -0.5}, two);
104 material2D.accumulate(
Vector2{-0.5, 0.5}, three);
105 material2D.accumulate(
Vector2{0.5, 0.5}, four);
106 material2D.trackVariance(bin, one);
107 material2D.trackAverage();
109 material2D.accumulate(
Vector2{0.5, -0.5}, two);
110 material2D.accumulate(
Vector2{-0.5, 0.5}, three);
111 material2D.accumulate(
Vector2{0.5, 0.5}, four);
112 material2D.trackVariance(bin, one);
113 material2D.trackAverage();
115 material2D.accumulate(
Vector2{-0.5, 0.5}, three);
116 material2D.accumulate(
Vector2{0.5, 0.5}, four);
117 material2D.trackVariance(bin, one);
118 material2D.trackAverage();
120 material2D.accumulate(
Vector2{0.5, 0.5}, four);
121 material2D.trackVariance(bin, one);
122 material2D.trackAverage();
124 auto accMat2D = material2D.accumulatedMaterial();
126 auto [accMatProp00, trackCount00] = accMat2D[0][0].totalAverage();
127 auto [accMatProp01, trackCount01] = accMat2D[0][1].totalAverage();
128 auto [accMatProp10, trackCount10] = accMat2D[1][0].totalAverage();
129 auto [accMatProp11, trackCount11] = accMat2D[1][1].totalAverage();
131 auto [matVar00, trackCount200] = accMat2D[0][0].totalVariance();
132 auto [matVar01, trackCount201] = accMat2D[0][1].totalVariance();
133 auto [matVar10, trackCount210] = accMat2D[1][0].totalVariance();
134 auto [matVar11, trackCount211] = accMat2D[1][1].totalVariance();
136 BOOST_CHECK_EQUAL(accMatProp00.thicknessInX0(), one.
thicknessInX0());
137 BOOST_CHECK_EQUAL(accMatProp01.thicknessInX0(), two.
thicknessInX0());
138 BOOST_CHECK_EQUAL(accMatProp10.thicknessInX0(), three.
thicknessInX0());
139 BOOST_CHECK_EQUAL(accMatProp11.thicknessInX0(), four.
thicknessInX0());
141 BOOST_CHECK_EQUAL(matVar11, 0.0);
142 BOOST_CHECK_EQUAL(matVar11, 0.0);
143 BOOST_CHECK_EQUAL(matVar11, 0.0);
144 BOOST_CHECK_EQUAL(matVar11, 0.0);
146 BOOST_CHECK_EQUAL(trackCount00, trackCount200);
147 BOOST_CHECK_EQUAL(trackCount01, trackCount201);
148 BOOST_CHECK_EQUAL(trackCount10, trackCount210);
149 BOOST_CHECK_EQUAL(trackCount11, trackCount211);
151 BOOST_CHECK_EQUAL(trackCount00, 1
u);
152 BOOST_CHECK_EQUAL(trackCount01, 2
u);
153 BOOST_CHECK_EQUAL(trackCount10, 3
u);
154 BOOST_CHECK_EQUAL(trackCount11, 4
u);
168 const std::vector<std::array<size_t, 3>> bin;
171 material0D.trackVariance(bin, avg);
172 material0D.trackAverage();
174 material0D.accumulate(
Vector3(0., 0., 0.), two);
175 material0D.trackVariance(bin, avg);
176 material0D.trackAverage();
178 auto accMat0D = material0D.accumulatedMaterial();
179 auto accMatProp0D = accMat0D[0][0];
180 auto [matProp0D, trackCount] = accMatProp0D.totalAverage();
181 auto [matVar0D, trackCount2] = accMatProp0D.totalVariance();
183 BOOST_CHECK_EQUAL(matVar0D, 1.0);
184 BOOST_CHECK_EQUAL(matProp0D.thicknessInX0(), avg.
thicknessInX0());
185 BOOST_CHECK_EQUAL(trackCount, trackCount2);
186 BOOST_CHECK_EQUAL(trackCount, 2
u);