55 cellT_ = nArgs[
"CellThick"];
70 edm::LogWarning(
"HGCalGeom") <<
"The number of cells & sensitive differ:" 76 <<
" Cells/Wafer " <<
nCells_ <<
" Material " <<
material_ <<
"Sensitive Position " 93 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << matName <<
" initialized";
97 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 double dx6 = dx5 * 0.5;
118 double dy4 = dx5 * 0.5 * sqrt3;
119 double dy5 = dx5 * 2 / sqrt3;
120 double dy6 = dy5 * 0.5;
121 std::vector<double> txx = {dx5, dx6, -dx6, -dx5, -dx6, dx6, dx7, 0, -dx7, -dx7, 0, dx7};
122 std::vector<double> tyy = {0, dy4, dy4, 0, -dy4, -dy4, dy6, dy5, dy6, -dy6, -dy5, -dy6};
124 std::vector<double> xw = {
xx[0],
xx[1],
xx[2],
xx[3],
xx[4],
xx[5]};
125 std::vector<double> yw = {
yy[0],
yy[1],
yy[2],
yy[3],
yy[4],
yy[5]};
127 std::vector<double> zx(2, 0), zy(2, 0),
scale(2, 1.0);
131 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << solid.
name() <<
" extruded polygon made of " << matName
132 <<
" z|x|y|s (0) " <<
zw[0] <<
":" << zx[0] <<
":" << zy[0] <<
":" <<
scale[0]
133 <<
" z|x|y|s (1) " <<
zw[1] <<
":" << zx[1] <<
":" << zy[1] <<
":" <<
scale[1]
134 <<
" and " << xw.size() <<
" edges";
135 for (
unsigned int k = 0;
k < xw.size(); ++
k)
142 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << solid.
name() <<
" extruded polygon made of " << matName
143 <<
" z|x|y|s (0) " << zc[0] <<
":" << zx[0] <<
":" << zy[0] <<
":" <<
scale[0]
144 <<
" z|x|y|s (1) " << zc[1] <<
":" << zx[1] <<
":" << zy[1] <<
":" <<
scale[1]
145 <<
" and " << xw.size() <<
" edges";
146 for (
unsigned int k = 0;
k < xw.size(); ++
k)
152 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << glog2.
name() <<
" number 1 position in " << glog1.
name() <<
" at " 153 << tran <<
" with no rotation";
156 static constexpr int ir0[] = {0, 2, 4, 1, 3, 5};
157 static constexpr int ir1[] = {1, 3, 5, 2, 4, 0};
158 static constexpr int ir2[] = {2, 4, 0, 3, 5, 1};
159 static constexpr int ir3[] = {3, 5, 1, 4, 0, 2};
160 static constexpr int ir4[] = {5, 1, 3, 0, 2, 4};
162 static constexpr int tr[] = {1, 3, 5, 2, 4, 0};
163 for (
unsigned int i = 0;
i <
truncCN_.size(); ++
i) {
164 std::vector<double> xw = {
xx[ir0[
i]],
xx[ir1[
i]],
xx[ir2[
i]],
xx[ir3[
i]] + txx[tr[
i]],
xx[ir4[
i]] + txx[tr[
i]]};
165 std::vector<double> yw = {
yy[ir0[
i]],
yy[ir1[
i]],
yy[ir2[
i]],
yy[ir3[
i]] + tyy[tr[
i]],
yy[ir4[
i]] + tyy[tr[
i]]};
169 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << solid.
name() <<
" extruded polygon made of " << matName
170 <<
" z|x|y|s (0) " <<
zw[0] <<
":" << zx[0] <<
":" << zy[0] <<
":" <<
scale[0]
171 <<
" z|x|y|s (1) " <<
zw[1] <<
":" << zx[1] <<
":" << zy[1] <<
":" <<
scale[1]
172 <<
" and " << xw.size() <<
" edges";
173 for (
unsigned int k = 0;
k < xw.size(); ++
k)
179 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << solid.
name() <<
" extruded polygon made of " << matName
180 <<
" z|x|y|s (0) " << zc[0] <<
":" << zx[0] <<
":" << zy[0] <<
":" <<
scale[0]
181 <<
" z|x|y|s (1) " << zc[1] <<
":" << zx[1] <<
":" << zy[1] <<
":" <<
scale[1]
182 <<
" and " << xw.size() <<
" edges";
183 for (
unsigned int k = 0;
k < xw.size(); ++
k)
189 <<
" at " << tran <<
" with no rotation";
193 static constexpr int ie0[] = {1, 3, 5, 0, 2, 4};
194 static constexpr int ie1[] = {2, 4, 0, 1, 3, 5};
195 static constexpr int ie2[] = {3, 5, 1, 2, 4, 0};
196 static constexpr int ie3[] = {14, 6, 10, 12, 16, 8};
197 static constexpr int ie4[] = {17, 9, 13, 15, 7, 11};
199 static constexpr int te[] = {2, 4, 0, 1, 3, 5};
200 for (
unsigned int i = 0;
i <
extenCN_.size(); ++
i) {
201 std::vector<double> xw = {
xx[ie0[
i]],
xx[ie1[
i]],
xx[ie2[
i]],
xx[ie3[
i]] + txx[te[
i]],
xx[ie4[
i]] + txx[te[
i]]};
202 std::vector<double> yw = {
yy[ie0[
i]],
yy[ie1[
i]],
yy[ie2[
i]],
yy[ie3[
i]] + tyy[te[
i]],
yy[ie4[
i]] + tyy[te[
i]]};
206 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << solid.
name() <<
" extruded polygon made of " << matName
207 <<
" z|x|y|s (0) " <<
zw[0] <<
":" << zx[0] <<
":" << zy[0] <<
":" <<
scale[0]
208 <<
" z|x|y|s (1) " <<
zw[1] <<
":" << zx[1] <<
":" << zy[1] <<
":" <<
scale[1]
209 <<
" and " << xw.size() <<
" edges";
210 for (
unsigned int k = 0;
k < xw.size(); ++
k)
216 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << solid.
name() <<
" extruded polygon made of " << matName
217 <<
" z|x|y|s (0) " << zc[0] <<
":" << zx[0] <<
":" << zy[0] <<
":" <<
scale[0]
218 <<
" z|x|y|s (1) " << zc[1] <<
":" << zx[1] <<
":" << zy[1] <<
":" <<
scale[1]
219 <<
" and " << xw.size() <<
" edges";
220 for (
unsigned int k = 0;
k < xw.size(); ++
k)
226 <<
" at " << tran <<
" with no rotation";
230 static constexpr int ic0[] = {0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5};
231 static constexpr int ic1[] = {1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0};
232 static constexpr int ic2[] = {10, 3, 14, 5, 6, 1, 2, 12, 4, 16, 0, 8};
233 static constexpr int ic3[] = {3, 5, 5, 1, 1, 3, 4, 4, 0, 0, 2, 2};
234 static constexpr int ic4[] = {5, 17, 1, 9, 3, 13, 15, 0, 7, 2, 11, 4};
236 static constexpr int tc[] = {0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5};
237 for (
unsigned int i = 0;
i <
cornrCN_.size(); ++
i) {
238 std::vector<double> xw = {
239 xx[ic0[
i]],
xx[ic1[
i]],
xx[ic2[
i]] + txx[tc[
i]],
xx[ic3[
i]] + txx[tc[
i] + 6],
xx[ic4[
i]] + txx[(tc[
i] + 1) % 6]};
240 std::vector<double> yw = {
241 yy[ic0[
i]],
yy[ic1[
i]],
yy[ic2[
i]] + tyy[tc[
i]],
yy[ic3[
i]] + tyy[tc[
i] + 6],
yy[ic4[
i]] + tyy[(tc[
i] + 1) % 6]};
245 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << solid.
name() <<
" extruded polygon made of " << matName
246 <<
" z|x|y|s (0) " <<
zw[0] <<
":" << zx[0] <<
":" << zy[0] <<
":" <<
scale[0]
247 <<
" z|x|y|s (1) " <<
zw[1] <<
":" << zx[1] <<
":" << zy[1] <<
":" <<
scale[1]
248 <<
" and " << xw.size() <<
" edges";
249 for (
unsigned int k = 0;
k < xw.size(); ++
k)
255 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << solid.
name() <<
" extruded polygon made of " << matName
256 <<
" z|x|y|s (0) " << zc[0] <<
":" << zx[0] <<
":" << zy[0] <<
":" <<
scale[0]
257 <<
" z|x|y|s (1) " << zc[1] <<
":" << zx[1] <<
":" << zy[1] <<
":" <<
scale[1]
258 <<
" and " << xw.size() <<
" edges";
259 for (
unsigned int k = 0;
k < xw.size(); ++
k)
265 <<
" 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.
void initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
DDName is used to identify DDD entities uniquely.
static std::string & ns()
std::vector< std::string > truncCN_
Compact representation of the geometrical detector hierarchy.
std::vector< std::string > extenSensN_
A DDSolid represents the shape of a part.
void execute(DDCompactView &cpv) override
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 >
#define DEFINE_EDM_PLUGIN(factory, type, name)
Log< level::Warning, false > LogWarning
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_