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 20 of file DDGEMAngular.cc.

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

Definition at line 26 of file DDGEMAngular.cc.

26 {}

Member Function Documentation

void DDGEMAngular::execute ( DDCompactView cpv)
override

Definition at line 62 of file DDGEMAngular.cc.

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

62  {
63 
64  double phi = startAngle;
65  int copyNo = startCopyNo;
66 
67  for (int ii=0; ii<n; ii++) {
68 
69  double phitmp = phi;
70  if (phitmp >= 2._pi) phitmp -= 2._pi;
72  std::string rotstr("RG");
73 
74  if (invert > 0) rotstr += "I";
75  rotstr += formatAsDegrees(phitmp);
76  rotation = DDRotation(DDName(rotstr, rotns));
77  if (!rotation) {
78  double thetax = 90.0_deg;
79  double phix = invert==0 ? (90.0_deg + phitmp) : (-90.0_deg + phitmp);
80  double thetay = invert==0 ? 0.0 : 180.0_deg;
81  double phiz = phitmp;
82 #ifdef EDM_ML_DEBUG
83  edm::LogVerbatim("MuonGeom")
84  << "DDGEMAngular: Creating a new rotation "
85  << DDName(rotstr, idNameSpace) << "\t "
86  << convertRadToDeg( thetax ) << ", " << convertRadToDeg( phix ) <<", "
87  << convertRadToDeg( thetay ) << ", 0, " << convertRadToDeg( thetax )
88  << ", " << convertRadToDeg( phiz );
89 #endif
90  rotation = DDrot(DDName(rotstr, rotns), thetax, phix, thetay, 0., thetax, phiz);
91  }
92 
93  DDTranslation tran(rPos*cos(phitmp), rPos*sin(phitmp), zoffset);
94 
95  DDName parentName = parent().name();
96  cpv.position(DDName(childName,idNameSpace), parentName, copyNo, tran, rotation);
97 #ifdef EDM_ML_DEBUG
98  edm::LogVerbatim("MuonGeom")
99  << "DDGEMAngular: " << DDName(childName, idNameSpace) << " number "
100  << copyNo << " positioned in " << parentName
101  << " at " << tran << " with " << rotstr << " " << 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
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
constexpr NumType convertRadToDeg(NumType radians)
Definition: GeantUnits.h:98
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)
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 28 of file DDGEMAngular.cc.

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

32  {
33 
34  startAngle = nArgs["startAngle"];
35  stepAngle = nArgs["stepAngle"];
36  invert = int (nArgs["invert"]);
37  rPos = nArgs["rPosition"];
38  zoffset = nArgs["zoffset"];
39  n = int (nArgs["n"]);
40  startCopyNo = int (nArgs["startCopyNo"]);
41  incrCopyNo = int (nArgs["incrCopyNo"]);
42 #ifdef EDM_ML_DEBUG
43  edm::LogVerbatim("MuonGeom")
44  << "DDGEMAngular: Parameters for positioning-- " << n
45  << " copies in steps of " << convertRadToDeg( stepAngle )
46  << " from " << convertRadToDeg( startAngle )
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  edm::LogVerbatim("MuonGeom")
57  << "DDGEMAngular: Parent " << parent().name() << "\tChild " << childName
58  << "\tNameSpace " << idNameSpace << "\tRotation Namespace " << rotns;
59 #endif
60 }
std::string childName
Definition: DDGEMAngular.h:37
std::string rotns
Definition: DDGEMAngular.h:35
constexpr NumType convertRadToDeg(NumType radians)
Definition: GeantUnits.h:98
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.