24 #include "CLHEP/Vector/RotationInterfaces.h"
25 #include "CLHEP/Units/GlobalPhysicalConstants.h"
26 #include "CLHEP/Units/GlobalSystemOfUnits.h"
42 if ( nArgs.find(
"Endcap") != nArgs.end() ) {
48 if ( sArgs.find(
"FlagString") != sArgs.end() ) {
56 if ( sArgs.find(
"Child") != sArgs.end() ) {
62 if ( vArgs.find(
"ChildTranslation") != vArgs.end() ) {
68 if ( sArgs.find(
"ChildRotation") != sArgs.end() ) {
87 jX = -16.25*CLHEP::mm;
130 CLHEP::HepRotation childRotMatrix = CLHEP::HepRotation();
135 childRotation.
rotation()->GetComponents(x, y, z);
136 CLHEP::HepRep3x3 tr(x.X(), y.X(), z.X(), x.Y(), y.Y(), z.Y(), x.Z(), y.Z(), z.Z());
137 childRotMatrix = CLHEP::HepRotation(tr);
138 }
else if (
childName ==
"pixfwdNipple:PixelForwardNippleZPlus") {
140 }
else if (
childName ==
"pixfwdNipple:PixelForwardNippleZMinus") {
144 CLHEP::Hep3Vector childTranslation;
145 if (
childName ==
"pixfwdNipple:PixelForwardNippleZPlus") {
147 }
else if (
childName ==
"pixfwdNipple:PixelForwardNippleZMinus") {
155 CLHEP::HepRotation bladeRotMatrix(CLHEP::Hep3Vector(0.,1.,0.),effBladeAngle);
161 double zShiftMax = effBladeZShift*((nQuarter-1)/2.);
163 for (
int iBlade=0; iBlade <
nBlades; iBlade++) {
172 double phi = (iBlade + 0.5) * deltaPhi - 90.*CLHEP::deg;
173 int iQuarter = iBlade % nQuarter;
174 double zShift = - zShiftMax + iQuarter * effBladeZShift;
178 CLHEP::HepRotation rotMatrix(CLHEP::Hep3Vector(0.,0.,1.), phi);
179 rotMatrix *= bladeRotMatrix;
183 CLHEP::Hep3Vector translation = rotMatrix(childTranslation + CLHEP::Hep3Vector(0.,
ancorRadius, 0.));
184 translation += CLHEP::Hep3Vector(0., 0., zShift +
zPlane);
193 rotMatrix *= childRotMatrix;
195 rotMatrix.yx(), rotMatrix.yy(), rotMatrix.yz(),
196 rotMatrix.zx(), rotMatrix.zy(), rotMatrix.zz() );
201 DDTranslation ddtran(translation.x(), translation.y(), translation.z());
202 cpv.
position(child, mother, copy, ddtran, rotation);
224 CLHEP::Hep3Vector jC;
225 CLHEP::Hep3Vector kB;
233 rotNameNippleToCover =
"NippleToCoverZPlus";
234 rotNameCoverToNipple =
"CoverToNippleZPlus";
235 rotNameNippleToBody =
"NippleToBodyZPlus";
239 rotNameNippleToCover =
"NippleToCoverZMinus";
240 rotNameCoverToNipple =
"CoverToNippleZMinus";
241 rotNameNippleToBody =
"NippleToBodyZMinus";
251 CLHEP::HepRotation rCB(CLHEP::Hep3Vector(1.*
sin(effBladeAngle), 0., 1.*
cos(effBladeAngle)), deltaPhi);
255 CLHEP::Hep3Vector kC = rCB * (kB + tCB);
259 CLHEP::Hep3Vector jkC = kC - jC;
260 double* jkLength =
new double(jkC.mag());
262 LogDebug(
"PixelGeom") <<
"+++++++++++++++ DDPixFwdBlades: " <<
"JK Length " << *jkLength * CLHEP::mm;
266 CLHEP::Hep3Vector nippleTranslation((kC+jC)/2. - CLHEP::Hep3Vector(0.,
ancorRadius, 0.));
272 LogDebug(
"PixelGeom") <<
"Child translation : " << nippleTranslation;
276 CLHEP::Hep3Vector vZ(0.,0.,1.);
277 CLHEP::Hep3Vector axis = vZ.cross(jkC);
278 double angleCover = vZ.angle(jkC);
279 LogDebug(
"PixelGeom") <<
" Angle to Cover: " << angleCover;
280 CLHEP::HepRotation* rpCN =
new CLHEP::HepRotation(axis, angleCover);
289 rpCN->yx(), rpCN->yy(), rpCN->yz(),
290 rpCN->zx(), rpCN->zy(), rpCN->zz() );
292 DDrot(
DDName(rotNameCoverToNipple,
"pixfwdNipple"), ddrpCN);
293 CLHEP::HepRotation rpNC(axis, -angleCover);
295 rpNC.yx(), rpNC.yy(), rpNC.yz(),
296 rpNC.zx(), rpNC.zy(), rpNC.zz() );
298 DDrot(
DDName(rotNameNippleToCover,
"pixfwdNipple"), ddrpNC);
302 CLHEP::HepRotation rpNB( rpNC * rCB );
304 rpNB.yx(), rpNB.yy(), rpNB.yz(),
305 rpNB.zx(), rpNB.zy(), rpNB.zz() );
307 DDrot(
DDName(rotNameNippleToBody,
"pixfwdNipple"), ddrpNB);
308 double angleBody = vZ.angle(rpNB * vZ);
309 LogDebug(
"PixelGeom") <<
" Angle to body : " << angleBody;
const DDRotationMatrix * rotation() const
Returns the read-only rotation-matrix.
void execute(DDCompactView &cpv)
std::map< std::string, int > copyNumbers
double nippleTranslationZ
virtual ~DDPixFwdBlades()
Sin< T >::type sin(const T &t)
void position(const DDLogicalPart &self, const DDLogicalPart &parent, std::string copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=NULL)
const reco::GenParticle * mother(const reco::GenParticle &p, unsigned int imoth=0)
void computeNippleParameters(double endcap)
DDName is used to identify DDD entities uniquely.
static std::string & ns()
type of data representation of DDCompactView
std::vector< double > childTranslationVector
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Represents a uniquely identifyable rotation matrix.
U second(std::pair< T, U > const &p)
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
A DD Translation is currently implemented with Root Vector3D.
std::string int_to_string(const int &in)
Cos< T >::type cos(const T &t)
double nippleTranslationX
CLHEP::HepRotation * nippleRotationZMinus
CLHEP::HepRotation * nippleRotationZPlus
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 = ':'
double nippleTranslationY
a named constant corresponding to the DDL-XML tag <Constant> and <ConstantsVector> ...
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
std::string childRotationName