81 <<
"DDHGCalCell: " << matName <<
" initialized at " << &matter;
85 static const double sqrt3 =
std::sqrt(3.0);
87 double r = 0.5 * R * sqrt3;
89 double dx2 = 0.5 * dx1;
90 double dx3 = 2.5 * dx2;
91 double dx4 = 0.5 * dx2;
93 double dy2 = 0.5 * dy1;
94 double dy3 = 1.5 * dy1;
95 std::vector<double>
xx = {dx1, dx2, -dx2, -dx1, -dx2, dx2,
96 dx3, -dx4, -dx1, -dx1, -dx4, dx3};
97 std::vector<double>
yy = {0, dy1, dy1, 0, -dy1, -dy1,
98 dy2, dy3, dy1, -dy1, -dy3, -dy2};
104 std::vector<double> xw = {xx[0], xx[1], xx[2], xx[3], xx[4], xx[5]};
105 std::vector<double> yw = {yy[0], yy[1], yy[2], yy[3], yy[4], yy[5]};
107 std::vector<double> zx(2, 0), zy(2, 0),
scale(2, 1.0);
109 xw, yw, zw, zx, zy,
scale);
113 <<
"DDHGCalCell: " << solid.
name() <<
" extruded polygon made of " 114 << matName <<
" z|x|y|s (0) " << zw[0] <<
":" << zx[0] <<
":" << zy[0]
115 <<
":" <<
scale[0] <<
" z|x|y|s (1) " << zw[1] <<
":" << zx[1] <<
":" 116 << zy[1] <<
":" <<
scale[1] <<
" and " << xw.size() <<
" edges";
117 for (
unsigned int k = 0;
k < xw.size(); ++
k)
122 yw, zc, zx, zy,
scale);
126 <<
"DDHGCalCell: " << solid.
name() <<
" extruded polygon made of " 127 << matName <<
" z|x|y|s (0) " << zc[0] <<
":" << zx[0] <<
":" << zy[0]
128 <<
":" <<
scale[0] <<
" z|x|y|s (1) " << zc[1] <<
":" << zx[1] <<
":" 129 << zy[1] <<
":" <<
scale[1] <<
" and " << xw.size() <<
" edges";
130 for (
unsigned int k = 0;
k < xw.size(); ++
k)
134 cpv.
position(glog2, glog1, 1, tran, rot);
137 <<
"DDHGCalCell: " << glog2.
name() <<
" number 1 position in " 138 << glog1.
name() <<
" at " << tran <<
" with " <<
rot;
141 static const int ir0[] = {0, 1, 0};
142 static const int ir1[] = {1, 2, 1};
143 static const int ir2[] = {2, 3, 3};
144 static const int ir3[] = {3, 4, 4};
145 static const int ir4[] = {5, 5, 5};
146 for (
unsigned int i = 0;
i <
truncCN_.size(); ++
i) {
147 std::vector<double> xw = {xx[ir0[
i]], xx[ir1[
i]], xx[ir2[
i]], xx[ir3[
i]],
149 std::vector<double> yw = {yy[ir0[
i]], yy[ir1[
i]], yy[ir2[
i]], yy[ir3[
i]],
152 yw, zw, zx, zy,
scale);
156 <<
"DDHGCalCell: " << solid.
name() <<
" extruded polygon made of " 157 << matName <<
" z|x|y|s (0) " << zw[0] <<
":" << zx[0] <<
":" << zy[0]
158 <<
":" <<
scale[0] <<
" z|x|y|s (1) " << zw[1] <<
":" << zx[1] <<
":" 159 << zy[1] <<
":" <<
scale[1] <<
" and " << xw.size() <<
" edges";
160 for (
unsigned int k = 0;
k < xw.size(); ++
k)
162 <<
"[" <<
k <<
"] " << xw[
k] <<
":" << yw[
k];
165 xw, yw, zc, zx, zy,
scale);
169 <<
"DDHGCalCell: " << solid.
name() <<
" extruded polygon made of " 170 << matName <<
" z|x|y|s (0) " << zw[0] <<
":" << zx[0] <<
":" << zy[0]
171 <<
":" <<
scale[0] <<
" z|x|y|s (1) " << zw[1] <<
":" << zx[1] <<
":" 172 << zy[1] <<
":" <<
scale[1] <<
" and " << xw.size() <<
" edges";
173 for (
unsigned int k = 0;
k < xw.size(); ++
k)
175 <<
"[" <<
k <<
"] " << xw[
k] <<
":" << yw[
k];
177 cpv.
position(glog2, glog1, 1, tran, rot);
180 <<
"DDHGCalCell: " << glog2.
name() <<
" number 1 position in " 181 << glog1.
name() <<
" at " << tran <<
" with " <<
rot;
185 static const int ie0[] = {1, 5, 0};
186 static const int ie1[] = {2, 6, 1};
187 static const int ie2[] = {3, 7, 8};
188 static const int ie3[] = {10, 3, 9};
189 static const int ie4[] = {11, 4, 5};
190 for (
unsigned int i = 0;
i <
extenCN_.size(); ++
i) {
191 std::vector<double> xw = {xx[ie0[
i]], xx[ie1[
i]], xx[ie2[
i]], xx[ie3[
i]],
193 std::vector<double> yw = {yy[ie0[
i]], yy[ie1[
i]], yy[ie2[
i]], yy[ie3[
i]],
196 yw, zw, zx, zy,
scale);
200 <<
"DDHGCalCell: " << solid.
name() <<
" extruded polygon made of " 201 << matName <<
" z|x|y|s (0) " << zw[0] <<
":" << zx[0] <<
":" << zy[0]
202 <<
":" <<
scale[0] <<
" z|x|y|s (1) " << zw[1] <<
":" << zx[1] <<
":" 203 << zy[1] <<
":" <<
scale[1] <<
" and " << xw.size() <<
" edges";
204 for (
unsigned int k = 0;
k < xw.size(); ++
k)
206 <<
"[" <<
k <<
"] " << xw[
k] <<
":" << yw[
k];
209 xw, yw, zc, zx, zy,
scale);
213 <<
"DDHGCalCell: " << solid.
name() <<
" extruded polygon made of " 214 << matName <<
" z|x|y|s (0) " << zw[0] <<
":" << zx[0] <<
":" << zy[0]
215 <<
":" <<
scale[0] <<
" z|x|y|s (1) " << zw[1] <<
":" << zx[1] <<
":" 216 << zy[1] <<
":" <<
scale[1] <<
" and " << xw.size() <<
" edges";
217 for (
unsigned int k = 0;
k < xw.size(); ++
k)
219 <<
"[" <<
k <<
"] " << xw[
k] <<
":" << yw[
k];
221 cpv.
position(glog2, glog1, 1, tran, rot);
224 <<
"DDHGCalCell: " << glog2.
name() <<
" number 1 position in " 225 << glog1.
name() <<
" at " << tran <<
" with " <<
rot;
229 static const int ic0[] = {0, 1, 1, 1, 1, 0};
230 static const int ic1[] = {1, 2, 2, 7, 3, 1};
231 static const int ic2[] = {8, 3, 3, 3, 4, 3};
232 static const int ic3[] = {3, 5, 10, 4, 5, 9};
233 static const int ic4[] = {5, 11, 5, 5, 6, 5};
234 for (
unsigned int i = 0;
i <
cornrCN_.size(); ++
i) {
235 std::vector<double> xw = {xx[ic0[
i]], xx[ic1[
i]], xx[ic2[
i]], xx[ic3[
i]],
237 std::vector<double> yw = {yy[ic0[
i]], yy[ic1[
i]], yy[ic2[
i]], yy[ic3[
i]],
240 yw, zw, zx, zy,
scale);
244 <<
"DDHGCalCell: " << solid.
name() <<
" extruded polygon made of " 245 << matName <<
" z|x|y|s (0) " << zw[0] <<
":" << zx[0] <<
":" << zy[0]
246 <<
":" <<
scale[0] <<
" z|x|y|s (1) " << zw[1] <<
":" << zx[1] <<
":" 247 << zy[1] <<
":" <<
scale[1] <<
" and " << xw.size() <<
" edges";
248 for (
unsigned int k = 0;
k < xw.size(); ++
k)
250 <<
"[" <<
k <<
"] " << xw[
k] <<
":" << yw[
k];
253 xw, yw, zc, zx, zy,
scale);
257 <<
"DDHGCalCell: " << solid.
name() <<
" extruded polygon made of " 258 << matName <<
" z|x|y|s (0) " << zw[0] <<
":" << zx[0] <<
":" << zy[0]
259 <<
":" <<
scale[0] <<
" z|x|y|s (1) " << zw[1] <<
":" << zx[1] <<
":" 260 << zy[1] <<
":" <<
scale[1] <<
" and " << xw.size() <<
" edges";
261 for (
unsigned int k = 0;
k < xw.size(); ++
k)
263 <<
"[" <<
k <<
"] " << xw[
k] <<
":" << yw[
k];
265 cpv.
position(glog2, glog1, 1, tran, rot);
268 <<
"DDHGCalCell: " << glog2.
name() <<
" number 1 position in " 269 << glog1.
name() <<
" at " << tran <<
" with " <<
rot;
DDMaterial is used to define and access material information.
DDName is used to identify DDD entities uniquely.
std::vector< std::string > truncCN_
std::vector< std::string > extenSensN_
A DDSolid represents the shape of a part.
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Represents a uniquely identifyable rotation matrix.
U second(std::pair< T, U > const &p)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
static DDSolid extrudedpolygon(const DDName &name, const std::vector< double > &x, const std::vector< double > &y, const std::vector< double > &z, const std::vector< double > &zx, const std::vector< double > &zy, const std::vector< double > &zscale)
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string ©no, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
std::vector< std::string > cornrCN_
std::vector< std::string > truncSensN_
auto zw(V v) -> Vec2< typename std::remove_reference< decltype(v[0])>::type >
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
std::vector< std::string > extenCN_
std::vector< std::string > cornrSensN_