1 #include "DD4hep/DetFactoryHelper.h" 12 dd4hep::SensitiveDetector& ) {
17 double eta = args.
value<
double>(
"Eta");
18 double theta = 2.0 * atan(
exp(-eta));
19 double shiftY = args.
value<
double>(
"ShiftX");
20 double shiftX = args.
value<
double>(
"ShiftY");
21 double zoffset = args.
value<
double>(
"Zoffset");
22 double dist = args.
value<
double>(
"Distance");
23 double tilt = args.
value<
double>(
"TiltAngle");
24 int copyNumber = args.
value<
int>(
"Number");
27 childName = idNameSpace + childName;
31 <<
" Eta " << eta <<
"\tTheta " <<
convertRadToDeg(theta) <<
"\tShifts " 33 <<
"axes; \tZoffest " <<
convertCmToMm(zoffset) <<
"\tRadial Distance " 37 <<
" NameSpace " << idNameSpace;
44 double thetax = 90._deg -
theta;
45 double z = zoffset + dist *
tan(thetax);
46 double x = shiftX - shiftY *
sin(tilt);
47 double y = shiftY *
cos(tilt);
48 dd4hep::Position tran(x, y, z);
49 dd4hep::Rotation3D
rot;
55 rot = dd4hep::RotationZ(tilt);
57 mother.placeVolume(child, copyNumber, dd4hep::Transform3D(rot, tran));
59 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalTBZposAlgo: " << child.name() <<
" number " << copyNumber <<
" positioned in " dd4hep::Volume volume(const std::string &name, bool exc=true) const
static long algorithm(dd4hep::Detector &, cms::DDParsingContext &ctxt, xml_h e, dd4hep::SensitiveDetector &)
constexpr NumType convertRadToDeg(NumType radians)
Sin< T >::type sin(const T &t)
T value(const std::string &name) const
Geom::Theta< T > theta() const
std::string_view name() const
Cos< T >::type cos(const T &t)
Tan< T >::type tan(const T &t)
constexpr NumType convertCmToMm(NumType centimeters)
#define DECLARE_DDCMS_DETELEMENT(name, func)
std::string parentName() const
Access value of rParent child node.