18 #include "CLHEP/Vector/ThreeVector.h" 19 #include "CLHEP/Vector/Rotation.h" 20 #include "CLHEP/Vector/RotationInterfaces.h" 21 #include "CLHEP/Units/GlobalPhysicalConstants.h" 22 #include "CLHEP/Units/GlobalSystemOfUnits.h" 71 nBlades_ =
static_cast<int>(nArgs[
"Blades"]);
76 nippleType_ =
static_cast<int>(nArgs[
"NippleType"]);
87 startCopy_ =
static_cast<int>(nArgs[
"StartCopy"]);
100 <<
" jX|jY|jZ " <<
jX_ <<
":" <<
jY_ <<
":" <<
jZ_ <<
" kX|kY|kZ " <<
kX_ <<
":" <<
kY_ 117 CLHEP::HepRotation childRotMatrix = CLHEP::HepRotation();
126 CLHEP::HepRep3x3 tr(
x.X(),
y.X(),
z.X(),
x.Y(),
y.Y(),
z.Y(),
x.Z(),
y.Z(),
z.Z());
127 childRotMatrix = CLHEP::HepRotation(tr);
130 CLHEP::Hep3Vector childTranslation =
136 CLHEP::HepRotation bladeRotMatrix(CLHEP::Hep3Vector(0., 1., 0.), effBladeAngle);
142 double zShiftMax = effBladeZShift * ((nQuarter - 1) / 2.);
145 for (
int iBlade = 0; iBlade <
nBlades_; iBlade++) {
153 double phi = (iBlade + 0.5) *
deltaPhi - 90. * CLHEP::deg;
154 int iQuarter = iBlade % nQuarter;
155 double zShift = -zShiftMax + iQuarter * effBladeZShift;
158 CLHEP::HepRotation rotMatrix(CLHEP::Hep3Vector(0., 0., 1.),
phi);
159 rotMatrix *= bladeRotMatrix;
162 CLHEP::Hep3Vector translation = rotMatrix(childTranslation + CLHEP::Hep3Vector(0.,
ancorRadius_, 0.));
163 translation += CLHEP::Hep3Vector(0., 0., zShift +
zPlane_);
172 rotMatrix *= childRotMatrix;
174 std::make_unique<DDRotationMatrix>(rotMatrix.xx(),
186 DDTranslation ddtran(translation.x(), translation.y(), translation.z());
189 <<
" with translation " << ddtran <<
" and rotation " <<
rotation;
201 CLHEP::Hep3Vector jC =
203 CLHEP::Hep3Vector kB =
211 CLHEP::HepRotation rCB(CLHEP::Hep3Vector(1. *
sin(effBladeAngle), 0., 1. *
cos(effBladeAngle)),
deltaPhi);
214 CLHEP::Hep3Vector kC = rCB * (kB + tCB);
217 CLHEP::Hep3Vector nippleTranslation((kC + jC) / 2. - CLHEP::Hep3Vector(0.,
ancorRadius_, 0.));
218 edm::LogVerbatim(
"PixelGeom") <<
"Child translation : " << nippleTranslation;
219 return nippleTranslation;
225 CLHEP::Hep3Vector jC =
227 CLHEP::Hep3Vector kB =
235 CLHEP::HepRotation rCB(CLHEP::Hep3Vector(1. *
sin(effBladeAngle), 0., 1. *
cos(effBladeAngle)),
deltaPhi);
238 CLHEP::Hep3Vector kC = rCB * (kB + tCB);
239 CLHEP::Hep3Vector jkC = kC - jC;
241 <<
"JK Length " << jkC.mag() * CLHEP::mm;
244 CLHEP::Hep3Vector vZ(0., 0., 1.);
245 CLHEP::Hep3Vector axis = vZ.cross(jkC);
246 double angleCover = vZ.angle(jkC);
248 CLHEP::HepRotation rpCN(axis, angleCover);
Log< level::Info, true > LogVerbatim
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string ©no, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
Sin< T >::type sin(const T &t)
DDName is used to identify DDD entities uniquely.
static std::string & ns()
std::string childRotationName_
Compact representation of the geometrical detector hierarchy.
static std::string to_string(const XMLCh *ch)
Represents a uniquely identifyable rotation matrix.
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
U second(std::pair< T, U > const &p)
const std::string & name() const
Returns the name.
CLHEP::HepRotation getRotation()
~DDPixFwdBladesNew() override=default
std::string flagSelector_
Cos< T >::type cos(const T &t)
void execute(DDCompactView &cpv) override
std::vector< double > childTranslationVector_
void initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
const DDRotationMatrix & rotation() const
Returns the read-only rotation-matrix.
#define DEFINE_EDM_PLUGIN(factory, type, name)
CLHEP::Hep3Vector getTranslation()
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation