CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DDPixFwdRotation Class Reference
Inheritance diagram for DDPixFwdRotation:

Public Member Functions

 DDPixFwdRotation ()
 
void execute (DDCompactView &cpv) override
 
void initialize (const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
 
 ~DDPixFwdRotation () override=default
 

Private Attributes

double ancorRadius_
 
double bladeAngle_
 
double bladeZShift_
 
double endcap_
 
std::string idNameSpace_
 
double jX_
 
double jY_
 
double jZ_
 
double kX_
 
double kY_
 
double kZ_
 
int nBlades_
 
std::string rotNameCoverToNipple_
 
std::string rotNameNippleToBody_
 
std::string rotNameNippleToCover_
 
std::string rotNS_
 

Detailed Description

Definition at line 26 of file DDPixFwdRotation.cc.

Constructor & Destructor Documentation

◆ DDPixFwdRotation()

DDPixFwdRotation::DDPixFwdRotation ( )
inline

Definition at line 28 of file DDPixFwdRotation.cc.

28 {}

◆ ~DDPixFwdRotation()

DDPixFwdRotation::~DDPixFwdRotation ( )
overridedefault

Member Function Documentation

◆ execute()

void DDPixFwdRotation::execute ( DDCompactView cpv)
override

Definition at line 86 of file DDPixFwdRotation.cc.

References ancorRadius_, bladeAngle_, bladeZShift_, funct::cos(), DDrot(), SiPixelRawToDigiRegional_cfi::deltaPhi, endcap_, jX_, jY_, jZ_, kX_, kY_, kZ_, nBlades_, rotNameCoverToNipple_, rotNameNippleToBody_, rotNameNippleToCover_, rotNS_, and funct::sin().

86  {
87  // -- Compute Nipple parameters if not already computed :
88  double effBladeAngle = endcap_ * bladeAngle_;
89 
90  CLHEP::Hep3Vector jC = CLHEP::Hep3Vector(jX_ * endcap_, jY_ + ancorRadius_, jZ_);
91  ; // Point J in the "cover" blade frame
92  CLHEP::Hep3Vector kB = CLHEP::Hep3Vector(kX_ * endcap_, kY_ + ancorRadius_, kZ_);
93  ; // PoinladeZShiftladeZShiftladeZShiftt K in the "body" blade frame
94 
95  // Z-shift from "cover" to "body" blade frame:
96  CLHEP::Hep3Vector tCB(bladeZShift_ * sin(effBladeAngle), 0., bladeZShift_ * cos(effBladeAngle));
97 
98  // Rotation from "cover" blade frame into "body" blade frame :
99  double deltaPhi = endcap_ * (360. / nBlades_) * CLHEP::deg;
100  CLHEP::HepRotation rCB(CLHEP::Hep3Vector(1. * sin(effBladeAngle), 0., 1. * cos(effBladeAngle)), deltaPhi);
101 
102  // Transform vector k into "cover" blade frame :
103  CLHEP::Hep3Vector kC = rCB * (kB + tCB);
104 
105  // Vector JK in the "cover" blade frame:
106  CLHEP::Hep3Vector jkC = kC - jC;
107  double jkLength = jkC.mag();
108  DDConstant JK(DDName("JK", rotNS_), std::make_unique<double>(jkLength));
109  edm::LogVerbatim("PixelGeom") << "+++++++++++++++ DDPixFwdRotation: JK Length " << jkLength * CLHEP::mm;
110 
111  // Position of the center of a nipple in "cover" blade frame :
112  CLHEP::Hep3Vector nippleTranslation((kC + jC) / 2. - CLHEP::Hep3Vector(0., ancorRadius_, 0.));
113  edm::LogVerbatim("PixelGeom") << "Child translation : " << nippleTranslation;
114 
115  // Rotations from nipple frame to "cover" blade frame and back :
116  CLHEP::Hep3Vector vZ(0., 0., 1.);
117  CLHEP::Hep3Vector axis = vZ.cross(jkC);
118  double angleCover = vZ.angle(jkC);
119  edm::LogVerbatim("PixelGeom") << " Angle to Cover: " << angleCover;
120  CLHEP::HepRotation rpCN(axis, angleCover);
121 
123  std::make_unique<DDRotationMatrix>(
124  rpCN.xx(), rpCN.xy(), rpCN.xz(), rpCN.yx(), rpCN.yy(), rpCN.yz(), rpCN.zx(), rpCN.zy(), rpCN.zz()));
125  CLHEP::HepRotation rpNC(axis, -angleCover);
126  edm::LogVerbatim("PixelGeom") << "DDPixFwdBlades::Defines " << DDName(rotNameCoverToNipple_, rotNS_) << " with "
127  << rpCN;
128 
130  std::make_unique<DDRotationMatrix>(
131  rpNC.xx(), rpNC.xy(), rpNC.xz(), rpNC.yx(), rpNC.yy(), rpNC.yz(), rpNC.zx(), rpNC.zy(), rpNC.zz()));
132  edm::LogVerbatim("PixelGeom") << "DDPixFwdBlades::Defines " << DDName(rotNameNippleToCover_, rotNS_) << " with "
133  << rpNC;
134 
135  // Rotation from nipple frame to "body" blade frame :
136  CLHEP::HepRotation rpNB(rpNC * rCB);
138  std::make_unique<DDRotationMatrix>(
139  rpNB.xx(), rpNB.xy(), rpNB.xz(), rpNB.yx(), rpNB.yy(), rpNB.yz(), rpNB.zx(), rpNB.zy(), rpNB.zz()));
140  edm::LogVerbatim("PixelGeom") << "DDPixFwdBlades::Defines " << DDName(rotNameNippleToBody_, rotNS_) << " with "
141  << rpNB;
142  edm::LogVerbatim("PixelGeom") << " Angle to body : " << vZ.angle(rpNB * vZ);
143 }
Log< level::Info, true > LogVerbatim
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
DDRotation DDrot(const DDName &name, std::unique_ptr< DDRotationMatrix > rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:67
std::string rotNameCoverToNipple_
std::string rotNameNippleToBody_
a named constant corresponding to the DDL-XML tag <Constant> and <ConstantsVector> ...
Definition: DDConstant.h:18
std::string rotNameNippleToCover_

◆ initialize()

void DDPixFwdRotation::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 54 of file DDPixFwdRotation.cc.

References ancorRadius_, bladeAngle_, bladeZShift_, endcap_, idNameSpace_, jX_, jY_, jZ_, kX_, kY_, kZ_, nBlades_, DDCurrentNamespace::ns(), rotNameCoverToNipple_, rotNameNippleToBody_, rotNameNippleToCover_, and rotNS_.

58  {
59  // -- Input geometry parameters : -----------------------------------------------------
60  endcap_ = nArgs["Endcap"];
61  rotNameNippleToCover_ = sArgs["NippleToCover"];
62  rotNameCoverToNipple_ = sArgs["CoverToNipple"];
63  rotNameNippleToBody_ = sArgs["NippleToBody"];
64  nBlades_ = static_cast<int>(nArgs["Blades"]); // Number of blades
65  bladeAngle_ = nArgs["BladeAngle"]; // Angle of blade rotation around its axis
66  bladeZShift_ = nArgs["BladeZShift"]; // Shift in Z between the axes of two adjacent blades
67  ancorRadius_ = nArgs["AncorRadius"]; // Distance from beam line to ancor point defining center of "blade frame"
68  // Coordinates of Nipple ancor points J and K in "blade frame" :
69  jX_ = nArgs["JX"];
70  jY_ = nArgs["JY"];
71  jZ_ = nArgs["JZ"];
72  kX_ = nArgs["KX"];
73  kY_ = nArgs["KY"];
74  kZ_ = nArgs["KZ"];
75 
76  rotNS_ = sArgs["RotationNS"];
78 
79  edm::LogVerbatim("PixelGeom") << "DDPixFwdRotation: Initialize with endcap " << endcap_ << " NameSpace "
80  << idNameSpace_ << ":" << rotNS_ << "\n nBlades " << nBlades_ << " bladeAngle "
81  << bladeAngle_ << " bladeZShift " << bladeZShift_ << " ancorRadius " << ancorRadius_
82  << " jX|jY|jZ " << jX_ << ":" << jY_ << ":" << jZ_ << " kX|kY|kZ " << kX_ << ":" << kY_
83  << ":" << kZ_;
84 }
Log< level::Info, true > LogVerbatim
std::string idNameSpace_
static std::string & ns()
std::string rotNameCoverToNipple_
std::string rotNameNippleToBody_
std::string rotNameNippleToCover_

Member Data Documentation

◆ ancorRadius_

double DDPixFwdRotation::ancorRadius_
private

Definition at line 47 of file DDPixFwdRotation.cc.

Referenced by execute(), and initialize().

◆ bladeAngle_

double DDPixFwdRotation::bladeAngle_
private

Definition at line 45 of file DDPixFwdRotation.cc.

Referenced by execute(), and initialize().

◆ bladeZShift_

double DDPixFwdRotation::bladeZShift_
private

Definition at line 46 of file DDPixFwdRotation.cc.

Referenced by execute(), and initialize().

◆ endcap_

double DDPixFwdRotation::endcap_
private

Definition at line 40 of file DDPixFwdRotation.cc.

Referenced by execute(), and initialize().

◆ idNameSpace_

std::string DDPixFwdRotation::idNameSpace_
private

Definition at line 51 of file DDPixFwdRotation.cc.

Referenced by initialize().

◆ jX_

double DDPixFwdRotation::jX_
private

Definition at line 48 of file DDPixFwdRotation.cc.

Referenced by execute(), and initialize().

◆ jY_

double DDPixFwdRotation::jY_
private

Definition at line 48 of file DDPixFwdRotation.cc.

Referenced by execute(), and initialize().

◆ jZ_

double DDPixFwdRotation::jZ_
private

Definition at line 48 of file DDPixFwdRotation.cc.

Referenced by execute(), and initialize().

◆ kX_

double DDPixFwdRotation::kX_
private

Definition at line 49 of file DDPixFwdRotation.cc.

Referenced by execute(), and initialize().

◆ kY_

double DDPixFwdRotation::kY_
private

Definition at line 49 of file DDPixFwdRotation.cc.

Referenced by execute(), and initialize().

◆ kZ_

double DDPixFwdRotation::kZ_
private

Definition at line 49 of file DDPixFwdRotation.cc.

Referenced by execute(), and initialize().

◆ nBlades_

int DDPixFwdRotation::nBlades_
private

Definition at line 44 of file DDPixFwdRotation.cc.

Referenced by execute(), and initialize().

◆ rotNameCoverToNipple_

std::string DDPixFwdRotation::rotNameCoverToNipple_
private

Definition at line 42 of file DDPixFwdRotation.cc.

Referenced by execute(), and initialize().

◆ rotNameNippleToBody_

std::string DDPixFwdRotation::rotNameNippleToBody_
private

Definition at line 43 of file DDPixFwdRotation.cc.

Referenced by execute(), and initialize().

◆ rotNameNippleToCover_

std::string DDPixFwdRotation::rotNameNippleToCover_
private

Definition at line 41 of file DDPixFwdRotation.cc.

Referenced by execute(), and initialize().

◆ rotNS_

std::string DDPixFwdRotation::rotNS_
private

Definition at line 50 of file DDPixFwdRotation.cc.

Referenced by execute(), and initialize().