1 #include "DD4hep/DetFactoryHelper.h"
8 using namespace angle_units::operators;
17 double dx = args.
value<
double>(
"Dx");
18 double dz = args.
value<
double>(
"Dz");
19 double angwidth = args.
value<
double>(
"AngWidth");
20 int iaxis = args.
value<
int>(
"Axis");
21 std::vector<std::string>
names = args.
value<std::vector<std::string> >(
"Names");
24 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalXtalAlgo::Parameters for positioning: Axis " << iaxis <<
"\tRadius "
27 <<
"\tNumbers " << names.size();
28 for (
unsigned int i = 0;
i < names.size();
i++)
31 <<
" NameSpace " << idNameSpace;
36 double theta[3], phi[3], pos[3];
39 theta[1 - iaxis] = 90._deg;
41 int number = (int)(names.size());
44 theta[iaxis] = 90._deg +
angle;
47 phi[2] = iaxis * 90._deg;
50 phi[2] = (2 - 3 * iaxis) * 90._deg;
52 pos[iaxis] = angle * (dz +
radius);
56 idName = idNameSpace +
idName;
61 static const double tol = 0.01_deg;
71 parent.placeVolume(glog,
i + 1, dd4hep::Transform3D(rotation, tran));
73 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalXtalAlgo: " << glog.name() <<
" number " <<
i + 1 <<
" positioned in "
Log< level::Info, true > LogVerbatim
dd4hep::Volume volume(const std::string &name, bool exc=true) const
constexpr NumType convertRadToDeg(NumType radians)
constexpr NumType convert2mm(NumType length)
Sin< T >::type sin(const T &t)
T value(const std::string &name) const
Geom::Theta< T > theta() const
const std::string names[nVars_]
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
Abs< T >::type abs(const T &t)
std::string parentName() const
Access value of rParent child node.
T angle(T x1, T y1, T z1, T x2, T y2, T z2)