17 #include "CLHEP/Units/GlobalPhysicalConstants.h"
18 #include "CLHEP/Units/GlobalSystemOfUnits.h"
22 LogDebug(
"TrackerGeom") <<
"DDTrackerRingAlgo info: Creating an instance";
40 isZPlus = bool(nArgs[
"IsZPlus"]);
44 if (fabs(
rangeAngle-360.0*CLHEP::deg)<0.001*CLHEP::deg) {
54 LogDebug(
"TrackerGeom") <<
"DDTrackerRingAlgo debug: Parameters for position"
55 <<
"ing:: n " <<
n <<
" Start, Range, Delta "
65 LogDebug(
"TrackerGeom") <<
"DDTrackerRingAlgo debug: Parent " << parentName
66 <<
"\tChild " <<
childName <<
" NameSpace "
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;
166 double ypos =
radius*
sin(phi) + center[1];
167 double zpos = center[2];
171 cpv.
position(child, mother, copy, tran, globalRot);
172 LogDebug(
"TrackerGeom") <<
"DDTrackerRingAlgo test " << child <<
" number "
173 << copy <<
" positioned in " << mother <<
" at "
174 << tran <<
" with " << globalRot;
void execute(DDCompactView &cpv)
Sin< T >::type sin(const T &t)
Geom::Theta< T > theta() const
void position(const DDLogicalPart &self, const DDLogicalPart &parent, std::string copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=NULL)
DDName is used to identify DDD entities uniquely.
static std::string & ns()
type of data representation of DDCompactView
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 initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs)
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
virtual ~DDTrackerRingAlgo()
DDRotationMatrix * matrix()
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
std::vector< double > center