CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DDPixPhase1FwdDiskAlgo Class Reference

#include <DDPixPhase1FwdDiskAlgo.h>

Inheritance diagram for DDPixPhase1FwdDiskAlgo:

Public Member Functions

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

Private Attributes

double anchorR
 
double bladeAngle
 
double bladeTilt
 
std::vector< double > bladeZShift
 
std::string childName
 
std::string flagString
 
std::string idNameSpace
 
int nBlades
 
std::string rotName
 
int startCopyNo
 
double zPlane
 

Detailed Description

Definition at line 10 of file DDPixPhase1FwdDiskAlgo.h.

Constructor & Destructor Documentation

DDPixPhase1FwdDiskAlgo::DDPixPhase1FwdDiskAlgo ( )

Definition at line 17 of file DDPixPhase1FwdDiskAlgo.cc.

References LogDebug.

17  {
18  LogDebug("TrackerGeom") <<"DDPixPhase1FwdDiskAlgo info: Creating an instance";
19 }
#define LogDebug(id)
DDPixPhase1FwdDiskAlgo::~DDPixPhase1FwdDiskAlgo ( )
override

Definition at line 21 of file DDPixPhase1FwdDiskAlgo.cc.

21 {}

Member Function Documentation

void DDPixPhase1FwdDiskAlgo::execute ( DDCompactView cpv)
override

Definition at line 57 of file DDPixPhase1FwdDiskAlgo.cc.

References anchorR, bladeAngle, bladeTilt, bladeZShift, class-composition::child, childName, popcon2dropbox::copy(), funct::cos(), DDrot(), DDSplit(), hiPixelPairStep_cff::deltaPhi, plotBeamSpotDB::first, flagString, LogDebug, nBlades, class-composition::parent, phi, DDCompactView::position(), makeMuonMisalignmentScenario::rot, rotName, edm::second(), funct::sin(), startCopyNo, AlCaHLTBitMon_QueryRunRegistry::string, and zPlane.

57  {
58 
59  int copy = startCopyNo;
60  DDName mother = parent().name();
62  std::string flagSelector = "Y";
63 
64  double deltaPhi = (360./nBlades)*CLHEP::deg;
65  std::string rotns = DDSplit(rotName).second;
66  for (int iBlade=0; iBlade<nBlades; ++iBlade) {
67 
68  if (flagString[iBlade] == flagSelector[0]) {
69  std::string rotstr = DDSplit(rotName).first + std::to_string(double(copy));
70 
71  double phi = (iBlade+0.5)*deltaPhi;
72  double phiy = std::atan2(std::cos(phi), -std::sin(phi));
73  double thety = std::acos(std::sin(bladeTilt));
74  double phix = std::atan2(std::cos(bladeAngle)*std::sin(phi) +
78  double thetx = std::acos(-std::cos(bladeTilt) * std::sin(bladeAngle));
79  double phiz = std::atan2(std::sin(phi)*std::sin(bladeAngle) -
83  double thetz = std::acos(std::cos(bladeTilt) * std::cos(bladeAngle));
84  DDRotation rot = DDRotation(DDName(rotstr, rotns));
85  if (!rot) {
86  LogDebug("TrackerGeom") << "DDPixPhase1FwdDiskAlgo test: Creating a new "
87  << "rotation: " << rotstr << "\t"
88  << thetx/CLHEP::deg << ", " << phix/CLHEP::deg
89  << ", " << thety/CLHEP::deg << ", "
90  << phiy/CLHEP::deg << ", " << thetz/CLHEP::deg
91  << ", " << phiz/CLHEP::deg;
92  LogDebug("TrackerGeom") << "Rotation Matrix (" << phi/CLHEP::deg << ", " << bladeAngle/CLHEP::deg << ", " << bladeTilt/CLHEP::deg << ") " << std::cos(phi)*std::cos(bladeAngle) << ", " << (-std::sin(phi)*std::cos(bladeTilt)+std::cos(phi)*std::sin(bladeAngle)*std::sin(bladeTilt)) << ", " << (std::sin(phi)*std::sin(bladeTilt)+std::cos(phi)*std::sin(bladeAngle)*std::cos(bladeTilt)) << ", " << std::sin(phi)*std::cos(bladeAngle) << ", " << (std::cos(phi)*std::cos(bladeTilt)+std::sin(phi)*std::sin(bladeAngle)*std::sin(bladeTilt)) << ", " << (-std::cos(phi)*std::sin(bladeTilt)+std::sin(phi)*std::sin(bladeAngle)*std::cos(bladeTilt)) << ", " << -std::sin(bladeAngle) << ", " << std::cos(bladeAngle)*std::sin(bladeTilt) << ", " << std::cos(bladeAngle)*std::cos(bladeTilt);
93  rot = DDrot(DDName(rotstr, rotns), thetx,phix, thety,phiy, thetz,phiz);
94  }
95  double xpos = -anchorR * std::sin(phi);
96  double ypos = anchorR * std::cos(phi);
97  double zpos = zPlane + bladeZShift[iBlade % nBlades];
98  DDTranslation tran(xpos, ypos, zpos);
99  cpv.position (child, mother, copy, tran, rot);
100  LogDebug("TrackerGeom") << "DDPixPhase1FwdDiskAlgo test: " << child
101  << " number " << copy << " positioned in "
102  << mother << " at " << tran << " with " << rot;
103  }
104  copy++;
105  }
106 }
#define LogDebug(id)
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:67
U second(std::pair< T, U > const &p)
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
DDRotation DDrot(const DDName &name, DDRotationMatrix *rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:90
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:3
std::vector< double > bladeZShift
void DDPixPhase1FwdDiskAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 23 of file DDPixPhase1FwdDiskAlgo.cc.

References anchorR, bladeAngle, bladeTilt, bladeZShift, childName, flagString, idNameSpace, createfilelist::int, LogDebug, nBlades, DDCurrentNamespace::ns(), class-composition::parent, rotName, startCopyNo, and zPlane.

27  {
28 
29  startCopyNo = int(nArgs["StartCopyNo"]);
30  nBlades = int(nArgs["NumberOfBlades"]);
31  bladeAngle = nArgs["BladeAngle"];
32  bladeTilt = -nArgs["BladeTilt"];
33  zPlane = nArgs["BladeCommonZ"];
34  bladeZShift = vArgs["BladeZShift"];
35  anchorR = nArgs["AnchorRadius"];
36 
38  childName = sArgs["ChildName"];
39  rotName = sArgs["RotationName"];
40  flagString = sArgs["FlagString"];
41  DDName parentName = parent().name();
42  LogDebug("TrackerGeom") << "DDPixPhase1FwdDiskAlgo debug: Parent " << parentName
43  << "\tChild " << childName << " NameSpace "
44  << idNameSpace << "\tRot Name " << rotName
45  << "\tCopyNo (Start/Total) " << startCopyNo << ", "
46  << nBlades << "\tAngles " << bladeAngle/CLHEP::deg
47  << ", " << bladeTilt/CLHEP::deg << "\tZshifts "
48  << zPlane << "\tAmnchor Radius " << anchorR;
49 
50  for (int iBlade=0; iBlade<nBlades; ++iBlade) {
51  LogDebug("TrackerGeom") << "DDPixPhase1FwdDiskAlgo: Blade " << iBlade
52  << " flag " << flagString[iBlade] << " zshift "
53  << bladeZShift[iBlade];
54  }
55 }
#define LogDebug(id)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
static std::string & ns()
std::vector< double > bladeZShift

Member Data Documentation

double DDPixPhase1FwdDiskAlgo::anchorR
private

Definition at line 35 of file DDPixPhase1FwdDiskAlgo.h.

Referenced by execute(), and initialize().

double DDPixPhase1FwdDiskAlgo::bladeAngle
private

Definition at line 32 of file DDPixPhase1FwdDiskAlgo.h.

Referenced by execute(), and initialize().

double DDPixPhase1FwdDiskAlgo::bladeTilt
private

Definition at line 36 of file DDPixPhase1FwdDiskAlgo.h.

Referenced by execute(), and initialize().

std::vector<double> DDPixPhase1FwdDiskAlgo::bladeZShift
private

Definition at line 34 of file DDPixPhase1FwdDiskAlgo.h.

Referenced by execute(), and initialize().

std::string DDPixPhase1FwdDiskAlgo::childName
private

Definition at line 27 of file DDPixPhase1FwdDiskAlgo.h.

Referenced by execute(), and initialize().

std::string DDPixPhase1FwdDiskAlgo::flagString
private

Definition at line 29 of file DDPixPhase1FwdDiskAlgo.h.

Referenced by execute(), and initialize().

std::string DDPixPhase1FwdDiskAlgo::idNameSpace
private

Definition at line 26 of file DDPixPhase1FwdDiskAlgo.h.

Referenced by initialize().

int DDPixPhase1FwdDiskAlgo::nBlades
private

Definition at line 30 of file DDPixPhase1FwdDiskAlgo.h.

Referenced by execute(), and initialize().

std::string DDPixPhase1FwdDiskAlgo::rotName
private

Definition at line 28 of file DDPixPhase1FwdDiskAlgo.h.

Referenced by execute(), and initialize().

int DDPixPhase1FwdDiskAlgo::startCopyNo
private

Definition at line 31 of file DDPixPhase1FwdDiskAlgo.h.

Referenced by execute(), and initialize().

double DDPixPhase1FwdDiskAlgo::zPlane
private

Definition at line 33 of file DDPixPhase1FwdDiskAlgo.h.

Referenced by execute(), and initialize().