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)
 
void initialize (const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs)
 
virtual ~DDMuonAngular ()
 

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

15  {
16  edm::LogInfo("MuonGeom") << "DDMuonAngular test: Creating an instance";
17 }
DDMuonAngular::~DDMuonAngular ( )
virtual

Definition at line 19 of file DDMuonAngular.cc.

19 {}

Member Function Documentation

void DDMuonAngular::execute ( DDCompactView cpv)

Definition at line 48 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.

48  {
49 
50  double phi = startAngle;
51  int copyNo = startCopyNo;
52 
53  for (int ii=0; ii<n; ii++) {
54 
55  double phideg = phi/CLHEP::deg;
56  int iphi;
57  if (phideg > 0) iphi = int(phideg+0.1);
58  else iphi = int(phideg-0.1);
59  if (iphi >= 360) iphi -= 360;
60  phideg = iphi;
62  std::string rotstr("NULL");
63 
64  if (iphi != 0) {
65  rotstr = "R";
66  if (phideg >=0 && phideg < 10) rotstr = "R00";
67  else if (phideg < 100) rotstr = "R0";
68  rotstr = rotstr + std::to_string(phideg);
69  rotation = DDRotation(DDName(rotstr, rotns));
70  if (!rotation) {
71  edm::LogInfo("MuonGeom") << "DDMuonAngular test: Creating a new rotation "
72  << DDName(rotstr, idNameSpace) << "\t90, "
73  << phideg << ", 90, " << (phideg+90) << ", 0, 0";
74  rotation = DDrot(DDName(rotstr, rotns), 90*CLHEP::deg,
75  phideg*CLHEP::deg, 90*CLHEP::deg,
76  (90+phideg)*CLHEP::deg, 0*CLHEP::deg, 0*CLHEP::deg);
77  }
78  }
79 
80  DDTranslation tran(0, 0, zoffset);
81 
82  DDName parentName = parent().name();
83  cpv.position(DDName(childName,idNameSpace), parentName, copyNo, tran, rotation);
84  edm::LogInfo("MuonGeom") << "DDMuonAngular test: "
85  << DDName(childName, idNameSpace) << " number "
86  << copyNo << " positioned in " << parentName << " at "
87  << tran << " with " << rotstr << " " << rotation;
88  phi += stepAngle;
89  copyNo += incrCopyNo;
90  }
91 }
void position(const DDLogicalPart &self, const DDLogicalPart &parent, std::string copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=NULL)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:16
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:64
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:588
double stepAngle
Definition: DDMuonAngular.h:27
std::string idNameSpace
Definition: DDMuonAngular.h:34
void DDMuonAngular::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)

Definition at line 21 of file DDMuonAngular.cc.

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

25  {
26 
27  startAngle = nArgs["startAngle"];
28  stepAngle = nArgs["stepAngle"];
29  zoffset = nArgs["zoffset"];
30  n = int (nArgs["n"]);
31  startCopyNo = int (nArgs["startCopyNo"]);
32  incrCopyNo = int (nArgs["incrCopyNo"]);
33  edm::LogInfo("MuonGeom") << "DDMuonAngular debug: Parameters for positioning-- "
34  << n << " copies in steps of " << stepAngle/CLHEP::deg
35  << " from " << startAngle/CLHEP::deg << " \tZoffest "
36  << zoffset << "\tStart and inremental copy nos "
37  << startCopyNo << ", " << incrCopyNo;
38 
39  rotns = sArgs["RotNameSpace"];
41  childName = sArgs["ChildName"];
42  DDName parentName = parent().name();
43  edm::LogInfo("MuonGeom") << "DDMuonAngular debug: Parent " << parentName
44  << "\tChild " << childName << "\tNameSpace "
45  << idNameSpace << "\tRotation Namespace " << rotns;
46 }
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:16
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().