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