14 #include "CLHEP/Units/GlobalPhysicalConstants.h"
15 #include "CLHEP/Units/GlobalSystemOfUnits.h"
61 iccName = sArgs[
"ICCName"];
63 LogDebug(
"TIDGeom") <<
"DDTIDRingAlgo debug: Parent " << parentName <<
"\tModule " <<
moduleName[0] <<
", "
64 <<
moduleName[1] <<
"\tICC " << iccName <<
"\tNameSpace " << idNameSpace;
66 number = int(nArgs[
"Number"]);
67 startAngle = nArgs[
"StartAngle"];
68 rModule = nArgs[
"ModuleR"];
69 zModule = vArgs[
"ModuleZ"];
71 sICC = nArgs[
"ICCShift"];
74 LogDebug(
"TIDGeom") <<
"DDTIDRingAlgo debug: Parameters for positioning--"
75 <<
" StartAngle " << startAngle / CLHEP::deg <<
" Copy Numbers " <<
number <<
" Modules at R "
76 << rModule <<
" Z " << zModule[0] <<
", " << zModule[1] <<
" ICCs at R " << rICC <<
" Z "
77 << zICC[0] <<
", " << zICC[1];
81 double theta = 90. * CLHEP::deg;
82 double phiy = 0. * CLHEP::deg;
83 double dphi = CLHEP::twopi /
number;
92 double phiz = startAngle +
i * dphi;
93 double xpos = rModule *
cos(phiz);
94 double ypos = rModule *
sin(phiz);
95 double zpos, thetay, phix;
97 phix = phiz + 90. * CLHEP::deg;
98 thetay = 0 * CLHEP::deg;
102 phix = phiz - 90. * CLHEP::deg;
103 thetay = 180 * CLHEP::deg;
109 phix = phix - 180. * CLHEP::deg;
110 thetay = thetay + 180. * CLHEP::deg;
114 double phideg = phiz / CLHEP::deg;
119 LogDebug(
"TIDGeom") <<
"DDTIDRingAlgo test: Creating a new rotation " << rotstr <<
"\t" << theta / CLHEP::deg
120 <<
", " << phix / CLHEP::deg <<
", " << thetay / CLHEP::deg <<
", " << phiy / CLHEP::deg
121 <<
", " << theta / CLHEP::deg <<
", " << phiz / CLHEP::deg;
122 rotation =
DDrot(
DDName(rotstr, idNameSpace), theta, phix, thetay, phiy, theta, phiz);
125 cpv.
position(module, mother,
i + 1, trmod, rotation);
126 LogDebug(
"TIDGeom") <<
"DDTIDRingAlgo test: " << module <<
" number " <<
i + 1 <<
" positioned in " << mother
127 <<
" at " << trmod <<
" with " <<
rotation;
132 xpos = rICC *
cos(phiz) + sICC *
sin(phiz);
133 ypos = rICC *
sin(phiz) - sICC *
cos(phiz);
136 xpos = rICC *
cos(phiz) - sICC *
sin(phiz);
137 ypos = rICC *
sin(phiz) + sICC *
cos(phiz);
140 cpv.
position(icc, mother,
i + 1, tricc, rotation);
141 LogDebug(
"TIDGeom") <<
"DDTIDRingAlgo test: " << icc <<
" number " <<
i + 1 <<
" positioned in " << mother <<
" at "
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)
Geom::Theta< T > theta() const
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.
Represents a uniquely identifyable rotation matrix.
U second(std::pair< T, U > const &p)
~DDTIDRingAlgo() override
Cos< T >::type cos(const T &t)
vector< string > moduleName
#define DEFINE_EDM_PLUGIN(factory, type, name)
void initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
const std::string & name() const
Returns the name.