CMS 3D CMS Logo

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

Public Member Functions

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

Private Attributes

std::string childName
 
std::string idNameSpace
 
int incrCopyNo
 
int invert
 
int n
 
std::string rotns
 
double rPos
 
double startAngle
 
int startCopyNo
 
double stepAngle
 
double zoffset
 

Detailed Description

Definition at line 25 of file DDGEMAngular.cc.

Constructor & Destructor Documentation

◆ DDGEMAngular()

DDGEMAngular::DDGEMAngular ( )

Definition at line 54 of file DDGEMAngular.cc.

54  {
55 #ifdef EDM_ML_DEBUG
56  edm::LogVerbatim("MuonGeom") << "DDGEMAngular: Creating an instance";
57 #endif
58 }
Log< level::Info, true > LogVerbatim

◆ ~DDGEMAngular()

DDGEMAngular::~DDGEMAngular ( )
override

Definition at line 60 of file DDGEMAngular.cc.

60 {}

Member Function Documentation

◆ execute()

void DDGEMAngular::execute ( DDCompactView cpv)
override

Definition at line 92 of file DDGEMAngular.cc.

References angle_units::operators::convertRadToDeg(), funct::cos(), DDrot(), formatAsDegrees(), cuy::ii, l1tstage2_dqm_sourceclient-live_cfg::invert, dqmiodumpmetadata::n, class-composition::parent, DDCompactView::position(), idealTransformation::rotation, funct::sin(), and AlCaHLTBitMon_QueryRunRegistry::string.

92  {
93  double phi = startAngle;
94  int copyNo = startCopyNo;
95 
96  for (int ii = 0; ii < n; ii++) {
97  double phitmp = phi;
98  if (phitmp >= 2._pi)
99  phitmp -= 2._pi;
101  std::string rotstr("RG");
102 
103  if (invert > 0)
104  rotstr += "I";
105  rotstr += formatAsDegrees(phitmp);
106  rotation = DDRotation(DDName(rotstr, rotns));
107  if (!rotation) {
108  double thetax = 90.0_deg;
109  double phix = invert == 0 ? (90.0_deg + phitmp) : (-90.0_deg + phitmp);
110  double thetay = invert == 0 ? 0.0 : 180.0_deg;
111  double phiz = phitmp;
112 #ifdef EDM_ML_DEBUG
113  edm::LogVerbatim("MuonGeom") << "DDGEMAngular: Creating a new rotation " << DDName(rotstr, idNameSpace) << "\t "
114  << convertRadToDeg(thetax) << ", " << convertRadToDeg(phix) << ", "
115  << convertRadToDeg(thetay) << ", 0, " << convertRadToDeg(thetax) << ", "
116  << convertRadToDeg(phiz);
117 #endif
118  rotation = DDrot(DDName(rotstr, rotns), thetax, phix, thetay, 0., thetax, phiz);
119  }
120 
121  DDTranslation tran(rPos * cos(phitmp), rPos * sin(phitmp), zoffset);
122 
123  DDName parentName = parent().name();
124  cpv.position(DDName(childName, idNameSpace), parentName, copyNo, tran, rotation);
125 #ifdef EDM_ML_DEBUG
126  edm::LogVerbatim("MuonGeom") << "DDGEMAngular: " << DDName(childName, idNameSpace) << " number " << copyNo
127  << " positioned in " << parentName << " at " << tran << " with " << rotstr << " "
128  << rotation;
129 #endif
130  phi += stepAngle;
131  copyNo += incrCopyNo;
132  }
133 }
Log< level::Info, true > LogVerbatim
std::string childName
Definition: DDGEMAngular.cc:51
std::string rotns
Definition: DDGEMAngular.cc:49
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
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 idNameSpace
Definition: DDGEMAngular.cc:50
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
double stepAngle
Definition: DDGEMAngular.cc:41
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 formatAsDegrees(double radianVal)
Definition: DDTypes.cc:68
ii
Definition: cuy.py:589
double zoffset
Definition: DDGEMAngular.cc:44
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
double startAngle
Definition: DDGEMAngular.cc:40

◆ initialize()

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

Definition at line 62 of file DDGEMAngular.cc.

References angle_units::operators::convertRadToDeg(), createfilelist::int, l1tstage2_dqm_sourceclient-live_cfg::invert, dqmiodumpmetadata::n, DDCurrentNamespace::ns(), and class-composition::parent.

66  {
67  startAngle = nArgs["startAngle"];
68  stepAngle = nArgs["stepAngle"];
69  invert = int(nArgs["invert"]);
70  rPos = nArgs["rPosition"];
71  zoffset = nArgs["zoffset"];
72  n = int(nArgs["n"]);
73  startCopyNo = int(nArgs["startCopyNo"]);
74  incrCopyNo = int(nArgs["incrCopyNo"]);
75 #ifdef EDM_ML_DEBUG
76  edm::LogVerbatim("MuonGeom") << "DDGEMAngular: Parameters for positioning-- " << n << " copies in steps of "
78  << " (inversion flag " << invert << ") \trPos " << rPos << " Zoffest " << zoffset
79  << "\tStart and inremental "
80  << "copy nos " << startCopyNo << ", " << incrCopyNo;
81 #endif
82 
83  rotns = sArgs["RotNameSpace"];
85  childName = sArgs["ChildName"];
86 #ifdef EDM_ML_DEBUG
87  edm::LogVerbatim("MuonGeom") << "DDGEMAngular: Parent " << parent().name() << "\tChild " << childName
88  << "\tNameSpace " << idNameSpace << "\tRotation Namespace " << rotns;
89 #endif
90 }
Log< level::Info, true > LogVerbatim
std::string childName
Definition: DDGEMAngular.cc:51
std::string rotns
Definition: DDGEMAngular.cc:49
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
static std::string & ns()
std::string idNameSpace
Definition: DDGEMAngular.cc:50
double stepAngle
Definition: DDGEMAngular.cc:41
double zoffset
Definition: DDGEMAngular.cc:44
double startAngle
Definition: DDGEMAngular.cc:40

Member Data Documentation

◆ childName

std::string DDGEMAngular::childName
private

Definition at line 51 of file DDGEMAngular.cc.

◆ idNameSpace

std::string DDGEMAngular::idNameSpace
private

Definition at line 50 of file DDGEMAngular.cc.

◆ incrCopyNo

int DDGEMAngular::incrCopyNo
private

Definition at line 47 of file DDGEMAngular.cc.

◆ invert

int DDGEMAngular::invert
private

Definition at line 42 of file DDGEMAngular.cc.

◆ n

int DDGEMAngular::n
private

Definition at line 45 of file DDGEMAngular.cc.

Referenced by output.OutputBranch::fill().

◆ rotns

std::string DDGEMAngular::rotns
private

Definition at line 49 of file DDGEMAngular.cc.

◆ rPos

double DDGEMAngular::rPos
private

Definition at line 43 of file DDGEMAngular.cc.

◆ startAngle

double DDGEMAngular::startAngle
private

Definition at line 40 of file DDGEMAngular.cc.

◆ startCopyNo

int DDGEMAngular::startCopyNo
private

Definition at line 46 of file DDGEMAngular.cc.

◆ stepAngle

double DDGEMAngular::stepAngle
private

Definition at line 41 of file DDGEMAngular.cc.

◆ zoffset

double DDGEMAngular::zoffset
private

Definition at line 44 of file DDGEMAngular.cc.