94 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << matName <<
" initialized";
98 static const double sqrt3 =
std::sqrt(3.0);
100 double r = 0.5 * R * sqrt3;
102 double dx2 = 0.5 * dx1;
103 double dx3 = 2.5 * dx2;
104 double dx4 = 0.5 * dx2;
106 double dy2 = 0.5 * dy1;
107 double dy3 = 1.5 * dy1;
108 std::vector<double> xx = {
109 dx1, dx2, -dx2, -dx1, -dx2, dx2, dx3, dx1, dx4, -dx4, -dx1, -dx3, -dx3, -dx1, -dx4, dx4, dx1, dx3};
110 std::vector<double> yy = {
111 0, dy1, dy1, 0, -dy1, -dy1, dy2, dy1, dy3, dy3, dy1, dy2, -dy2, -dy1, -dy3, -dy3, -dy1, -dy2};
116 std::vector<double> xw = {xx[0], xx[1], xx[2], xx[3], xx[4], xx[5]};
117 std::vector<double> yw = {yy[0], yy[1], yy[2], yy[3], yy[4], yy[5]};
119 std::vector<double> zx(2, 0), zy(2, 0),
scale(2, 1.0);
123 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << solid.
name() <<
" extruded polygon made of " << matName
124 <<
" z|x|y|s (0) " << zw[0] <<
":" << zx[0] <<
":" << zy[0] <<
":" <<
scale[0]
125 <<
" z|x|y|s (1) " << zw[1] <<
":" << zx[1] <<
":" << zy[1] <<
":" <<
scale[1]
126 <<
" and " << xw.size() <<
" edges";
127 for (
unsigned int k = 0;
k < xw.size(); ++
k)
134 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << solid.
name() <<
" extruded polygon made of " << matName
135 <<
" z|x|y|s (0) " << zc[0] <<
":" << zx[0] <<
":" << zy[0] <<
":" <<
scale[0]
136 <<
" z|x|y|s (1) " << zc[1] <<
":" << zx[1] <<
":" << zy[1] <<
":" <<
scale[1]
137 <<
" and " << xw.size() <<
" edges";
138 for (
unsigned int k = 0;
k < xw.size(); ++
k)
142 cpv.
position(glog2, glog1, 1, tran, rot);
144 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << glog2.
name() <<
" number 1 position in " << glog1.
name() <<
" at "
145 << tran <<
" with no rotation";
148 static constexpr
int ir0[] = {0, 1, 0, 1, 3, 5};
149 static constexpr
int ir1[] = {1, 2, 1, 2, 4, 0};
150 static constexpr
int ir2[] = {2, 3, 3, 3, 5, 1};
151 static constexpr
int ir3[] = {3, 4, 4, 4, 0, 2};
152 static constexpr
int ir4[] = {5, 5, 5, 0, 2, 4};
153 for (
unsigned int i = 0;
i <
truncCN_.size(); ++
i) {
154 std::vector<double> xw = {xx[ir0[
i]], xx[ir1[
i]], xx[ir2[
i]], xx[ir3[
i]], xx[ir4[
i]]};
155 std::vector<double> yw = {yy[ir0[
i]], yy[ir1[
i]], yy[ir2[
i]], yy[ir3[
i]], yy[ir4[
i]]};
159 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << solid.
name() <<
" extruded polygon made of " << matName
160 <<
" z|x|y|s (0) " << zw[0] <<
":" << zx[0] <<
":" << zy[0] <<
":" <<
scale[0]
161 <<
" z|x|y|s (1) " << zw[1] <<
":" << zx[1] <<
":" << zy[1] <<
":" <<
scale[1]
162 <<
" and " << xw.size() <<
" edges";
163 for (
unsigned int k = 0;
k < xw.size(); ++
k)
169 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << solid.
name() <<
" extruded polygon made of " << matName
170 <<
" z|x|y|s (0) " << zc[0] <<
":" << zx[0] <<
":" << zy[0] <<
":" <<
scale[0]
171 <<
" z|x|y|s (1) " << zc[1] <<
":" << zx[1] <<
":" << zy[1] <<
":" <<
scale[1]
172 <<
" and " << xw.size() <<
" edges";
173 for (
unsigned int k = 0;
k < xw.size(); ++
k)
176 cpv.
position(glog2, glog1, 1, tran, rot);
179 <<
" at " << tran <<
" with no rotation";
183 static constexpr
int ie0[] = {1, 5, 0, 2, 4, 0};
184 static constexpr
int ie1[] = {2, 6, 1, 3, 5, 1};
185 static constexpr
int ie2[] = {3, 9, 10, 4, 0, 2};
186 static constexpr
int ie3[] = {14, 3, 13, 16, 8, 12};
187 static constexpr
int ie4[] = {17, 4, 5, 7, 11, 15};
188 for (
unsigned int i = 0;
i <
extenCN_.size(); ++
i) {
189 std::vector<double> xw = {xx[ie0[
i]], xx[ie1[
i]], xx[ie2[
i]], xx[ie3[
i]], xx[ie4[
i]]};
190 std::vector<double> yw = {yy[ie0[
i]], yy[ie1[
i]], yy[ie2[
i]], yy[ie3[
i]], yy[ie4[
i]]};
194 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << solid.
name() <<
" extruded polygon made of " << matName
195 <<
" z|x|y|s (0) " << zw[0] <<
":" << zx[0] <<
":" << zy[0] <<
":" <<
scale[0]
196 <<
" z|x|y|s (1) " << zw[1] <<
":" << zx[1] <<
":" << zy[1] <<
":" <<
scale[1]
197 <<
" and " << xw.size() <<
" edges";
198 for (
unsigned int k = 0;
k < xw.size(); ++
k)
204 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << solid.
name() <<
" extruded polygon made of " << matName
205 <<
" z|x|y|s (0) " << zc[0] <<
":" << zx[0] <<
":" << zy[0] <<
":" <<
scale[0]
206 <<
" z|x|y|s (1) " << zc[1] <<
":" << zx[1] <<
":" << zy[1] <<
":" <<
scale[1]
207 <<
" and " << xw.size() <<
" edges";
208 for (
unsigned int k = 0;
k < xw.size(); ++
k)
211 cpv.
position(glog2, glog1, 1, tran, rot);
214 <<
" at " << tran <<
" with no rotation";
218 static constexpr
int ic0[] = {0, 1, 1, 1, 1, 0, 1, 2, 3, 4, 5, 0};
219 static constexpr
int ic1[] = {1, 2, 2, 9, 3, 1, 2, 3, 4, 5, 0, 1};
220 static constexpr
int ic2[] = {10, 3, 3, 3, 4, 3, 12, 5, 16, 0, 8, 2};
221 static constexpr
int ic3[] = {3, 5, 14, 4, 5, 13, 4, 0, 0, 2, 2, 4};
222 static constexpr
int ic4[] = {5, 17, 5, 5, 6, 5, 0, 7, 2, 11, 4, 15};
223 for (
unsigned int i = 0;
i <
cornrCN_.size(); ++
i) {
224 std::vector<double> xw = {xx[ic0[
i]], xx[ic1[
i]], xx[ic2[
i]], xx[ic3[
i]], xx[ic4[
i]]};
225 std::vector<double> yw = {yy[ic0[
i]], yy[ic1[
i]], yy[ic2[
i]], yy[ic3[
i]], yy[ic4[
i]]};
229 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << solid.
name() <<
" extruded polygon made of " << matName
230 <<
" z|x|y|s (0) " << zw[0] <<
":" << zx[0] <<
":" << zy[0] <<
":" <<
scale[0]
231 <<
" z|x|y|s (1) " << zw[1] <<
":" << zx[1] <<
":" << zy[1] <<
":" <<
scale[1]
232 <<
" and " << xw.size() <<
" edges";
233 for (
unsigned int k = 0;
k < xw.size(); ++
k)
239 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << solid.
name() <<
" extruded polygon made of " << matName
240 <<
" z|x|y|s (0) " << zc[0] <<
":" << zx[0] <<
":" << zy[0] <<
":" <<
scale[0]
241 <<
" z|x|y|s (1) " << zc[1] <<
":" << zx[1] <<
":" << zy[1] <<
":" <<
scale[1]
242 <<
" and " << xw.size() <<
" edges";
243 for (
unsigned int k = 0;
k < xw.size(); ++
k)
246 cpv.
position(glog2, glog1, 1, tran, rot);
249 <<
" 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_