88 LogDebug(
"TrackerGeom") <<
"DDTrackerIrregularRingAlgo info: Creating an instance";
99 startCopyNo =
int(nArgs[
"StartCopyNo"]);
100 incrCopyNo =
int(nArgs[
"IncrCopyNo"]);
101 rangeAngle = nArgs[
"RangeAngle"];
102 startAngle = nArgs[
"StartAngle"];
104 center = vArgs[
"Center"];
105 yawAngles = vArgs[
"yawAngleValues"];
106 phiAngles = vArgs[
"phiAngleValues"];
107 radiusValues = vArgs[
"radiusValues"];
108 isZPlus =
bool(nArgs[
"IsZPlus"]);
109 tiltAngle = nArgs[
"TiltAngle"];
110 isFlipped =
bool(nArgs[
"IsFlipped"]);
112 LogDebug(
"TrackerGeom") <<
"DDTrackerIrregularRingAlgo debug: Parameters for position" 113 <<
"ing:: n " <<
n <<
" Start, Range " <<
convertRadToDeg(startAngle) <<
" " 115 << center[1] <<
", " << center[2];
118 childName = sArgs[
"ChildName"];
121 LogDebug(
"TrackerGeom") <<
"DDTrackerIrregularRingAlgo debug: Parent " << parentName <<
"\tChild " << childName
122 <<
" NameSpace " << idNameSpace;
126 DDRotation flipRot, tiltRot, phiOwnAxisRot, phiRot, globalRot;
127 DDRotationMatrix flipMatrix, tiltMatrix, phiOwnAxisRotMatrix, phiRotMatrix, globalRotMatrix;
128 string rotstr =
"RTrackerRingAlgo";
132 string flipRotstr = rotstr +
"Flip";
135 LogDebug(
"TrackerGeom") <<
"DDTrackerIrregularRingAlgo test: Creating a new rotation: " << flipRotstr
139 flipRot =
DDrot(
DDName(flipRotstr, idNameSpace), 90._deg, 180._deg, 90._deg, 90._deg, 180._deg, 0.);
141 flipMatrix = flipRot.
matrix();
148 LogDebug(
"TrackerGeom") <<
"DDTrackerIrregularRingAlgo test: Creating a new rotation: " << tiltRotstr
151 tiltRot =
DDrot(
DDName(tiltRotstr, idNameSpace), 90._deg, 90._deg, tiltAngle, 180._deg, 90._deg - tiltAngle, 0.);
153 tiltMatrix = tiltRot.
matrix();
155 tiltMatrix *= flipMatrix;
161 LogDebug(
"TrackerGeom") <<
"DDTrackerIrregularRingAlgo test: Creating a new rotation: " << tiltRotstr
164 tiltRot =
DDrot(
DDName(tiltRotstr, idNameSpace), 90._deg, 90._deg, tiltAngle, 0., 90._deg + tiltAngle, 0.);
166 tiltMatrix = tiltRot.
matrix();
168 tiltMatrix *= flipMatrix;
175 double theta = 90._deg;
176 int copy = startCopyNo;
179 for (
int i = 0;
i <
n;
i++) {
186 double phiy = phix + 90._deg;
187 double phiy_ownaxis = phix_ownaxis + 90._deg;
190 if (phideg_ownaxis != 0) {
191 string phiOwnAxisRotstr = rotstr +
"PhiOwnAxis" +
to_string(phideg_ownaxis * 10.);
193 if (!phiOwnAxisRot) {
194 LogDebug(
"TrackerGeom") <<
"DDTrackerIrregularRingAlgo test: Creating a new rotation: " << phiOwnAxisRotstr
197 phiOwnAxisRot =
DDrot(
DDName(phiOwnAxisRotstr, idNameSpace),
theta, phix_ownaxis,
theta, phiy_ownaxis, 0., 0.);
199 phiOwnAxisRotMatrix = phiOwnAxisRot.
matrix();
202 string phiRotstr = rotstr +
"Phi" +
to_string(phideg * 10.);
205 LogDebug(
"TrackerGeom") <<
"DDTrackerIrregularRingAlgo test: Creating a new rotation: " << phiRotstr
210 phiRotMatrix = phiRot.
matrix();
216 globalRotstr +=
"ZPlus";
218 globalRotstr +=
"Flip";
221 globalRotstr +=
"ZMinus";
223 globalRotstr +=
"Flip";
228 LogDebug(
"TrackerGeom") <<
"DDTrackerIrregularRingAlgo test: Creating a new " 229 <<
"rotation: " << globalRotstr;
230 globalRotMatrix = phiOwnAxisRotMatrix * phiRotMatrix * tiltMatrix;
231 globalRot =
DDrot(
DDName(globalRotstr, idNameSpace), make_unique<DDRotationMatrix>(globalRotMatrix));
235 double xpos =
radius *
cos(phix) + center[0];
236 double ypos =
radius *
sin(phix) + center[1];
237 double zpos = center[2];
242 LogDebug(
"TrackerGeom") <<
"DDTrackerIrregularRingAlgo test " <<
child <<
" number " <<
copy <<
" positioned in " 243 << mother <<
" at " << tran <<
" with " << globalRot;
static AlgebraicMatrix initialize()
constexpr double convertDegToRad(NumType degrees)
vector< double > yawAngles
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string ©no, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
constexpr NumType convertRadToDeg(NumType radians)
Sin< T >::type sin(const T &t)
DDName is used to identify DDD entities uniquely.
std::string to_string(const V &value)
static std::string & ns()
Compact representation of the geometrical detector hierarchy.
void initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
Represents a uniquely identifyable rotation matrix.
U second(std::pair< T, U > const &p)
vector< double > phiAngles
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
Cos< T >::type cos(const T &t)
void execute(DDCompactView &cpv) override
vector< double > radiusValues
DDTrackerIrregularRingAlgo()
#define DEFINE_EDM_PLUGIN(factory, type, name)
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
Geom::Theta< T > theta() const
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
~DDTrackerIrregularRingAlgo() override
DDRotationMatrix & matrix()