CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DDPixPhase1FwdDiskAlgo Class Reference
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
 
vector< double > bladeZShift
 
string childName
 
string flagString
 
string idNameSpace
 
int nBlades
 
string rotName
 
int startCopyNo
 
double zPlane
 

Detailed Description

Definition at line 24 of file DDPixPhase1FwdDiskAlgo.cc.

Constructor & Destructor Documentation

◆ DDPixPhase1FwdDiskAlgo()

DDPixPhase1FwdDiskAlgo::DDPixPhase1FwdDiskAlgo ( )

Definition at line 52 of file DDPixPhase1FwdDiskAlgo.cc.

References LogDebug.

52  {
53  LogDebug("TrackerGeom") << "DDPixPhase1FwdDiskAlgo info: Creating an instance";
54 }
#define LogDebug(id)

◆ ~DDPixPhase1FwdDiskAlgo()

DDPixPhase1FwdDiskAlgo::~DDPixPhase1FwdDiskAlgo ( )
override

Definition at line 56 of file DDPixPhase1FwdDiskAlgo.cc.

56 {}

Member Function Documentation

◆ execute()

void DDPixPhase1FwdDiskAlgo::execute ( DDCompactView cpv)
override

Definition at line 87 of file DDPixPhase1FwdDiskAlgo.cc.

References submitPVValidationJobs::child, filterCSVwithJSON::copy, funct::cos(), DDrot(), DDSplit(), SiPixelRawToDigiRegional_cfi::deltaPhi, dqmdumpme::first, LogDebug, class-composition::parent, DDCompactView::position(), makeMuonMisalignmentScenario::rot, cms::rotation_utils::rotName(), edm::second(), funct::sin(), and cond::impl::to_string().

87  {
88  int copy = startCopyNo;
89  DDName mother = parent().name();
91  string flagSelector = "Y";
92 
93  double deltaPhi = (360. / nBlades) * CLHEP::deg;
94  string rotns = DDSplit(rotName).second;
95  for (int iBlade = 0; iBlade < nBlades; ++iBlade) {
96  if (flagString[iBlade] == flagSelector[0]) {
97  string rotstr = DDSplit(rotName).first + to_string(double(copy));
98 
99  double phi = (iBlade + 0.5) * deltaPhi;
100  double phiy = atan2(cos(phi), -sin(phi));
101  double thety = acos(sin(bladeTilt));
102  double phix = atan2(cos(bladeAngle) * sin(phi) + cos(phi) * sin(bladeTilt) * sin(bladeAngle),
104  double thetx = acos(-cos(bladeTilt) * sin(bladeAngle));
105  double phiz = atan2(sin(phi) * sin(bladeAngle) - cos(phi) * cos(bladeAngle) * sin(bladeTilt),
107  double thetz = acos(cos(bladeTilt) * cos(bladeAngle));
108  DDRotation rot = DDRotation(DDName(rotstr, rotns));
109  if (!rot) {
110  LogDebug("TrackerGeom") << "DDPixPhase1FwdDiskAlgo test: Creating a new "
111  << "rotation: " << rotstr << "\t" << thetx / CLHEP::deg << ", " << phix / CLHEP::deg
112  << ", " << thety / CLHEP::deg << ", " << phiy / CLHEP::deg << ", " << thetz / CLHEP::deg
113  << ", " << phiz / CLHEP::deg;
114  LogDebug("TrackerGeom") << "Rotation Matrix (" << phi / CLHEP::deg << ", " << bladeAngle / CLHEP::deg << ", "
115  << bladeTilt / CLHEP::deg << ") " << cos(phi) * cos(bladeAngle) << ", "
116  << (-sin(phi) * cos(bladeTilt) + cos(phi) * sin(bladeAngle) * sin(bladeTilt)) << ", "
117  << (sin(phi) * sin(bladeTilt) + cos(phi) * sin(bladeAngle) * cos(bladeTilt)) << ", "
118  << sin(phi) * cos(bladeAngle) << ", "
119  << (cos(phi) * cos(bladeTilt) + sin(phi) * sin(bladeAngle) * sin(bladeTilt)) << ", "
120  << (-cos(phi) * sin(bladeTilt) + sin(phi) * sin(bladeAngle) * cos(bladeTilt)) << ", "
121  << -sin(bladeAngle) << ", " << cos(bladeAngle) * sin(bladeTilt) << ", "
122  << cos(bladeAngle) * cos(bladeTilt);
123  rot = DDrot(DDName(rotstr, rotns), thetx, phix, thety, phiy, thetz, phiz);
124  }
125  double xpos = -anchorR * sin(phi);
126  double ypos = anchorR * cos(phi);
127  double zpos = zPlane + bladeZShift[iBlade % nBlades];
128  DDTranslation tran(xpos, ypos, zpos);
129  cpv.position(child, mother, copy, tran, rot);
130  LogDebug("TrackerGeom") << "DDPixPhase1FwdDiskAlgo test: " << child << " number " << copy << " positioned in "
131  << mother << " at " << tran << " with " << rot;
132  }
133  copy++;
134  }
135 }
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
std::string to_string(const V &value)
Definition: OMSAccess.h:77
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
U second(std::pair< T, U > const &p)
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::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:3
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
#define LogDebug(id)

◆ initialize()

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

Definition at line 58 of file DDPixPhase1FwdDiskAlgo.cc.

References createfilelist::int, LogDebug, DDCurrentNamespace::ns(), class-composition::parent, and cms::rotation_utils::rotName().

62  {
63  startCopyNo = int(nArgs["StartCopyNo"]);
64  nBlades = int(nArgs["NumberOfBlades"]);
65  bladeAngle = nArgs["BladeAngle"];
66  bladeTilt = -nArgs["BladeTilt"];
67  zPlane = nArgs["BladeCommonZ"];
68  bladeZShift = vArgs["BladeZShift"];
69  anchorR = nArgs["AnchorRadius"];
70 
72  childName = sArgs["ChildName"];
73  rotName = sArgs["RotationName"];
74  flagString = sArgs["FlagString"];
75  DDName parentName = parent().name();
76  LogDebug("TrackerGeom") << "DDPixPhase1FwdDiskAlgo debug: Parent " << parentName << "\tChild " << childName
77  << " NameSpace " << idNameSpace << "\tRot Name " << rotName << "\tCopyNo (Start/Total) "
78  << startCopyNo << ", " << nBlades << "\tAngles " << bladeAngle / CLHEP::deg << ", "
79  << bladeTilt / CLHEP::deg << "\tZshifts " << zPlane << "\tAmnchor Radius " << anchorR;
80 
81  for (int iBlade = 0; iBlade < nBlades; ++iBlade) {
82  LogDebug("TrackerGeom") << "DDPixPhase1FwdDiskAlgo: Blade " << iBlade << " flag " << flagString[iBlade]
83  << " zshift " << bladeZShift[iBlade];
84  }
85 }
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
static std::string & ns()
#define LogDebug(id)

Member Data Documentation

◆ anchorR

double DDPixPhase1FwdDiskAlgo::anchorR
private

Definition at line 48 of file DDPixPhase1FwdDiskAlgo.cc.

◆ bladeAngle

double DDPixPhase1FwdDiskAlgo::bladeAngle
private

Definition at line 45 of file DDPixPhase1FwdDiskAlgo.cc.

◆ bladeTilt

double DDPixPhase1FwdDiskAlgo::bladeTilt
private

Definition at line 49 of file DDPixPhase1FwdDiskAlgo.cc.

◆ bladeZShift

vector<double> DDPixPhase1FwdDiskAlgo::bladeZShift
private

Definition at line 47 of file DDPixPhase1FwdDiskAlgo.cc.

◆ childName

string DDPixPhase1FwdDiskAlgo::childName
private

Definition at line 40 of file DDPixPhase1FwdDiskAlgo.cc.

◆ flagString

string DDPixPhase1FwdDiskAlgo::flagString
private

Definition at line 42 of file DDPixPhase1FwdDiskAlgo.cc.

◆ idNameSpace

string DDPixPhase1FwdDiskAlgo::idNameSpace
private

Definition at line 39 of file DDPixPhase1FwdDiskAlgo.cc.

◆ nBlades

int DDPixPhase1FwdDiskAlgo::nBlades
private

Definition at line 43 of file DDPixPhase1FwdDiskAlgo.cc.

◆ rotName

string DDPixPhase1FwdDiskAlgo::rotName
private

Definition at line 41 of file DDPixPhase1FwdDiskAlgo.cc.

◆ startCopyNo

int DDPixPhase1FwdDiskAlgo::startCopyNo
private

Definition at line 44 of file DDPixPhase1FwdDiskAlgo.cc.

◆ zPlane

double DDPixPhase1FwdDiskAlgo::zPlane
private

Definition at line 46 of file DDPixPhase1FwdDiskAlgo.cc.