89 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << matName <<
" initialized";
93 static const double sqrt3 =
std::sqrt(3.0);
95 double r = 0.5 * R * sqrt3;
97 double dx2 = 0.5 * dx1;
98 double dx3 = 2.5 * dx2;
99 double dx4 = 0.5 * dx2;
101 double dy2 = 0.5 * dy1;
102 double dy3 = 1.5 * dy1;
103 std::vector<double> xx = {
104 dx1, dx2, -dx2, -dx1, -dx2, dx2, dx3, dx1, dx4, -dx4, -dx1, -dx3, -dx3, -dx1, -dx4, dx4, dx1, dx3};
105 std::vector<double> yy = {
106 0, dy1, dy1, 0, -dy1, -dy1, dy2, dy1, dy3, dy3, dy1, dy2, -dy2, -dy1, -dy3, -dy3, -dy1, -dy2};
111 std::vector<double> xw = {xx[0], xx[1], xx[2], xx[3], xx[4], xx[5]};
112 std::vector<double> yw = {yy[0], yy[1], yy[2], yy[3], yy[4], yy[5]};
114 std::vector<double> zx(2, 0), zy(2, 0),
scale(2, 1.0);
118 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << solid.
name() <<
" extruded polygon made of " << matName
119 <<
" z|x|y|s (0) " << zw[0] <<
":" << zx[0] <<
":" << zy[0] <<
":" <<
scale[0]
120 <<
" z|x|y|s (1) " << zw[1] <<
":" << zx[1] <<
":" << zy[1] <<
":" <<
scale[1]
121 <<
" and " << xw.size() <<
" edges";
122 for (
unsigned int k = 0;
k < xw.size(); ++
k)
129 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << solid.
name() <<
" extruded polygon made of " << matName
130 <<
" z|x|y|s (0) " << zc[0] <<
":" << zx[0] <<
":" << zy[0] <<
":" <<
scale[0]
131 <<
" z|x|y|s (1) " << zc[1] <<
":" << zx[1] <<
":" << zy[1] <<
":" <<
scale[1]
132 <<
" and " << xw.size() <<
" edges";
133 for (
unsigned int k = 0;
k < xw.size(); ++
k)
137 cpv.
position(glog2, glog1, 1, tran, rot);
139 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << glog2.
name() <<
" number 1 position in " << glog1.
name() <<
" at "
140 << tran <<
" with no rotation";
143 static constexpr
int ir0[] = {0, 1, 0, 1, 3, 5};
144 static constexpr
int ir1[] = {1, 2, 1, 2, 4, 0};
145 static constexpr
int ir2[] = {2, 3, 3, 3, 5, 1};
146 static constexpr
int ir3[] = {3, 4, 4, 4, 0, 2};
147 static constexpr
int ir4[] = {5, 5, 5, 0, 2, 4};
148 for (
unsigned int i = 0;
i <
truncCN_.size(); ++
i) {
149 std::vector<double> xw = {xx[ir0[
i]], xx[ir1[
i]], xx[ir2[
i]], xx[ir3[
i]], xx[ir4[
i]]};
150 std::vector<double> yw = {yy[ir0[
i]], yy[ir1[
i]], yy[ir2[
i]], yy[ir3[
i]], yy[ir4[
i]]};
154 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << solid.
name() <<
" extruded polygon made of " << matName
155 <<
" z|x|y|s (0) " << zw[0] <<
":" << zx[0] <<
":" << zy[0] <<
":" <<
scale[0]
156 <<
" z|x|y|s (1) " << zw[1] <<
":" << zx[1] <<
":" << zy[1] <<
":" <<
scale[1]
157 <<
" and " << xw.size() <<
" edges";
158 for (
unsigned int k = 0;
k < xw.size(); ++
k)
164 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << solid.
name() <<
" extruded polygon made of " << matName
165 <<
" z|x|y|s (0) " << zc[0] <<
":" << zx[0] <<
":" << zy[0] <<
":" <<
scale[0]
166 <<
" z|x|y|s (1) " << zc[1] <<
":" << zx[1] <<
":" << zy[1] <<
":" <<
scale[1]
167 <<
" and " << xw.size() <<
" edges";
168 for (
unsigned int k = 0;
k < xw.size(); ++
k)
171 cpv.
position(glog2, glog1, 1, tran, rot);
174 <<
" at " << tran <<
" with no rotation";
178 static constexpr
int ie0[] = {1, 5, 0, 0, 2, 4};
179 static constexpr
int ie1[] = {2, 6, 1, 1, 3, 5};
180 static constexpr
int ie2[] = {3, 9, 10, 2, 4, 0};
181 static constexpr
int ie3[] = {14, 3, 13, 12, 16, 8};
182 static constexpr
int ie4[] = {17, 4, 5, 15, 7, 11};
183 for (
unsigned int i = 0;
i <
extenCN_.size(); ++
i) {
184 std::vector<double> xw = {xx[ie0[
i]], xx[ie1[
i]], xx[ie2[
i]], xx[ie3[
i]], xx[ie4[
i]]};
185 std::vector<double> yw = {yy[ie0[
i]], yy[ie1[
i]], yy[ie2[
i]], yy[ie3[
i]], yy[ie4[
i]]};
189 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << solid.
name() <<
" extruded polygon made of " << matName
190 <<
" z|x|y|s (0) " << zw[0] <<
":" << zx[0] <<
":" << zy[0] <<
":" <<
scale[0]
191 <<
" z|x|y|s (1) " << zw[1] <<
":" << zx[1] <<
":" << zy[1] <<
":" <<
scale[1]
192 <<
" and " << xw.size() <<
" edges";
193 for (
unsigned int k = 0;
k < xw.size(); ++
k)
199 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << solid.
name() <<
" extruded polygon made of " << matName
200 <<
" z|x|y|s (0) " << zc[0] <<
":" << zx[0] <<
":" << zy[0] <<
":" <<
scale[0]
201 <<
" z|x|y|s (1) " << zc[1] <<
":" << zx[1] <<
":" << zy[1] <<
":" <<
scale[1]
202 <<
" and " << xw.size() <<
" edges";
203 for (
unsigned int k = 0;
k < xw.size(); ++
k)
206 cpv.
position(glog2, glog1, 1, tran, rot);
209 <<
" at " << tran <<
" with no rotation";
213 static constexpr
int ic0[] = {0, 1, 1, 1, 1, 0, 0, 1, 2, 3, 4, 5};
214 static constexpr
int ic1[] = {1, 2, 2, 9, 3, 1, 1, 2, 3, 4, 5, 0};
215 static constexpr
int ic2[] = {10, 3, 3, 3, 4, 3, 2, 12, 4, 16, 0, 8};
216 static constexpr
int ic3[] = {3, 5, 14, 4, 5, 13, 4, 4, 0, 0, 2, 2};
217 static constexpr
int ic4[] = {5, 17, 5, 5, 6, 5, 15, 0, 7, 2, 11, 4};
218 for (
unsigned int i = 0;
i <
cornrCN_.size(); ++
i) {
219 std::vector<double> xw = {xx[ic0[
i]], xx[ic1[
i]], xx[ic2[
i]], xx[ic3[
i]], xx[ic4[
i]]};
220 std::vector<double> yw = {yy[ic0[
i]], yy[ic1[
i]], yy[ic2[
i]], yy[ic3[
i]], yy[ic4[
i]]};
224 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << solid.
name() <<
" extruded polygon made of " << matName
225 <<
" z|x|y|s (0) " << zw[0] <<
":" << zx[0] <<
":" << zy[0] <<
":" <<
scale[0]
226 <<
" z|x|y|s (1) " << zw[1] <<
":" << zx[1] <<
":" << zy[1] <<
":" <<
scale[1]
227 <<
" and " << xw.size() <<
" edges";
228 for (
unsigned int k = 0;
k < xw.size(); ++
k)
234 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << solid.
name() <<
" extruded polygon made of " << matName
235 <<
" z|x|y|s (0) " << zc[0] <<
":" << zx[0] <<
":" << zy[0] <<
":" <<
scale[0]
236 <<
" z|x|y|s (1) " << zc[1] <<
":" << zx[1] <<
":" << zy[1] <<
":" <<
scale[1]
237 <<
" and " << xw.size() <<
" edges";
238 for (
unsigned int k = 0;
k < xw.size(); ++
k)
241 cpv.
position(glog2, glog1, 1, tran, rot);
244 <<
" at " << tran <<
" with no rotation";
Log< level::Info, true > LogVerbatim
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string ©no, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
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.
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)
std::vector< std::string > cornrCN_
std::vector< std::string > truncSensN_
auto zw(V v) -> Vec2< typename std::remove_reference< decltype(v[0])>::type >
std::vector< std::string > extenCN_
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
std::vector< std::string > cornrSensN_