1 #include "DD4hep/DetFactoryHelper.h"
9 using namespace angle_units::operators;
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
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];
61 <<
"\t90, " << irot <<
", 90, " << (irot + 90) <<
", 0, 0";
68 double xpos = dx * nx;
72 mother.placeVolume(ns.
volume(namx),
copy, dd4hep::Transform3D(rotation, tran));
75 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalWafer: " << name <<
" number " << copy <<
" positioned in " << parentName
Log< level::Info, true > LogVerbatim
dd4hep::Volume volume(const std::string &name, bool exc=true) const
constexpr double convertDegToRad(NumType degrees)
constexpr NumType convert2mm(NumType length)
T value(const std::string &name) const
DDRotationMatrix makeRotation3D(double thetaX, double phiX, double thetaY, double phiY, double thetaZ, double phiZ)
std::string_view name() const
#define DECLARE_DDCMS_DETELEMENT(name, func)
static constexpr long s_executed
Tan< T >::type tan(const T &t)
static int32_t packCellType6(int type, int cell)
std::string parentName() const
Access value of rParent child node.