CMS 3D CMS Logo

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

Public Member Functions

 DDPixFwdDiskAlgo ()
 
void execute (DDCompactView &cpv) override
 
void initialize (const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
 
 ~DDPixFwdDiskAlgo () 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 23 of file DDPixFwdDiskAlgo.cc.

Constructor & Destructor Documentation

◆ DDPixFwdDiskAlgo()

DDPixFwdDiskAlgo::DDPixFwdDiskAlgo ( )

Definition at line 51 of file DDPixFwdDiskAlgo.cc.

References LogDebug.

51 { LogDebug("TrackerGeom") << "DDPixFwdDiskAlgo info: Creating an instance"; }
#define LogDebug(id)

◆ ~DDPixFwdDiskAlgo()

DDPixFwdDiskAlgo::~DDPixFwdDiskAlgo ( )
override

Definition at line 53 of file DDPixFwdDiskAlgo.cc.

53 {}

Member Function Documentation

◆ execute()

void DDPixFwdDiskAlgo::execute ( DDCompactView cpv)
override

Definition at line 84 of file DDPixFwdDiskAlgo.cc.

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

84  {
85  int copy = startCopyNo;
86  DDName mother = parent().name();
88  string flagSelector = "Y";
89 
90  double deltaPhi = (360. / nBlades) * CLHEP::deg;
91  string rotns = DDSplit(rotName).second;
92  for (int iBlade = 0; iBlade < nBlades; ++iBlade) {
93  if (flagString[iBlade] == flagSelector[0]) {
94  string rotstr = DDSplit(rotName).first + to_string(double(copy));
95 
96  double phi = (iBlade + 0.5) * deltaPhi;
97  // double phi = (iBlade+0.5)*deltaPhi - 90.*CLHEP::deg;
98  double phix = atan2(sin(phi) * cos(bladeAngle), cos(phi) * cos(bladeAngle));
99  double thetx = acos(-sin(bladeAngle));
100  double phiy = atan2((cos(phi) * cos(bladeTilt) + sin(phi) * sin(bladeAngle) * sin(bladeTilt)),
101  (-sin(phi) * cos(bladeTilt) + cos(phi) * sin(bladeAngle) * sin(bladeTilt)));
102  double thety = acos(cos(bladeAngle) * sin(bladeTilt));
103  double phiz = atan2((-cos(phi) * sin(bladeTilt) + sin(phi) * sin(bladeAngle) * cos(bladeTilt)),
104  (sin(phi) * sin(bladeTilt) + cos(phi) * sin(bladeAngle) * cos(bladeTilt)));
105  double thetz = acos(cos(bladeAngle) * cos(bladeTilt));
106  DDRotation rot = DDRotation(DDName(rotstr, rotns));
107  if (!rot) {
108  LogDebug("TrackerGeom") << "DDPixFwdDiskAlgo test: Creating a new "
109  << "rotation: " << rotstr << "\t" << thetx / CLHEP::deg << ", " << phix / CLHEP::deg
110  << ", " << thety / CLHEP::deg << ", " << phiy / CLHEP::deg << ", " << thetz / CLHEP::deg
111  << ", " << phiz / CLHEP::deg;
112  LogDebug("TrackerGeom") << "Rotation Matrix (" << phi / CLHEP::deg << ", " << bladeAngle / CLHEP::deg << ", "
113  << bladeTilt / CLHEP::deg << ") " << cos(phi) * cos(bladeAngle) << ", "
114  << (-sin(phi) * cos(bladeTilt) + cos(phi) * sin(bladeAngle) * sin(bladeTilt)) << ", "
115  << (sin(phi) * sin(bladeTilt) + cos(phi) * sin(bladeAngle) * cos(bladeTilt)) << ", "
116  << sin(phi) * cos(bladeAngle) << ", "
117  << (cos(phi) * cos(bladeTilt) + sin(phi) * sin(bladeAngle) * sin(bladeTilt)) << ", "
118  << (-cos(phi) * sin(bladeTilt) + sin(phi) * sin(bladeAngle) * cos(bladeTilt)) << ", "
119  << -sin(bladeAngle) << ", " << cos(bladeAngle) * sin(bladeTilt) << ", "
120  << cos(bladeAngle) * cos(bladeTilt);
121  rot = DDrot(DDName(rotstr, rotns), thetx, phix, thety, phiy, thetz, phiz);
122  }
123  double xpos = anchorR * (-sin(phi) * cos(bladeTilt) + cos(phi) * sin(bladeAngle) * sin(bladeTilt));
124  double ypos = anchorR * (cos(phi) * cos(bladeTilt) + sin(phi) * sin(bladeAngle) * sin(bladeTilt));
125  double zpos = anchorR * (cos(bladeAngle) * sin(bladeTilt)) + zPlane + bladeZShift[iBlade];
126  DDTranslation tran(xpos, ypos, zpos);
127  cpv.position(child, mother, copy, tran, rot);
128  LogDebug("TrackerGeom") << "DDPixFwdDiskAlgo test: " << child << " number " << copy << " positioned in " << mother
129  << " at " << tran << " with " << rot;
130  }
131  copy++;
132  }
133 }
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
static std::string to_string(const XMLCh *ch)
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
vector< double > bladeZShift
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 DDPixFwdDiskAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 55 of file DDPixFwdDiskAlgo.cc.

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

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

Member Data Documentation

◆ anchorR

double DDPixFwdDiskAlgo::anchorR
private

Definition at line 47 of file DDPixFwdDiskAlgo.cc.

◆ bladeAngle

double DDPixFwdDiskAlgo::bladeAngle
private

Definition at line 44 of file DDPixFwdDiskAlgo.cc.

◆ bladeTilt

double DDPixFwdDiskAlgo::bladeTilt
private

Definition at line 48 of file DDPixFwdDiskAlgo.cc.

◆ bladeZShift

vector<double> DDPixFwdDiskAlgo::bladeZShift
private

Definition at line 46 of file DDPixFwdDiskAlgo.cc.

◆ childName

string DDPixFwdDiskAlgo::childName
private

Definition at line 39 of file DDPixFwdDiskAlgo.cc.

◆ flagString

string DDPixFwdDiskAlgo::flagString
private

Definition at line 41 of file DDPixFwdDiskAlgo.cc.

◆ idNameSpace

string DDPixFwdDiskAlgo::idNameSpace
private

Definition at line 38 of file DDPixFwdDiskAlgo.cc.

◆ nBlades

int DDPixFwdDiskAlgo::nBlades
private

Definition at line 42 of file DDPixFwdDiskAlgo.cc.

◆ rotName

string DDPixFwdDiskAlgo::rotName
private

Definition at line 40 of file DDPixFwdDiskAlgo.cc.

◆ startCopyNo

int DDPixFwdDiskAlgo::startCopyNo
private

Definition at line 43 of file DDPixFwdDiskAlgo.cc.

◆ zPlane

double DDPixFwdDiskAlgo::zPlane
private

Definition at line 45 of file DDPixFwdDiskAlgo.cc.