1 #include "DD4hep/DetFactoryHelper.h"
9 using namespace angle_units::operators;
16 const auto& cellSize = args.
value<
double>(
"CellSize");
17 const auto& cellType = args.
value<
int>(
"CellType");
18 const auto& childNames = args.
value<std::vector<std::string> >(
"ChildNames");
19 const auto& positionX = args.
value<std::vector<int> >(
"PositionX");
20 const auto& positionY = args.
value<std::vector<int> >(
"PositionY");
21 const auto& angles = args.
value<std::vector<double> >(
"Angles");
22 const auto& detectorType = args.
value<std::vector<int> >(
"DetectorType");
24 edm::LogVerbatim(
"HGCalGeom") << childNames.size() <<
" children: " << childNames[0] <<
"; " << childNames[1]
25 <<
" positioned " << positionX.size() <<
" times with cell size " << cellSize;
26 for (
unsigned int k = 0;
k < positionX.size(); ++
k)
32 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalWaferAlgo debug: Parent " << idName <<
" NameSpace " << ns.
name();
36 double dx = 0.5 * cellSize;
37 double dy = 0.5 * dx *
tan(30._deg);
39 for (
unsigned int k = 0; k < positionX.size(); ++
k) {
46 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalWaferAlgo: Creating new rotation \t90, " << angles[
k] <<
", 90, "
47 << (angles[
k] + 90) <<
", 0, 0";
51 double xpos = dx * positionX[
k];
52 double ypos = dy * positionY[
k];
55 mother.placeVolume(ns.
volume(name),
copy, dd4hep::Transform3D(rotation, tran));
57 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalWaferAlgo: " << name <<
" number " << copy <<
" positioned in " << idName
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)
std::string prepend(const std::string &) const
static int32_t packCellType6(int type, int cell)
std::string parentName() const
Access value of rParent child node.