1 #include "DD4hep/DetFactoryHelper.h" 13 dd4hep::SensitiveDetector& ) {
18 double waferSize = args.
value<
double>(
"WaferSize");
19 int cellType = args.
value<
int>(
"CellType");
21 int nBottomY = args.
value<
int>(
"NBottomY");
22 std::vector<std::string> childNames = args.
value<std::vector<std::string> >(
"ChildNames");
23 std::vector<int> nCellsRow = args.
value<std::vector<int> >(
"NCellsRow");
24 std::vector<int> angleEdges = args.
value<std::vector<int> >(
"AngleEdges");
25 std::vector<int> detectorType = args.
value<std::vector<int> >(
"DetectorType");
29 edm::LogVerbatim(
"HGCalGeom") << childNames.size() <<
" children: " << childNames[0] <<
"; " << childNames[1]
30 <<
" positioned in " << nCellsRow.size() <<
" rows and " << nColumns
31 <<
" columns with lowest column at " << nBottomY <<
" in mother " << parentName
32 <<
" of size " << waferSize;
33 for (
unsigned int k = 0;
k < nCellsRow.size(); ++
k)
34 edm::LogVerbatim(
"HGCalGeom") <<
"[" <<
k <<
"] Ncells " << nCellsRow[
k] <<
" Edge rotations " << angleEdges[2 *
k]
35 <<
":" << angleEdges[2 *
k + 1] <<
" Type of edge cells " << detectorType[2 *
k]
36 <<
":" << detectorType[2 *
k + 1];
39 static const int incAlongX = 2;
40 static const int incAlongY = 6;
42 double dy = 0.5 * dx *
tan(30._deg);
46 for (
unsigned int ir = 0; ir < nCellsRow.size(); ++ir) {
47 int nx = 1 - nCellsRow[ir];
48 double ypos = dy * ny;
49 for (
int ic = 0; ic < nCellsRow[ir]; ++ic) {
53 name = childNames[detectorType[2 * ir]];
54 irot = angleEdges[2 * ir];
55 }
else if (ic + 1 == nCellsRow[ir]) {
56 name = childNames[detectorType[2 * ir + 1]];
57 irot = angleEdges[2 * ir + 1];
64 <<
"\t90, " << irot <<
", 90, " << (irot + 90) <<
", 0, 0";
71 double xpos = dx * nx;
73 dd4hep::Position tran(xpos, ypos, 0);
74 int copy = cellType * 1000 + kount;
75 mother.placeVolume(ns.
volume(namx),
copy, dd4hep::Transform3D(rotation, tran));
78 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalWafer: " << name <<
" number " << copy <<
" positioned in " << parentName
79 <<
" at " << tran <<
" with " <<
rotation;
dd4hep::Volume volume(const std::string &name, bool exc=true) const
constexpr long double convertDegToRad(NumType degrees)
T value(const std::string &name) const
dd4hep::Rotation3D makeRotation3D(double thetaX, double phiX, double thetaY, double phiY, double thetaZ, double phiZ)
std::string_view name() const
Tan< T >::type tan(const T &t)
#define DECLARE_DDCMS_DETELEMENT(name, func)
std::string parentName() const
Access value of rParent child node.
static long algorithm(dd4hep::Detector &, cms::DDParsingContext &ctxt, xml_h e, dd4hep::SensitiveDetector &)