12 #include <framework/logging/Logger.h>
28 struct tessellatedSolidStr {
29 int tessellatedSolidID;
31 unsigned int nApexPerCell;
33 std::vector<std::vector<double>> posV1;
34 std::vector<std::vector<double>> posV2;
35 std::vector<std::vector<double>> posV3;
38 tessellatedSolidID = 0;
43 void defineDummyApex()
45 std::vector<double> apex;
46 for (
unsigned int i = 0; i < 3; i++)
48 posV1.push_back(apex);
49 posV2.push_back(apex);
50 posV3.push_back(apex);
52 void pushBackApexesCoordinates(
const std::vector<double>& apex1x,
const std::vector<double>& apex1y,
53 const std::vector<double>& apex1z,
54 const std::vector<double>& apex2x,
const std::vector<double>& apex2y,
const std::vector<double>& apex2z,
55 const std::vector<double>& apex3x,
const std::vector<double>& apex3y,
const std::vector<double>& apex3z)
57 if (nCells != apex1x.size())
58 B2ERROR(
"tessellatedSolidStr: apex1x.size() != nCells");
59 if (nCells != apex1y.size())
60 B2ERROR(
"tessellatedSolidStr: apex1y.size() != nCells");
61 if (nCells != apex1z.size())
62 B2ERROR(
"tessellatedSolidStr: apex1z.size() != nCells");
63 if (nCells != apex2x.size())
64 B2ERROR(
"tessellatedSolidStr: apex2x.size() != nCells");
65 if (nCells != apex2y.size())
66 B2ERROR(
"tessellatedSolidStr: apex2y.size() != nCells");
67 if (nCells != apex2z.size())
68 B2ERROR(
"tessellatedSolidStr: apex2z.size() != nCells");
69 if (nCells != apex3x.size())
70 B2ERROR(
"tessellatedSolidStr: apex3x.size() != nCells");
71 if (nCells != apex3y.size())
72 B2ERROR(
"tessellatedSolidStr: apex3y.size() != nCells");
73 if (nCells != apex3z.size())
74 B2ERROR(
"tessellatedSolidStr: apex3z.size() != nCells");
75 for (
unsigned int i = 0; i < nCells; i++) {
76 std::vector<double> apex1;
77 std::vector<double> apex2;
78 std::vector<double> apex3;
79 apex1.push_back(apex1x.at(i));
80 apex1.push_back(apex1y.at(i));
81 apex1.push_back(apex1z.at(i));
82 apex2.push_back(apex2x.at(i));
83 apex2.push_back(apex2y.at(i));
84 apex2.push_back(apex2z.at(i));
85 apex3.push_back(apex3x.at(i));
86 apex3.push_back(apex3y.at(i));
87 apex3.push_back(apex3z.at(i));
88 posV1.push_back(apex1);
89 posV2.push_back(apex2);
90 posV3.push_back(apex3);
93 void printInfo(
int verboseLevel = 0)
95 std::cout <<
"tessellatedSolidID " << tessellatedSolidID << std::endl
96 <<
"nCells " << nCells << std::endl
97 <<
"nApexPerCell " << nApexPerCell << std::endl;
98 if (verboseLevel > 0) {
99 for (
unsigned int i = 0; i < posV1.size(); i++) {
100 std::cout << std::setw(20) <<
"apex1 : x y z " <<
" " << posV1[i][0] <<
" " << posV1[i][1] <<
" " << posV1[i][2] << std::endl
101 << std::setw(20) <<
"apex2 : x y z " <<
" " << posV2[i][0] <<
" " << posV2[i][1] <<
" " << posV2[i][2] << std::endl
102 << std::setw(20) <<
"apex3 : x y z " <<
" " << posV3[i][0] <<
" " << posV3[i][1] <<
" " << posV3[i][2] << std::endl;