1 #include "DD4hep/DetFactoryHelper.h"
16 double waferSize =
args.value<
double>(
"WaferSize");
17 int cellType =
args.value<
int>(
"CellType");
18 int nColumns =
args.value<
int>(
"NColumns");
19 int nBottomY =
args.value<
int>(
"NBottomY");
20 std::vector<std::string> childNames =
args.value<std::vector<std::string> >(
"ChildNames");
21 std::vector<int> nCellsRow =
args.value<std::vector<int> >(
"NCellsRow");
22 std::vector<int> angleEdges =
args.value<std::vector<int> >(
"AngleEdges");
23 std::vector<int> detectorType =
args.value<std::vector<int> >(
"DetectorType");
27 edm::LogVerbatim(
"HGCalGeom") << childNames.size() <<
" children: " << childNames[0] <<
"; " << childNames[1]
28 <<
" positioned in " << nCellsRow.size() <<
" rows and " << nColumns
29 <<
" columns with lowest column at " << nBottomY <<
" in mother " << parentName
30 <<
" of size " << waferSize;
31 for (
unsigned int k = 0;
k < nCellsRow.size(); ++
k)
32 edm::LogVerbatim(
"HGCalGeom") <<
"[" <<
k <<
"] Ncells " << nCellsRow[
k] <<
" Edge rotations " << angleEdges[2 *
k]
33 <<
":" << angleEdges[2 *
k + 1] <<
" Type of edge cells " << detectorType[2 *
k]
34 <<
":" << detectorType[2 *
k + 1];
37 static const int incAlongX = 2;
38 static const int incAlongY = 6;
39 double dx = 0.5 * waferSize / nColumns;
40 double dy = 0.5 *
dx *
tan(30._deg);
44 for (
unsigned int ir = 0; ir < nCellsRow.size(); ++ir) {
45 int nx = 1 - nCellsRow[ir];
46 double ypos =
dy * ny;
47 for (
int ic = 0; ic < nCellsRow[ir]; ++ic) {
51 name = childNames[detectorType[2 * ir]];
52 irot = angleEdges[2 * ir];
53 }
else if (ic + 1 == nCellsRow[ir]) {
54 name = childNames[detectorType[2 * ir + 1]];
55 irot = angleEdges[2 * ir + 1];
62 <<
"\t90, " << irot <<
", 90, " << (irot + 90) <<
", 0, 0";
69 double xpos =
dx * nx;
77 <<
" at " << tran <<
" with " <<
rotation;