|
|
Go to the documentation of this file.
12 #include "CLHEP/Units/PhysicalConstants.h"
13 #include "CLHEP/Units/SystemOfUnits.h"
60 startCopyNo =
int(nArgs[
"StartCopyNo"]);
61 nBlades =
int(nArgs[
"NumberOfBlades"]);
62 bladeAngle = nArgs[
"BladeAngle"];
63 bladeTilt = nArgs[
"BladeTilt"];
64 zPlane = nArgs[
"BladeCommonZ"];
65 bladeZShift = vArgs[
"BladeZShift"];
66 anchorR = nArgs[
"AnchorRadius"];
69 childName = sArgs[
"ChildName"];
70 rotName = sArgs[
"RotationName"];
71 flagString = sArgs[
"FlagString"];
73 LogDebug(
"TrackerGeom") <<
"DDPixFwdDiskAlgo debug: Parent " << parentName <<
"\tChild " << childName <<
" NameSpace "
74 << idNameSpace <<
"\tRot Name " << rotName <<
"\tCopyNo (Start/Total) " << startCopyNo <<
", "
75 << nBlades <<
"\tAngles " << bladeAngle / CLHEP::deg <<
", " << bladeTilt / CLHEP::deg
76 <<
"\tZshifts " << zPlane <<
"\tAmnchor Radius " << anchorR;
78 for (
int iBlade = 0; iBlade < nBlades; ++iBlade) {
79 LogDebug(
"TrackerGeom") <<
"DDPixFwdDiskAlgo: Blade " << iBlade <<
" flag " << flagString[iBlade] <<
" zshift "
80 << bladeZShift[iBlade];
85 int copy = startCopyNo;
88 string flagSelector =
"Y";
90 double deltaPhi = (360. / nBlades) * CLHEP::deg;
91 string rotns =
DDSplit(rotName).second;
92 for (
int iBlade = 0; iBlade < nBlades; ++iBlade) {
93 if (flagString[iBlade] == flagSelector[0]) {
94 string rotstr =
DDSplit(rotName).first + to_string(
double(
copy));
96 double phi = (iBlade + 0.5) *
deltaPhi;
98 double phix = atan2(
sin(phi) *
cos(bladeAngle),
cos(phi) *
cos(bladeAngle));
99 double thetx = acos(-
sin(bladeAngle));
100 double phiy = atan2((
cos(phi) *
cos(bladeTilt) +
sin(phi) *
sin(bladeAngle) *
sin(bladeTilt)),
101 (-
sin(phi) *
cos(bladeTilt) +
cos(phi) *
sin(bladeAngle) *
sin(bladeTilt)));
102 double thety = acos(
cos(bladeAngle) *
sin(bladeTilt));
103 double phiz = atan2((-
cos(phi) *
sin(bladeTilt) +
sin(phi) *
sin(bladeAngle) *
cos(bladeTilt)),
104 (
sin(phi) *
sin(bladeTilt) +
cos(phi) *
sin(bladeAngle) *
cos(bladeTilt)));
105 double thetz = acos(
cos(bladeAngle) *
cos(bladeTilt));
108 LogDebug(
"TrackerGeom") <<
"DDPixFwdDiskAlgo test: Creating a new "
109 <<
"rotation: " << rotstr <<
"\t" << thetx / CLHEP::deg <<
", " << phix / CLHEP::deg
110 <<
", " << thety / CLHEP::deg <<
", " << phiy / CLHEP::deg <<
", " << thetz / CLHEP::deg
111 <<
", " << phiz / CLHEP::deg;
112 LogDebug(
"TrackerGeom") <<
"Rotation Matrix (" << phi / CLHEP::deg <<
", " << bladeAngle / CLHEP::deg <<
", "
113 << bladeTilt / CLHEP::deg <<
") " <<
cos(phi) *
cos(bladeAngle) <<
", "
114 << (-
sin(phi) *
cos(bladeTilt) +
cos(phi) *
sin(bladeAngle) *
sin(bladeTilt)) <<
", "
115 << (
sin(phi) *
sin(bladeTilt) +
cos(phi) *
sin(bladeAngle) *
cos(bladeTilt)) <<
", "
116 <<
sin(phi) *
cos(bladeAngle) <<
", "
117 << (
cos(phi) *
cos(bladeTilt) +
sin(phi) *
sin(bladeAngle) *
sin(bladeTilt)) <<
", "
118 << (-
cos(phi) *
sin(bladeTilt) +
sin(phi) *
sin(bladeAngle) *
cos(bladeTilt)) <<
", "
119 << -
sin(bladeAngle) <<
", " <<
cos(bladeAngle) *
sin(bladeTilt) <<
", "
120 <<
cos(bladeAngle) *
cos(bladeTilt);
121 rot =
DDrot(
DDName(rotstr, rotns), thetx, phix, thety, phiy, thetz, phiz);
123 double xpos = anchorR * (-
sin(phi) *
cos(bladeTilt) +
cos(phi) *
sin(bladeAngle) *
sin(bladeTilt));
124 double ypos = anchorR * (
cos(phi) *
cos(bladeTilt) +
sin(phi) *
sin(bladeAngle) *
sin(bladeTilt));
125 double zpos = anchorR * (
cos(bladeAngle) *
sin(bladeTilt)) + zPlane + bladeZShift[iBlade];
128 LogDebug(
"TrackerGeom") <<
"DDPixFwdDiskAlgo test: " <<
child <<
" number " <<
copy <<
" positioned in " << mother
129 <<
" at " << tran <<
" with " <<
rot;
void initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
DDName is used to identify DDD entities uniquely.
vector< double > bladeZShift
U second(std::pair< T, U > const &p)
Sin< T >::type sin(const T &t)
Cos< T >::type cos(const T &t)
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Compact representation of the geometrical detector hierarchy.
#define DEFINE_EDM_PLUGIN(factory, type, name)
void execute(DDCompactView &cpv) override
static std::string & ns()
Represents a uniquely identifyable rotation matrix.
~DDPixFwdDiskAlgo() override
static AlgebraicMatrix initialize()
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string ©no, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
ROOT::Math::Rotation3D DDRotation