1 #include "DD4hep/DetFactoryHelper.h" 12 dd4hep::SensitiveDetector& ) {
17 const auto& cellSize = args.
value<
double>(
"CellSize");
18 const auto& cellType = args.
value<
int>(
"CellType");
19 const auto& childNames = args.
value<std::vector<std::string> >(
"ChildNames");
20 const auto& positionX = args.
value<std::vector<int> >(
"PositionX");
21 const auto& positionY = args.
value<std::vector<int> >(
"PositionY");
22 const auto&
angles = args.
value<std::vector<double> >(
"Angles");
23 const auto& detectorType = args.
value<std::vector<int> >(
"DetectorType");
25 edm::LogVerbatim(
"HGCalGeom") << childNames.size() <<
" children: " << childNames[0] <<
"; " << childNames[1]
26 <<
" positioned " << positionX.size() <<
" times with cell size " << cellSize;
27 for (
unsigned int k = 0;
k < positionX.size(); ++
k)
28 edm::LogVerbatim(
"HGCalGeom") <<
"[" <<
k <<
"] x " << positionX[
k] <<
" y " << positionY[
k] <<
" angle " 29 << angles[
k] <<
" detector " << detectorType[
k];
33 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalWaferAlgo debug: Parent " << idName <<
" NameSpace " << idNameSpace;
37 double dx = 0.5 * cellSize;
38 double dy = 0.5 * dx *
tan(30._deg);
40 for (
unsigned int k = 0;
k < positionX.size(); ++
k) {
48 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalWaferAlgo: Creating new rotation \t90, " << angles[
k] <<
", 90, " 49 << (angles[
k] + 90) <<
", 0, 0";
53 double xpos = dx * positionX[
k];
54 double ypos = dy * positionY[
k];
55 dd4hep::Position tran(xpos, ypos, 0);
56 int copy = cellType * 1000 +
k;
57 mother.placeVolume(ns.
volume(name),
copy, dd4hep::Transform3D(rotation, tran));
59 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalWaferAlgo: " << name <<
" number " << copy <<
" positioned in " << idName
60 <<
" 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
static long algorithm(dd4hep::Detector &, cms::DDParsingContext &ctxt, xml_h e, dd4hep::SensitiveDetector &)
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.