Definition at line 9 of file DDHCalTestBeamAlgo.cc.
References funct::abs(), writedatasetfile::args, geant_units::operators::convertCmToMm(), angle_units::operators::convertRadToDeg(), funct::cos(), HLT_2018_cff::distance, PVValHelper::dz, PVValHelper::eta, JetChargeProducer_cfi::exp, cms::makeRotation3D(), cms::DDNamespace::name(), NAMESPACE_SEP, class-composition::parent, cms::DDAlgoArguments::parentName(), alignCSCRings::r, idealTransformation::rotation, funct::sin(), AlCaHLTBitMon_QueryRunRegistry::string, theta(), cms::DDAlgoArguments::value(), and cms::DDNamespace::volume().
16 double eta =
args.value<
double>(
"Eta");
17 double phi =
args.value<
double>(
"Phi");
18 double theta = 2.0 * atan(
exp(-eta));
20 double distanceZ =
args.value<
double>(
"DistZ");
21 double dist = (distance + distanceZ /
sin(theta));
22 int copyNumber =
args.value<
int>(
"Number");
24 double dz =
args.value<
double>(
"Dz");
26 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalTestBeamAlgo: Parameters for position" 31 <<
"\tcopyNumber " << copyNumber;
32 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalTestBeamAlgo:Parent " <<
args.parentName() <<
"\tChild " << childName
33 <<
" NameSpace " << ns.name();
38 double thetax = 90._deg +
theta;
39 double sthx =
sin(thetax);
44 double phix = atan2(sthx *
cos(theta) *
sin(phi), sthx *
cos(theta) *
cos(phi));
45 double thetay = 90._deg;
46 double phiy = 90._deg +
phi;
47 double thetaz =
theta;
58 double r = dist *
sin(theta);
59 double xpos = r *
cos(phi);
60 double ypos = r *
sin(phi);
61 double zpos = dist *
cos(theta);
62 dd4hep::Position tran(xpos, ypos, zpos);
65 childName = ns.name() + childName;
67 parent.placeVolume(child, copyNumber, dd4hep::Transform3D(rotation, tran));
69 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalTestBeamAlgo: " << child.name() <<
" number " << copyNumber
70 <<
" positioned in " << parent.name() <<
" at (" <<
convertCmToMm(xpos) <<
", " 73 xpos = (dist -
dz) *
sin(theta) *
cos(phi);
74 ypos = (dist -
dz) *
sin(theta) *
sin(phi);
75 zpos = (dist -
dz) *
cos(theta);
77 edm::LogInfo(
"HCalGeom") <<
"DDHCalTestBeamAlgo: Suggested Beam position " 79 <<
") and (dist, eta, phi) = (" <<
convertCmToMm(dist - dz) <<
", " << eta <<
", " << phi
constexpr NumType convertRadToDeg(NumType radians)
Sin< T >::type sin(const T &t)
Geom::Theta< T > theta() const
dd4hep::Rotation3D makeRotation3D(double thetaX, double phiX, double thetaY, double phiY, double thetaZ, double phiZ)
Cos< T >::type cos(const T &t)
Abs< T >::type abs(const T &t)
constexpr NumType convertCmToMm(NumType centimeters)