1 #include "DD4hep/DetFactoryHelper.h" 12 dd4hep::SensitiveDetector& ) {
19 double dx = args.
value<
double>(
"Dx");
20 double dz = args.
value<
double>(
"Dz");
21 double angwidth = args.
value<
double>(
"AngWidth");
22 int iaxis = args.
value<
int>(
"Axis");
23 std::vector<std::string>
names = args.
value<std::vector<std::string> >(
"Names");
26 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalXtalAlgo::Parameters for positioning:" 27 <<
" Axis " << iaxis <<
"\tRadius " <<
convertCmToMm(radius) <<
"\tOffset " << offset
30 for (
unsigned int i = 0;
i < names.size();
i++)
33 <<
" NameSpace " << idNameSpace;
41 theta[1 - iaxis] = 90._deg;
46 theta[iaxis] = 90._deg +
angle;
49 phi[2] = iaxis * 90._deg;
52 phi[2] = (2 - 3 * iaxis) * 90._deg;
54 pos[iaxis] = angle * (dz +
radius);
58 idName = idNameSpace +
idName;
60 dd4hep::Position tran(pos[0], pos[1], pos[2]);
63 static const double tol = 0.01_deg;
73 parent.placeVolume(glog,
i + 1, dd4hep::Transform3D(rotation, tran));
75 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalXtalAlgo: " << glog.name() <<
" number " <<
i + 1 <<
" positioned in " 76 << parent.name() <<
" at " << tran <<
" with " <<
rotation;
dd4hep::Volume volume(const std::string &name, bool exc=true) const
constexpr NumType convertRadToDeg(NumType radians)
Sin< T >::type sin(const T &t)
T value(const std::string &name) const
Geom::Theta< T > theta() const
const std::string names[nVars_]
dd4hep::Rotation3D makeRotation3D(double thetaX, double phiX, double thetaY, double phiY, double thetaZ, double phiZ)
std::string_view name() const
static long algorithm(dd4hep::Detector &, cms::DDParsingContext &ctxt, xml_h e, dd4hep::SensitiveDetector &)
Abs< T >::type abs(const T &t)
constexpr NumType convertCmToMm(NumType centimeters)
#define DECLARE_DDCMS_DETELEMENT(name, func)
std::string parentName() const
Access value of rParent child node.
T angle(T x1, T y1, T z1, T x2, T y2, T z2)