CMS 3D CMS Logo

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

#include <DDGEMAngular.h>

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 10 of file DDGEMAngular.h.

Constructor & Destructor Documentation

DDGEMAngular::DDGEMAngular ( )

Definition at line 21 of file DDGEMAngular.cc.

21  {
22 #ifdef EDM_ML_DEBUG
23  edm::LogInfo("MuonGeom") << "DDGEMAngular test: Creating an instance";
24 #endif
25 }
DDGEMAngular::~DDGEMAngular ( )
override

Definition at line 27 of file DDGEMAngular.cc.

27 {}

Member Function Documentation

void DDGEMAngular::execute ( DDCompactView cpv)
override

Definition at line 63 of file DDGEMAngular.cc.

References dd::_pi(), CONVERT_TO, funct::cos(), DDrot(), formatAsDegrees(), cuy::ii, TopAnalysis_sequences::invert, gen::n, class-composition::parent, DDCompactView::position(), idealTransformation::rotation, funct::sin(), and AlCaHLTBitMon_QueryRunRegistry::string.

63  {
64 
65  double phi = startAngle;
66  int copyNo = startCopyNo;
67 
68  for (int ii=0; ii<n; ii++) {
69 
70  double phitmp = phi;
71  if (phitmp >= 2._pi) phitmp -= 2._pi;
73  std::string rotstr("RG");
74 
75  if (invert > 0) rotstr += "I";
76  rotstr += formatAsDegrees(phitmp);
77  rotation = DDRotation(DDName(rotstr, rotns));
78  if (!rotation) {
79  double thetax = 90.0_deg;
80  double phix = invert==0 ? (90.0_deg + phitmp) : (-90.0_deg + phitmp);
81  double thetay = invert==0 ? 0.0 : 180.0_deg;
82  double phiz = phitmp;
83 #ifdef EDM_ML_DEBUG
84  edm::LogInfo("MuonGeom") << "DDGEMAngular test: Creating a new rotation "
85  << DDName(rotstr, idNameSpace) << "\t "
86  << CONVERT_TO( thetax, deg ) << ", " << CONVERT_TO( phix, deg ) << ", " << CONVERT_TO( thetay, deg )
87  << ", 0, " << CONVERT_TO( thetax, deg )<< ", " << CONVERT_TO( phiz, deg );
88 #endif
89  rotation = DDrot(DDName(rotstr, rotns), thetax, phix, thetay, 0., thetax, phiz);
90  }
91 
92  DDTranslation tran(rPos*cos(phitmp), rPos*sin(phitmp), zoffset);
93 
94  DDName parentName = parent().name();
95  cpv.position(DDName(childName,idNameSpace), parentName, copyNo, tran, rotation);
96 #ifdef EDM_ML_DEBUG
97  edm::LogInfo("MuonGeom") << "DDGEMAngular test: "
98  << DDName(childName, idNameSpace) << " number "
99  << copyNo << " positioned in " << parentName
100  << " at " << tran << " with " << rotstr << " "
101  << rotation;
102 #endif
103  phi += stepAngle;
104  copyNo += incrCopyNo;
105  }
106 }
std::string childName
Definition: DDGEMAngular.h:37
std::string rotns
Definition: DDGEMAngular.h:35
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
#define CONVERT_TO(_x, _y)
Definition: DDUnits.h:6
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
std::string idNameSpace
Definition: DDGEMAngular.h:36
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:68
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
double stepAngle
Definition: DDGEMAngular.h:27
DDRotation DDrot(const DDName &name, std::unique_ptr< DDRotationMatrix > rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:80
std::string formatAsDegrees(double radianVal)
Definition: DDTypes.cc:75
ii
Definition: cuy.py:590
double zoffset
Definition: DDGEMAngular.h:30
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
constexpr long double _pi(M_PI)
double startAngle
Definition: DDGEMAngular.h:26
void DDGEMAngular::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 29 of file DDGEMAngular.cc.

References CONVERT_TO, createfilelist::int, TopAnalysis_sequences::invert, gen::n, DDCurrentNamespace::ns(), and class-composition::parent.

33  {
34 
35  startAngle = nArgs["startAngle"];
36  stepAngle = nArgs["stepAngle"];
37  invert = int (nArgs["invert"]);
38  rPos = nArgs["rPosition"];
39  zoffset = nArgs["zoffset"];
40  n = int (nArgs["n"]);
41  startCopyNo = int (nArgs["startCopyNo"]);
42  incrCopyNo = int (nArgs["incrCopyNo"]);
43 #ifdef EDM_ML_DEBUG
44  edm::LogInfo("MuonGeom") << "DDGEMAngular debug: Parameters for positioning-- "
45  << n << " copies in steps of " << CONVERT_TO( stepAngle, deg )
46  << " from " << CONVERT_TO( startAngle, deg )
47  << " (inversion flag " << invert << ") \trPos " << rPos
48  << " Zoffest " << zoffset << "\tStart and inremental "
49  << "copy nos " << startCopyNo << ", " << incrCopyNo;
50 #endif
51 
52  rotns = sArgs["RotNameSpace"];
54  childName = sArgs["ChildName"];
55 #ifdef EDM_ML_DEBUG
56  DDName parentName = parent().name();
57  edm::LogInfo("MuonGeom") << "DDGEMAngular debug: Parent " << parentName
58  << "\tChild " << childName << "\tNameSpace "
59  << idNameSpace << "\tRotation Namespace " << rotns;
60 #endif
61 }
std::string childName
Definition: DDGEMAngular.h:37
std::string rotns
Definition: DDGEMAngular.h:35
#define CONVERT_TO(_x, _y)
Definition: DDUnits.h:6
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
static std::string & ns()
std::string idNameSpace
Definition: DDGEMAngular.h:36
double stepAngle
Definition: DDGEMAngular.h:27
double zoffset
Definition: DDGEMAngular.h:30
double startAngle
Definition: DDGEMAngular.h:26

Member Data Documentation

std::string DDGEMAngular::childName
private

Definition at line 37 of file DDGEMAngular.h.

std::string DDGEMAngular::idNameSpace
private

Definition at line 36 of file DDGEMAngular.h.

int DDGEMAngular::incrCopyNo
private

Definition at line 33 of file DDGEMAngular.h.

int DDGEMAngular::invert
private

Definition at line 28 of file DDGEMAngular.h.

int DDGEMAngular::n
private

Definition at line 31 of file DDGEMAngular.h.

std::string DDGEMAngular::rotns
private

Definition at line 35 of file DDGEMAngular.h.

double DDGEMAngular::rPos
private

Definition at line 29 of file DDGEMAngular.h.

double DDGEMAngular::startAngle
private

Definition at line 26 of file DDGEMAngular.h.

int DDGEMAngular::startCopyNo
private

Definition at line 32 of file DDGEMAngular.h.

double DDGEMAngular::stepAngle
private

Definition at line 27 of file DDGEMAngular.h.

double DDGEMAngular::zoffset
private

Definition at line 30 of file DDGEMAngular.h.