18 #include "CLHEP/Units/GlobalPhysicalConstants.h"
19 #include "CLHEP/Units/GlobalSystemOfUnits.h"
23 LogDebug(
"TrackerGeom") <<
"DDTrackerRingAlgo info: Creating an instance";
41 isZPlus = bool(nArgs[
"IsZPlus"]);
45 if (fabs(
rangeAngle-360.0*CLHEP::deg)<0.001*CLHEP::deg) {
55 LogDebug(
"TrackerGeom") <<
"DDTrackerRingAlgo debug: Parameters for position"
56 <<
"ing:: n " <<
n <<
" Start, Range, Delta "
66 LogDebug(
"TrackerGeom") <<
"DDTrackerRingAlgo debug: Parent " << parentName
67 <<
"\tChild " <<
childName <<
" NameSpace "
73 DDRotation flipRot, tiltRot, phiRot, globalRot;
82 LogDebug(
"TrackerGeom") <<
"DDTrackerRingAlgo test: Creating a new rotation: " << flipRotstr
87 90.*CLHEP::deg, 180.*CLHEP::deg, 90.*CLHEP::deg, 90.*CLHEP::deg, 180.*CLHEP::deg, 0.);
89 flipMatrix = *flipRot.
matrix();
96 LogDebug(
"TrackerGeom") <<
"DDTrackerRingAlgo test: Creating a new rotation: " << tiltRotstr
101 90.*CLHEP::deg, 90.*CLHEP::deg,
tiltAngle, 180.*CLHEP::deg, 90.*CLHEP::deg -
tiltAngle, 0.);
103 tiltMatrix = *tiltRot.
matrix();
104 if (
isFlipped) { tiltMatrix *= flipMatrix; }
110 LogDebug(
"TrackerGeom") <<
"DDTrackerRingAlgo test: Creating a new rotation: " << tiltRotstr
117 tiltMatrix = *tiltRot.
matrix();
118 if (
isFlipped) { tiltMatrix *= flipMatrix; }
124 double theta = 90.*CLHEP::deg;
128 for (
int i=0;
i<
n;
i++) {
132 double phiy = phix + 90.*CLHEP::deg;
133 double phideg = phix/CLHEP::deg;
138 LogDebug(
"TrackerGeom") <<
"DDTrackerRingAlgo test: Creating a new rotation: " << phiRotstr
139 <<
"\t90., " << phix/CLHEP::deg
140 <<
", 90.," << phiy/CLHEP::deg
144 phiRotMatrix = *phiRot.
matrix();
150 globalRotstr +=
"ZPlus";
151 if (
isFlipped) { globalRotstr +=
"Flip"; }
154 globalRotstr +=
"ZMinus";
155 if (
isFlipped) { globalRotstr +=
"Flip"; }
159 LogDebug(
"TrackerGeom") <<
"DDTrackerRingAlgo test: Creating a new "
160 <<
"rotation: " << globalRotstr;
161 globalRotMatrix = phiRotMatrix * tiltMatrix;
167 double ypos =
radius*
sin(phi) + center[1];
168 double zpos = center[2];
172 cpv.
position(child, mother, copy, tran, globalRot);
173 LogDebug(
"TrackerGeom") <<
"DDTrackerRingAlgo test " << child <<
" number "
174 << copy <<
" positioned in " << mother <<
" at "
175 << 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()
std::string dbl_to_string(const double &in)
Converts only the integer part of a double to a string.
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