CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DDMuonAngular Class Reference
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 21 of file DDMuonAngular.cc.

Constructor & Destructor Documentation

DDMuonAngular::DDMuonAngular ( )

Definition at line 52 of file DDMuonAngular.cc.

52  {
53 #ifdef EDM_ML_DEBUG
54  edm::LogVerbatim("MuonGeom") << "DDMuonAngular: Creating an instance";
55 #endif
56 }
DDMuonAngular::~DDMuonAngular ( )
override

Definition at line 58 of file DDMuonAngular.cc.

58 {}

Member Function Documentation

void DDMuonAngular::execute ( DDCompactView cpv)
override

Definition at line 85 of file DDMuonAngular.cc.

References funct::abs(), childName, angle_units::operators::convertRadToDeg(), DDrot(), DEFINE_EDM_PLUGIN, formatAsDegrees(), idNameSpace, cuy::ii, incrCopyNo, n, class-composition::parent, phi, DDCompactView::position(), idealTransformation::rotation, rotns, startAngle, startCopyNo, stepAngle, AlCaHLTBitMon_QueryRunRegistry::string, and zoffset.

85  {
86  double phi = startAngle;
87  int copyNo = startCopyNo;
88 
89  for (int ii = 0; ii < n; ii++) {
90  double phitmp = phi;
91  if (phitmp >= 2._pi)
92  phitmp -= 2._pi;
94  std::string rotstr("NULL");
95 
96  if (std::abs(phitmp) >= 1.0_deg) {
97  rotstr = "R" + formatAsDegrees(phitmp);
98  rotation = DDRotation(DDName(rotstr, rotns));
99  if (!rotation) {
100 #ifdef EDM_ML_DEBUG
101  edm::LogVerbatim("MuonGeom") << "DDMuonAngular: Creating a new rotation " << DDName(rotstr, idNameSpace)
102  << "\t90, " << convertRadToDeg(phitmp) << ", 90, "
103  << convertRadToDeg(phitmp + 90._deg) << ", 0, 0";
104 #endif
105  rotation = DDrot(DDName(rotstr, rotns), 90._deg, phitmp, 90._deg, 90._deg + phitmp, 0., 0.);
106  }
107  }
108 
109  DDTranslation tran(0, 0, zoffset);
110 
111  DDName parentName = parent().name();
112  cpv.position(DDName(childName, idNameSpace), parentName, copyNo, tran, rotation);
113 #ifdef EDM_ML_DEBUG
114  edm::LogVerbatim("MuonGeom") << "DDMuonAngular: " << DDName(childName, idNameSpace) << " number " << copyNo
115  << " positioned in " << parentName << " at " << tran << " with " << rotstr << " "
116  << rotation;
117 #endif
118  phi += stepAngle;
119  copyNo += incrCopyNo;
120  }
121 }
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
std::string rotns
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
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 childName
std::string formatAsDegrees(double radianVal)
Definition: DDTypes.cc:68
ii
Definition: cuy.py:590
std::string idNameSpace
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
ROOT::Math::Rotation3D DDRotation
void DDMuonAngular::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 60 of file DDMuonAngular.cc.

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

64  {
65  startAngle = nArgs["startAngle"];
66  stepAngle = nArgs["stepAngle"];
67  zoffset = nArgs["zoffset"];
68  n = int(nArgs["n"]);
69  startCopyNo = int(nArgs["startCopyNo"]);
70  incrCopyNo = int(nArgs["incrCopyNo"]);
71 #ifdef EDM_ML_DEBUG
72  edm::LogVerbatim("MuonGeom") << "DDMuonAngular: Parameters for positioning-- " << n << " copies in steps of "
73  << convertRadToDeg(stepAngle) << " from " << convertRadToDeg(startAngle) << " \tZoffest "
74  << zoffset << "\tStart and inremental copy nos " << startCopyNo << ", " << incrCopyNo;
75 #endif
76  rotns = sArgs["RotNameSpace"];
78  childName = sArgs["ChildName"];
79 #ifdef EDM_ML_DEBUG
80  edm::LogVerbatim("MuonGeom") << "DDMuonAngular debug: Parent " << parent().name() << "\tChild " << childName
81  << "\tNameSpace " << idNameSpace << "\tRotation Namespace " << rotns;
82 #endif
83 }
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
static std::string & ns()
std::string rotns
std::string childName
std::string idNameSpace

Member Data Documentation

std::string DDMuonAngular::childName
private

Definition at line 45 of file DDMuonAngular.cc.

Referenced by execute(), and initialize().

std::string DDMuonAngular::idNameSpace
private

Definition at line 44 of file DDMuonAngular.cc.

Referenced by execute(), and initialize().

int DDMuonAngular::incrCopyNo
private

Definition at line 41 of file DDMuonAngular.cc.

Referenced by execute(), and initialize().

int DDMuonAngular::n
private

Definition at line 39 of file DDMuonAngular.cc.

Referenced by execute(), and initialize().

std::string DDMuonAngular::rotns
private

Definition at line 43 of file DDMuonAngular.cc.

Referenced by execute(), and initialize().

double DDMuonAngular::startAngle
private

Definition at line 36 of file DDMuonAngular.cc.

Referenced by execute(), and initialize().

int DDMuonAngular::startCopyNo
private

Definition at line 40 of file DDMuonAngular.cc.

Referenced by execute(), and initialize().

double DDMuonAngular::stepAngle
private

Definition at line 37 of file DDMuonAngular.cc.

Referenced by execute(), and initialize().

double DDMuonAngular::zoffset
private

Definition at line 38 of file DDMuonAngular.cc.

Referenced by execute(), and initialize().