1 #include "DD4hep/DetFactoryHelper.h" 16 string childName =
args.value<
string>(
"ChildName");
19 string parentName =
args.parentName();
20 int n =
args.value<
int>(
"N");
21 int startCopyNo =
args.value<
int>(
"StartCopyNo");
22 int incrCopyNo =
args.value<
int>(
"IncrCopyNo");
23 double rangeAngle =
args.value<
double>(
"RangeAngle");
24 double startAngle =
args.value<
double>(
"StartAngle");
26 vector<double> center =
args.value<vector<double> >(
"Center");
27 vector<double> phiAngles =
args.value<vector<double> >(
"phiAngleValues");
28 vector<double> radiusValues =
args.value<vector<double> >(
"radiusValues");
29 vector<double> yawAngles =
args.value<vector<double> >(
"yawAngleValues");
30 bool isZPlus =
args.value<
int>(
"IsZPlus") == 1;
31 double tiltAngle =
args.value<
double>(
"TiltAngle");
32 bool isFlipped =
args.value<
int>(
"IsFlipped") == 1;
34 edm::LogVerbatim(
"TrackerGeom") <<
"DDTrackerIrregularRingAlgo debug: Parameters for position" 37 <<
", " << center[1] <<
", " << center[2];
39 edm::LogVerbatim(
"TrackerGeom") <<
"DDTrackerIrregularRingAlgo debug: Parent " << parentName <<
"\tChild " 40 << childName <<
" NameSpace " << ns.name();
42 Rotation3D flipMatrix, tiltMatrix, phiRotMatrix, globalRotMatrix, phiOwnAxisRotMatrix;
46 edm::LogVerbatim(
"TrackerGeom") <<
"DDTrackerIrregularRingAlgo test: Creating a new rotation: " 50 flipMatrix =
makeRotation3D(90._deg, 180._deg, 90._deg, 90._deg, 180._deg, 0._deg);
54 edm::LogVerbatim(
"TrackerGeom") <<
"DDTrackerIrregularRingAlgo test: Creating a new rotation: " 57 tiltMatrix =
makeRotation3D(90._deg, 90._deg, tiltAngle, 180._deg, 90._deg - tiltAngle, 0._deg);
59 tiltMatrix *= flipMatrix;
62 edm::LogVerbatim(
"TrackerGeom") <<
"DDTrackerIrregularRingAlgo test: Creating a new rotation: " 65 tiltMatrix =
makeRotation3D(90._deg, 90._deg, tiltAngle, 0._deg, 90._deg + tiltAngle, 0._deg);
67 tiltMatrix *= flipMatrix;
72 double theta = 90._deg;
73 int copy = startCopyNo;
75 for (
int i = 0;
i <
n; ++
i) {
80 double phiy = phix + 90._deg;
81 double phiy_ownaxis = phix_ownaxis + 90._deg;
82 if (phix_ownaxis != 0.) {
83 LogDebug(
"TrackerGeom") <<
"DDTrackerIrregularRingAlgo test: Creating a new rotation: " 89 edm::LogVerbatim(
"TrackerGeom") <<
"DDTrackerIrregularRingAlgo test: Creating a new rotation: " 95 globalRotMatrix = phiOwnAxisRotMatrix * phiRotMatrix * tiltMatrix;
98 double xpos =
radius *
cos(phix) + center[0];
99 double ypos =
radius *
sin(phix) + center[1];
100 double zpos = center[2];
104 mother.placeVolume(
child,
copy, Transform3D(globalRotMatrix, tran));
105 edm::LogVerbatim(
"TrackerGeom") <<
"DDTrackerIrregularRingAlgo test " <<
child.data()->GetName() <<
" number " 106 <<
copy <<
" positioned in " << mother.data()->GetName() <<
" at " << tran
107 <<
" with " << globalRotMatrix;
Log< level::Info, true > LogVerbatim
constexpr double convertDegToRad(NumType degrees)
constexpr NumType convertRadToDeg(NumType radians)
Sin< T >::type sin(const T &t)
DDRotationMatrix makeRotation3D(double thetaX, double phiX, double thetaY, double phiY, double thetaZ, double phiZ)
#define DECLARE_DDCMS_DETELEMENT(name, func)
static constexpr long s_executed
Cos< T >::type cos(const T &t)
Namespace of DDCMS conversion namespace.
Geom::Theta< T > theta() const