1 #include "DD4hep/DetFactoryHelper.h"
13 double waferSize =
args.value<
double>(
"WaferSize");
14 double waferT =
args.value<
double>(
"WaferThick");
15 double cellT =
args.value<
double>(
"CellThick");
17 int posSens =
args.value<
int>(
"PosSensitive");
21 std::vector<std::string> truncCN =
22 args.value<std::vector<std::string> >(
"TruncatedCell");
23 std::vector<std::string> truncSensN =
24 args.value<std::vector<std::string> >(
"TruncatedSensitive");
25 std::vector<std::string> extenCN =
args.value<std::vector<std::string> >(
"ExtendedCell");
26 std::vector<std::string> extenSensN =
27 args.value<std::vector<std::string> >(
"ExtendedSensitive");
28 std::vector<std::string> cornrCN =
args.value<std::vector<std::string> >(
"CornerCell");
29 std::vector<std::string> cornrSensN =
30 args.value<std::vector<std::string> >(
"CornerSensitive");
32 if ((truncCN.size() != truncSensN.size()) || (extenCN.size() != extenSensN.size()) ||
33 (cornrCN.size() != cornrSensN.size())) {
34 edm::LogError(
"HGCalGeom") <<
"The number of cells & sensitive differ:"
35 <<
" Truncated " << truncCN.size() <<
":" << truncSensN.size() <<
" Extended "
36 << extenCN.size() <<
":" << extenSensN.size() <<
" Corners " << cornrCN.size() <<
":"
38 throw cms::Exception(
"DDException") <<
"The number of cells & sensitive "
39 <<
"differ: Truncated " << truncCN.size() <<
":" << truncSensN.size()
40 <<
" Extended " << extenCN.size() <<
":" << extenSensN.size() <<
" Corners "
41 << cornrCN.size() <<
":" << cornrSensN.size();
43 if ((truncCN.size() != 3) || (extenCN.size() != 3) || (cornrCN.size() != 6)) {
44 edm::LogError(
"HGCalGeom") <<
"DDHGCalCell: The number of cells does not"
45 <<
" match with Standard: Truncated " << truncCN.size() <<
":3 Extended "
46 << extenCN.size() <<
":3"
47 <<
" Corners " << cornrCN.size() <<
":6";
48 throw cms::Exception(
"DDException") <<
"Wrong size of truncated|extended"
49 <<
"|corner cells: " << truncCN.size() <<
":" << extenCN.size() <<
":"
55 <<
nCells <<
" Material " << material <<
"Sensitive Position " << posSens
56 <<
" NameSpace " << ns.
name() <<
" Full Cell: " << fullCN <<
":" << fullSensN;
57 for (
int k = 0;
k < 3; ++
k)
58 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: Truncated Cell[" <<
k <<
"] " << truncCN[
k] <<
":" << truncSensN[
k];
59 for (
int k = 0;
k < 3; ++
k)
60 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: Extended Cell[" <<
k <<
"] " << extenCN[
k] <<
":" << extenSensN[
k];
61 for (
int k = 0;
k < 6; ++
k)
62 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: Corner Cell[" <<
k <<
"] " << cornrCN[
k] <<
":" << cornrSensN[
k];
67 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << material <<
" initialized";
71 static const double sqrt3 =
std::sqrt(3.0);
72 static const double waf2cell = 3.0;
73 static const double cornerfac = 2.5;
74 double R = waferSize / (waf2cell *
nCells);
75 double r = 0.5 *
R * sqrt3;
77 double dx2 = 0.5 * dx1;
78 double dx3 = cornerfac * dx2;
79 double dx4 = 0.5 * dx2;
81 double dy2 = 0.5 * dy1;
82 double dy3 = 1.5 * dy1;
83 std::vector<double>
xx = {dx1, dx2, -dx2, -dx1, -dx2, dx2, dx3, -dx4, -dx1, -dx1, -dx4, dx3};
84 std::vector<double>
yy = {0, dy1, dy1, 0, -dy1, -dy1, dy2, dy3, dy1, -dy1, -dy3, -dy2};
85 double zpos = (posSens == 0) ? -0.5 * (waferT - cellT) : 0.5 * (waferT - cellT);
89 std::vector<double> xw = {
xx[0],
xx[1],
xx[2],
xx[3],
xx[4],
xx[5]};
90 std::vector<double> yw = {
yy[0],
yy[1],
yy[2],
yy[3],
yy[4],
yy[5]};
91 std::vector<double>
zw = {-0.5 * waferT, 0.5 * waferT};
92 std::vector<double> zx(2, 0), zy(2, 0),
scale(2, 1.0);
98 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << solid.name() <<
" extruded polygon made of " << material
103 for (
unsigned int k = 0;
k < xw.size(); ++
k)
106 std::vector<double> zc = {-0.5 * cellT, 0.5 * cellT};
112 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << solid.name() <<
" extruded polygon made of " << material
117 for (
unsigned int k = 0;
k < xw.size(); ++
k)
121 glog1.placeVolume(glog2, 1, tran);
123 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << glog2.name() <<
" number 1 position in " << glog1.name()
127 static const int ir0[] = {0, 1, 0};
128 static const int ir1[] = {1, 2, 1};
129 static const int ir2[] = {2, 3, 3};
130 static const int ir3[] = {3, 4, 4};
131 static const int ir4[] = {5, 5, 5};
132 for (
int i = 0;
i < 3; ++
i) {
133 std::vector<double> xw = {
xx[ir0[
i]],
xx[ir1[
i]],
xx[ir2[
i]],
xx[ir3[
i]],
xx[ir4[
i]]};
134 std::vector<double> yw = {
yy[ir0[
i]],
yy[ir1[
i]],
yy[ir2[
i]],
yy[ir3[
i]],
yy[ir4[
i]]};
141 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << solid.name() <<
" extruded polygon made of " << material
146 for (
unsigned int k = 0;
k < xw.size(); ++
k)
155 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << solid.name() <<
" extruded polygon made of " << material
160 for (
unsigned int k = 0;
k < xw.size(); ++
k)
163 glog1.placeVolume(glog2, 1, tran);
165 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << glog2.name() <<
" number 1 position in " << glog1.name()
170 static const int ie0[] = {1, 5, 0};
171 static const int ie1[] = {2, 6, 1};
172 static const int ie2[] = {3, 7, 8};
173 static const int ie3[] = {10, 3, 9};
174 static const int ie4[] = {11, 4, 5};
175 for (
int i = 0;
i < 3; ++
i) {
176 std::vector<double> xw = {
xx[ie0[
i]],
xx[ie1[
i]],
xx[ie2[
i]],
xx[ie3[
i]],
xx[ie4[
i]]};
177 std::vector<double> yw = {
yy[ie0[
i]],
yy[ie1[
i]],
yy[ie2[
i]],
yy[ie3[
i]],
yy[ie4[
i]]};
183 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << solid.name() <<
" extruded polygon made of " << material
188 for (
unsigned int k = 0;
k < xw.size(); ++
k)
196 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << solid.name() <<
" extruded polygon made of " << material
201 for (
unsigned int k = 0;
k < xw.size(); ++
k)
204 glog1.placeVolume(glog2, 1, tran);
206 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << glog2.name() <<
" number 1 position in " << glog1.name()
211 static const int ic0[] = {0, 1, 1, 1, 1, 0};
212 static const int ic1[] = {1, 2, 2, 7, 3, 1};
213 static const int ic2[] = {8, 3, 3, 3, 4, 3};
214 static const int ic3[] = {3, 5, 10, 4, 5, 9};
215 static const int ic4[] = {5, 11, 5, 5, 6, 5};
216 for (
int i = 0;
i < 6; ++
i) {
217 std::vector<double> xw = {
xx[ic0[
i]],
xx[ic1[
i]],
xx[ic2[
i]],
xx[ic3[
i]],
xx[ic4[
i]]};
218 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 " << material
229 for (
unsigned int k = 0;
k < xw.size(); ++
k)
237 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << solid.name() <<
" extruded polygon made of " << material
242 for (
unsigned int k = 0;
k < xw.size(); ++
k)
245 glog1.placeVolume(glog2, 1, tran);
247 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalCell: " << glog2.name() <<
" number 1 position in " << glog1.name()