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 19 of file DDMuonAngular.cc.

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

Definition at line 25 of file DDMuonAngular.cc.

25 {}

Member Function Documentation

void DDMuonAngular::execute ( DDCompactView cpv)
override

Definition at line 58 of file DDMuonAngular.cc.

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

58  {
59 
60  double phi = startAngle;
61  int copyNo = startCopyNo;
62 
63  for (int ii=0; ii<n; ii++) {
64 
65  double phitmp = phi;
66  if (phitmp >= 2._pi) phitmp -= 2._pi;
68  std::string rotstr("NULL");
69 
70  if (std::abs(phitmp) >= 1.0_deg) {
71  rotstr = "R" + formatAsDegrees(phitmp);
72  rotation = DDRotation(DDName(rotstr, rotns));
73  if (!rotation) {
74 #ifdef EDM_ML_DEBUG
75  edm::LogVerbatim("MuonGeom")
76  << "DDMuonAngular: Creating a new rotation "
77  << DDName(rotstr, idNameSpace) << "\t90, "
78  << convertRadToDeg( phitmp ) << ", 90, "
79  << convertRadToDeg( phitmp + 90._deg ) << ", 0, 0";
80 #endif
81  rotation = DDrot(DDName(rotstr, rotns), 90._deg, phitmp, 90._deg, 90._deg + phitmp, 0., 0.);
82  }
83  }
84 
85  DDTranslation tran(0, 0, zoffset);
86 
87  DDName parentName = parent().name();
88  cpv.position(DDName(childName,idNameSpace), parentName, copyNo, tran, rotation);
89 #ifdef EDM_ML_DEBUG
90  edm::LogVerbatim("MuonGeom")
91  << "DDMuonAngular: " << DDName(childName, idNameSpace) << " number "
92  << copyNo << " positioned in " << parentName
93  << " at " << tran << " with " << rotstr << " " << rotation;
94 #endif
95  phi += stepAngle;
96  copyNo += incrCopyNo;
97  }
98 }
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
constexpr NumType convertRadToDeg(NumType radians)
Definition: GeantUnits.h:98
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:68
std::string rotns
Definition: DDMuonAngular.h:33
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:80
std::string childName
Definition: DDMuonAngular.h:35
std::string formatAsDegrees(double radianVal)
Definition: DDTypes.cc:75
ii
Definition: cuy.py:590
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 27 of file DDMuonAngular.cc.

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

31  {
32 
33  startAngle = nArgs["startAngle"];
34  stepAngle = nArgs["stepAngle"];
35  zoffset = nArgs["zoffset"];
36  n = int (nArgs["n"]);
37  startCopyNo = int (nArgs["startCopyNo"]);
38  incrCopyNo = int (nArgs["incrCopyNo"]);
39 #ifdef EDM_ML_DEBUG
40  edm::LogVerbatim("MuonGeom")
41  << "DDMuonAngular: Parameters for positioning-- " << n
42  << " copies in steps of " << convertRadToDeg( stepAngle )
43  << " from " << convertRadToDeg( startAngle ) << " \tZoffest "
44  << zoffset << "\tStart and inremental copy nos "
45  << startCopyNo << ", " << incrCopyNo;
46 #endif
47  rotns = sArgs["RotNameSpace"];
49  childName = sArgs["ChildName"];
50 #ifdef EDM_ML_DEBUG
51  edm::LogVerbatim("MuonGeom")
52  << "DDMuonAngular debug: Parent " << parent().name()
53  << "\tChild " << childName << "\tNameSpace "
54  << idNameSpace << "\tRotation Namespace " << rotns;
55 #endif
56 }
constexpr NumType convertRadToDeg(NumType radians)
Definition: GeantUnits.h:98
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.

std::string DDMuonAngular::idNameSpace
private

Definition at line 34 of file DDMuonAngular.h.

int DDMuonAngular::incrCopyNo
private

Definition at line 31 of file DDMuonAngular.h.

int DDMuonAngular::n
private

Definition at line 29 of file DDMuonAngular.h.

std::string DDMuonAngular::rotns
private

Definition at line 33 of file DDMuonAngular.h.

double DDMuonAngular::startAngle
private

Definition at line 26 of file DDMuonAngular.h.

int DDMuonAngular::startCopyNo
private

Definition at line 30 of file DDMuonAngular.h.

double DDMuonAngular::stepAngle
private

Definition at line 27 of file DDMuonAngular.h.

double DDMuonAngular::zoffset
private

Definition at line 28 of file DDMuonAngular.h.