72 DDRotation flipRot, tiltRot, phiRot, globalRot;
81 LogDebug(
"TrackerGeom") <<
"DDTrackerRingAlgo test: Creating a new rotation: " << flipRotstr
86 90.*CLHEP::deg, 180.*CLHEP::deg, 90.*CLHEP::deg, 90.*CLHEP::deg, 180.*CLHEP::deg, 0.);
88 flipMatrix = flipRot.
matrix();
95 LogDebug(
"TrackerGeom") <<
"DDTrackerRingAlgo test: Creating a new rotation: " << tiltRotstr
100 90.*CLHEP::deg, 90.*CLHEP::deg,
tiltAngle, 180.*CLHEP::deg, 90.*CLHEP::deg -
tiltAngle, 0.);
102 tiltMatrix = tiltRot.
matrix();
103 if (
isFlipped) { tiltMatrix *= flipMatrix; }
109 LogDebug(
"TrackerGeom") <<
"DDTrackerRingAlgo test: Creating a new rotation: " << tiltRotstr
116 tiltMatrix = tiltRot.
matrix();
117 if (
isFlipped) { tiltMatrix *= flipMatrix; }
123 double theta = 90.*CLHEP::deg;
127 for (
int i=0;
i<
n;
i++) {
131 double phiy = phix + 90.*CLHEP::deg;
132 double phideg = phix/CLHEP::deg;
134 std::string phiRotstr = rotstr +
"Phi" + std::to_string(phideg*10.);
137 LogDebug(
"TrackerGeom") <<
"DDTrackerRingAlgo test: Creating a new rotation: " << phiRotstr
138 <<
"\t90., " << phix/CLHEP::deg
139 <<
", 90.," << phiy/CLHEP::deg
143 phiRotMatrix = phiRot.
matrix();
147 std::string globalRotstr = rotstr +
"Phi" + std::to_string(phideg*10.) +
"Tilt" + std::to_string(
tiltAngle/CLHEP::deg);
149 globalRotstr +=
"ZPlus";
150 if (
isFlipped) { globalRotstr +=
"Flip"; }
153 globalRotstr +=
"ZMinus";
154 if (
isFlipped) { globalRotstr +=
"Flip"; }
158 LogDebug(
"TrackerGeom") <<
"DDTrackerRingAlgo test: Creating a new " 159 <<
"rotation: " << globalRotstr;
160 globalRotMatrix = phiRotMatrix * tiltMatrix;
161 globalRot =
DDrot(
DDName(globalRotstr,
idNameSpace), std::make_unique<DDRotationMatrix>(globalRotMatrix));
166 double ypos =
radius*
sin(phi) + center[1];
167 double zpos = center[2];
172 LogDebug(
"TrackerGeom") <<
"DDTrackerRingAlgo test " <<
child <<
" number " 173 << copy <<
" positioned in " << mother <<
" at " 174 << tran <<
" with " << globalRot;
Sin< T >::type sin(const T &t)
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
Geom::Theta< T > theta() const
DDName is used to identify DDD entities uniquely.
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Represents a uniquely identifyable rotation matrix.
U second(std::pair< T, U > const &p)
Cos< T >::type cos(const T &t)
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string ©no, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
DDRotationMatrix & matrix()
std::vector< double > center