CMS 3D CMS Logo

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

#include <DDPixFwdDiskAlgo.h>

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
 
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 DDPixFwdDiskAlgo.h.

Constructor & Destructor Documentation

DDPixFwdDiskAlgo::DDPixFwdDiskAlgo ( )

Definition at line 16 of file DDPixFwdDiskAlgo.cc.

References LogDebug.

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

Definition at line 20 of file DDPixFwdDiskAlgo.cc.

20 {}

Member Function Documentation

void DDPixFwdDiskAlgo::execute ( DDCompactView cpv)
override

Definition at line 56 of file DDPixFwdDiskAlgo.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.

56  {
57 
58  int copy = startCopyNo;
59  DDName mother = parent().name();
61  std::string flagSelector = "Y";
62 
63  double deltaPhi = (360./nBlades)*CLHEP::deg;
64  std::string rotns = DDSplit(rotName).second;
65  for (int iBlade=0; iBlade<nBlades; ++iBlade) {
66 
67  if (flagString[iBlade] == flagSelector[0]) {
68  std::string rotstr = DDSplit(rotName).first + std::to_string(double(copy));
69 
70  double phi = (iBlade+0.5)*deltaPhi;
71 // double phi = (iBlade+0.5)*deltaPhi - 90.*CLHEP::deg;
72  double phix = std::atan2(std::sin(phi)*std::cos(bladeAngle),
74  double thetx= std::acos(-std::sin(bladeAngle));
75  double phiy = std::atan2((std::cos(phi)*std::cos(bladeTilt)+std::sin(phi)
77  (-std::sin(phi)*std::cos(bladeTilt)+std::cos(phi)
79  double thety= std::acos(std::cos(bladeAngle)*std::sin(bladeTilt));
80  double phiz = std::atan2((-std::cos(phi)*std::sin(bladeTilt)+std::sin(phi)
84  double thetz= std::acos(std::cos(bladeAngle)*std::cos(bladeTilt));
85  DDRotation rot = DDRotation(DDName(rotstr, rotns));
86  if (!rot) {
87  LogDebug("TrackerGeom") << "DDPixFwdDiskAlgo test: Creating a new "
88  << "rotation: " << rotstr << "\t"
89  << thetx/CLHEP::deg << ", " << phix/CLHEP::deg
90  << ", " << thety/CLHEP::deg << ", "
91  << phiy/CLHEP::deg << ", " << thetz/CLHEP::deg
92  << ", " << phiz/CLHEP::deg;
93  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);
94  rot = DDrot(DDName(rotstr, rotns), thetx,phix, thety,phiy, thetz,phiz);
95  }
96  double xpos = anchorR*(-std::sin(phi)*std::cos(bladeTilt)+std::cos(phi)
98  double ypos = anchorR*(std::cos(phi)*std::cos(bladeTilt)+std::sin(phi)
101  bladeZShift[iBlade];
102  DDTranslation tran(xpos, ypos, zpos);
103  cpv.position (child, mother, copy, tran, rot);
104  LogDebug("TrackerGeom") << "DDPixFwdDiskAlgo test: " << child
105  << " number " << copy << " positioned in "
106  << mother << " at " << tran << " with " << rot;
107  }
108  copy++;
109  }
110 }
#define LogDebug(id)
std::string flagString
def copy(args, dbName)
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
std::string childName
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::string rotName
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 DDPixFwdDiskAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 22 of file DDPixFwdDiskAlgo.cc.

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

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

Member Data Documentation

double DDPixFwdDiskAlgo::anchorR
private

Definition at line 35 of file DDPixFwdDiskAlgo.h.

Referenced by execute(), and initialize().

double DDPixFwdDiskAlgo::bladeAngle
private

Definition at line 32 of file DDPixFwdDiskAlgo.h.

Referenced by execute(), and initialize().

double DDPixFwdDiskAlgo::bladeTilt
private

Definition at line 36 of file DDPixFwdDiskAlgo.h.

Referenced by execute(), and initialize().

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

Definition at line 34 of file DDPixFwdDiskAlgo.h.

Referenced by execute(), and initialize().

std::string DDPixFwdDiskAlgo::childName
private

Definition at line 27 of file DDPixFwdDiskAlgo.h.

Referenced by execute(), and initialize().

std::string DDPixFwdDiskAlgo::flagString
private

Definition at line 29 of file DDPixFwdDiskAlgo.h.

Referenced by execute(), and initialize().

std::string DDPixFwdDiskAlgo::idNameSpace
private

Definition at line 26 of file DDPixFwdDiskAlgo.h.

Referenced by initialize().

int DDPixFwdDiskAlgo::nBlades
private

Definition at line 30 of file DDPixFwdDiskAlgo.h.

Referenced by execute(), and initialize().

std::string DDPixFwdDiskAlgo::rotName
private

Definition at line 28 of file DDPixFwdDiskAlgo.h.

Referenced by execute(), and initialize().

int DDPixFwdDiskAlgo::startCopyNo
private

Definition at line 31 of file DDPixFwdDiskAlgo.h.

Referenced by execute(), and initialize().

double DDPixFwdDiskAlgo::zPlane
private

Definition at line 33 of file DDPixFwdDiskAlgo.h.

Referenced by execute(), and initialize().