CMS 3D CMS Logo

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

#include <DDMuonAngular.h>

Inheritance diagram for DDMuonAngular:

Public Member Functions

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

Private Attributes

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

Detailed Description

Definition at line 10 of file DDMuonAngular.h.

Constructor & Destructor Documentation

DDMuonAngular::DDMuonAngular ( )

Definition at line 17 of file DDMuonAngular.cc.

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

Definition at line 23 of file DDMuonAngular.cc.

23 {}

Member Function Documentation

void DDMuonAngular::execute ( DDCompactView cpv)
override

Definition at line 55 of file DDMuonAngular.cc.

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

55  {
56 
57  double phi = startAngle;
58  int copyNo = startCopyNo;
59 
60  for (int ii=0; ii<n; ii++) {
61 
62  double phideg = phi/CLHEP::deg;
63  int iphi;
64  if (phideg > 0) iphi = int(phideg+0.1);
65  else iphi = int(phideg-0.1);
66  if (iphi >= 360) iphi -= 360;
67  phideg = iphi;
69  std::string rotstr("NULL");
70 
71  if (iphi != 0) {
72  rotstr = "R";
73  if (phideg >=0 && phideg < 10) rotstr = "R00";
74  else if (phideg < 100) rotstr = "R0";
75  rotstr = rotstr + std::to_string(phideg);
76  rotation = DDRotation(DDName(rotstr, rotns));
77  if (!rotation) {
78 #ifdef EDM_ML_DEBUG
79  edm::LogInfo("MuonGeom") << "DDMuonAngular test: Creating a new rotation "
80  << DDName(rotstr, idNameSpace) << "\t90, "
81  << phideg << ", 90, " << (phideg+90) << ", 0, 0";
82 #endif
83  rotation = DDrot(DDName(rotstr, rotns), 90*CLHEP::deg,
84  phideg*CLHEP::deg, 90*CLHEP::deg,
85  (90+phideg)*CLHEP::deg, 0*CLHEP::deg, 0*CLHEP::deg);
86  }
87  }
88 
89  DDTranslation tran(0, 0, zoffset);
90 
91  DDName parentName = parent().name();
92  cpv.position(DDName(childName,idNameSpace), parentName, copyNo, tran, rotation);
93 #ifdef EDM_ML_DEBUG
94  edm::LogInfo("MuonGeom") << "DDMuonAngular test: "
95  << DDName(childName, idNameSpace) << " number "
96  << copyNo << " positioned in " << parentName
97  << " at " << tran << " with " << rotstr << " "
98  << rotation;
99 #endif
100  phi += stepAngle;
101  copyNo += incrCopyNo;
102  }
103 }
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
double startAngle
Definition: DDMuonAngular.h:26
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:67
std::string rotns
Definition: DDMuonAngular.h:33
std::string childName
Definition: DDMuonAngular.h:35
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 stepAngle
Definition: DDMuonAngular.h:27
std::string idNameSpace
Definition: DDMuonAngular.h:34
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
void DDMuonAngular::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 25 of file DDMuonAngular.cc.

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

29  {
30 
31  startAngle = nArgs["startAngle"];
32  stepAngle = nArgs["stepAngle"];
33  zoffset = nArgs["zoffset"];
34  n = int (nArgs["n"]);
35  startCopyNo = int (nArgs["startCopyNo"]);
36  incrCopyNo = int (nArgs["incrCopyNo"]);
37 #ifdef EDM_ML_DEBUG
38  edm::LogInfo("MuonGeom") << "DDMuonAngular debug: Parameters for positioning-- "
39  << n << " copies in steps of " << stepAngle/CLHEP::deg
40  << " from " << startAngle/CLHEP::deg << " \tZoffest "
41  << zoffset << "\tStart and inremental copy nos "
42  << startCopyNo << ", " << incrCopyNo;
43 #endif
44  rotns = sArgs["RotNameSpace"];
46  childName = sArgs["ChildName"];
47 #ifdef EDM_ML_DEBUG
48  DDName parentName = parent().name();
49  edm::LogInfo("MuonGeom") << "DDMuonAngular debug: Parent " << parentName
50  << "\tChild " << childName << "\tNameSpace "
51  << idNameSpace << "\tRotation Namespace " << rotns;
52 #endif
53 }
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
static std::string & ns()
double startAngle
Definition: DDMuonAngular.h:26
std::string rotns
Definition: DDMuonAngular.h:33
std::string childName
Definition: DDMuonAngular.h:35
double stepAngle
Definition: DDMuonAngular.h:27
std::string idNameSpace
Definition: DDMuonAngular.h:34

Member Data Documentation

std::string DDMuonAngular::childName
private

Definition at line 35 of file DDMuonAngular.h.

Referenced by execute(), and initialize().

std::string DDMuonAngular::idNameSpace
private

Definition at line 34 of file DDMuonAngular.h.

Referenced by execute(), and initialize().

int DDMuonAngular::incrCopyNo
private

Definition at line 31 of file DDMuonAngular.h.

Referenced by execute(), and initialize().

int DDMuonAngular::n
private

Definition at line 29 of file DDMuonAngular.h.

Referenced by execute(), and initialize().

std::string DDMuonAngular::rotns
private

Definition at line 33 of file DDMuonAngular.h.

Referenced by execute(), and initialize().

double DDMuonAngular::startAngle
private

Definition at line 26 of file DDMuonAngular.h.

Referenced by execute(), and initialize().

int DDMuonAngular::startCopyNo
private

Definition at line 30 of file DDMuonAngular.h.

Referenced by execute(), and initialize().

double DDMuonAngular::stepAngle
private

Definition at line 27 of file DDMuonAngular.h.

Referenced by execute(), and initialize().

double DDMuonAngular::zoffset
private

Definition at line 28 of file DDMuonAngular.h.

Referenced by execute(), and initialize().