1 #include "DD4hep/DetFactoryHelper.h" 14 int startCopyNo =
args.value<
int>(
"StartCopyNo");
15 double rpos =
args.value<
double>(
"Rpos");
16 double zpos =
args.value<
double>(
"Zpos");
17 double optoHeight =
args.value<
double>(
"OptoHeight");
18 double optoWidth =
args.value<
double>(
"OptoWidth");
19 vector<double>
angles =
args.value<vector<double> >(
"Angles");
24 edm::LogVerbatim(
"TECGeom") <<
"Height of the Hybrid " << optoHeight <<
" and Width " << optoWidth <<
"Rpos " << rpos
25 <<
" Zpos " << zpos <<
" StartCopyNo " << startCopyNo <<
" Number " <<
angles.size();
28 rpos += optoHeight / 2;
29 int copyNo = startCopyNo;
33 phix += asin(optoWidth / 2 / rpos);
34 double xpos = rpos *
cos(phix);
35 double ypos = rpos *
sin(phix);
39 double phiy = phix + 90._deg;
47 double theta = 90._deg;
49 <<
"rotation: " << rotstr <<
"\t90., " <<
convertRadToDeg(phix) <<
", 90.," 54 mother.placeVolume(
child, copyNo, Transform3D(
rotation, tran));
55 edm::LogVerbatim(
"TECGeom") <<
"test " <<
child.name() <<
" number " << copyNo <<
" positioned in " << mother.name()
56 <<
" at " << tran <<
" with " <<
rotation;
59 edm::LogVerbatim(
"TECGeom") <<
"<<== End of DDTECOptoHybAlgo construction ...";
Log< level::Info, true > LogVerbatim
const dd4hep::Rotation3D & rotation(const std::string &name) const
static long algorithm(Detector &, cms::DDParsingContext &ctxt, xml_h e)
constexpr NumType convertRadToDeg(NumType radians)
Sin< T >::type sin(const T &t)
std::unordered_map< std::string, dd4hep::Rotation3D > rotations
DDRotationMatrix makeRotation3D(double thetaX, double phiX, double thetaY, double phiY, double thetaZ, double phiZ)
static std::string to_string(const XMLCh *ch)
#define DECLARE_DDCMS_DETELEMENT(name, func)
static std::string nsName(const std::string &)
std::string_view name() const
Cos< T >::type cos(const T &t)
Namespace of DDCMS conversion namespace.
Geom::Theta< T > theta() const
dd4hep::Volume volume(const std::string &name, bool exc=true) const
std::string prepend(const std::string &) const
T angle(T x1, T y1, T z1, T x2, T y2, T z2)