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

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

Definition at line 24 of file DDGEMAngular.cc.

24 {}

Member Function Documentation

void DDGEMAngular::execute ( DDCompactView cpv)
override

Definition at line 60 of file DDGEMAngular.cc.

References childName, funct::cos(), DDrot(), idNameSpace, cuy::ii, incrCopyNo, createfilelist::int, invert, n, class-composition::parent, phi, DDCompactView::position(), idealTransformation::rotation, rotns, rPos, funct::sin(), startAngle, startCopyNo, stepAngle, AlCaHLTBitMon_QueryRunRegistry::string, and zoffset.

60  {
61 
62  double phi = startAngle;
63  int copyNo = startCopyNo;
64 
65  for (int ii=0; ii<n; ii++) {
66 
67  double phideg = phi/CLHEP::deg;
68  int iphi;
69  if (phideg > 0) iphi = int(phideg+0.1);
70  else iphi = int(phideg-0.1);
71  if (iphi >= 360) iphi -= 360;
72  phideg = iphi;
74  std::string rotstr("NULL");
75 
76  rotstr = "RG";
77  if (invert > 0) rotstr += "I";
78  if (phideg >=0 && phideg < 10) rotstr += "00";
79  else if (phideg < 100) rotstr += "0";
80  rotstr += std::to_string(phideg);
81  rotation = DDRotation(DDName(rotstr, rotns));
82  if (!rotation) {
83  double thetax = 90.0;
84  double phix = invert==0 ? (90.0+phideg) : (-90.0+phideg);
85  double thetay = invert==0 ? 0.0 : 180.0;
86  double phiz = phideg;
87 #ifdef EDM_ML_DEBUG
88  edm::LogInfo("MuonGeom") << "DDGEMAngular test: Creating a new rotation "
89  << DDName(rotstr, idNameSpace) << "\t "
90  << thetax << ", " << phix << ", " << thetay
91  << ", 0, " << thetax << ", " << phiz;
92 #endif
93  rotation = DDrot(DDName(rotstr, rotns), thetax*CLHEP::deg,
94  phix*CLHEP::deg, thetay*CLHEP::deg, 0*CLHEP::deg,
95  thetax*CLHEP::deg, phiz*CLHEP::deg);
96  }
97 
98  DDTranslation tran(rPos*cos(phideg*CLHEP::deg), rPos*sin(phideg*CLHEP::deg), zoffset);
99 
100  DDName parentName = parent().name();
101  cpv.position(DDName(childName,idNameSpace), parentName, copyNo, tran, rotation);
102 #ifdef EDM_ML_DEBUG
103  edm::LogInfo("MuonGeom") << "DDGEMAngular test: "
104  << DDName(childName, idNameSpace) << " number "
105  << copyNo << " positioned in " << parentName
106  << " at " << tran << " with " << rotstr << " "
107  << rotation;
108 #endif
109  phi += stepAngle;
110  copyNo += incrCopyNo;
111  }
112 }
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
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:67
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
double stepAngle
Definition: DDGEMAngular.h:27
DDRotation DDrot(const DDName &name, DDRotationMatrix *rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:90
ii
Definition: cuy.py:589
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 26 of file DDGEMAngular.cc.

References childName, idNameSpace, incrCopyNo, createfilelist::int, invert, n, DDCurrentNamespace::ns(), class-composition::parent, rotns, rPos, startAngle, startCopyNo, stepAngle, and zoffset.

30  {
31 
32  startAngle = nArgs["startAngle"];
33  stepAngle = nArgs["stepAngle"];
34  invert = int (nArgs["invert"]);
35  rPos = nArgs["rPosition"];
36  zoffset = nArgs["zoffset"];
37  n = int (nArgs["n"]);
38  startCopyNo = int (nArgs["startCopyNo"]);
39  incrCopyNo = int (nArgs["incrCopyNo"]);
40 #ifdef EDM_ML_DEBUG
41  edm::LogInfo("MuonGeom") << "DDGEMAngular debug: Parameters for positioning-- "
42  << n << " copies in steps of " << stepAngle/CLHEP::deg
43  << " from " << startAngle/CLHEP::deg
44  << " (inversion flag " << invert << ") \trPos " << rPos
45  << " Zoffest " << zoffset << "\tStart and inremental "
46  << "copy nos " << startCopyNo << ", " << incrCopyNo;
47 #endif
48 
49  rotns = sArgs["RotNameSpace"];
51  childName = sArgs["ChildName"];
52 #ifdef EDM_ML_DEBUG
53  DDName parentName = parent().name();
54  edm::LogInfo("MuonGeom") << "DDGEMAngular debug: Parent " << parentName
55  << "\tChild " << childName << "\tNameSpace "
56  << idNameSpace << "\tRotation Namespace " << rotns;
57 #endif
58 }
std::string childName
Definition: DDGEMAngular.h:37
std::string rotns
Definition: DDGEMAngular.h:35
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.

Referenced by execute(), and initialize().

std::string DDGEMAngular::idNameSpace
private

Definition at line 36 of file DDGEMAngular.h.

Referenced by execute(), and initialize().

int DDGEMAngular::incrCopyNo
private

Definition at line 33 of file DDGEMAngular.h.

Referenced by execute(), and initialize().

int DDGEMAngular::invert
private

Definition at line 28 of file DDGEMAngular.h.

Referenced by execute(), and initialize().

int DDGEMAngular::n
private

Definition at line 31 of file DDGEMAngular.h.

Referenced by execute(), and initialize().

std::string DDGEMAngular::rotns
private

Definition at line 35 of file DDGEMAngular.h.

Referenced by execute(), and initialize().

double DDGEMAngular::rPos
private

Definition at line 29 of file DDGEMAngular.h.

Referenced by execute(), and initialize().

double DDGEMAngular::startAngle
private

Definition at line 26 of file DDGEMAngular.h.

Referenced by execute(), and initialize().

int DDGEMAngular::startCopyNo
private

Definition at line 32 of file DDGEMAngular.h.

Referenced by execute(), and initialize().

double DDGEMAngular::stepAngle
private

Definition at line 27 of file DDGEMAngular.h.

Referenced by execute(), and initialize().

double DDGEMAngular::zoffset
private

Definition at line 30 of file DDGEMAngular.h.

Referenced by execute(), and initialize().