test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 16 of file DDMuonAngular.cc.

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

Definition at line 20 of file DDMuonAngular.cc.

20 {}

Member Function Documentation

void DDMuonAngular::execute ( DDCompactView cpv)

Definition at line 49 of file DDMuonAngular.cc.

References childName, dbl_to_string(), DDrot(), idNameSpace, cuy::ii, incrCopyNo, n, DDName::name(), phi, DDCompactView::position(), idealTransformation::rotation, rotns, startAngle, startCopyNo, stepAngle, AlCaHLTBitMon_QueryRunRegistry::string, and zoffset.

49  {
50 
51  double phi = startAngle;
52  int copyNo = startCopyNo;
53 
54  for (int ii=0; ii<n; ii++) {
55 
56  double phideg = phi/CLHEP::deg;
57  int iphi;
58  if (phideg > 0) iphi = int(phideg+0.1);
59  else iphi = int(phideg-0.1);
60  if (iphi >= 360) iphi -= 360;
61  phideg = iphi;
63  std::string rotstr("NULL");
64 
65  if (iphi != 0) {
66  rotstr = "R";
67  if (phideg >=0 && phideg < 10) rotstr = "R00";
68  else if (phideg < 100) rotstr = "R0";
69  rotstr = rotstr + dbl_to_string(phideg);
70  rotation = DDRotation(DDName(rotstr, rotns));
71  if (!rotation) {
72  edm::LogInfo("MuonGeom") << "DDMuonAngular test: Creating a new rotation "
73  << DDName(rotstr, idNameSpace) << "\t90, "
74  << phideg << ", 90, " << (phideg+90) << ", 0, 0";
75  rotation = DDrot(DDName(rotstr, rotns), 90*CLHEP::deg,
76  phideg*CLHEP::deg, 90*CLHEP::deg,
77  (90+phideg)*CLHEP::deg, 0*CLHEP::deg, 0*CLHEP::deg);
78  }
79  }
80 
81  DDTranslation tran(0, 0, zoffset);
82 
83  DDName parentName = parent().name();
84  cpv.position(DDName(childName,idNameSpace), parentName, copyNo, tran, rotation);
85  edm::LogInfo("MuonGeom") << "DDMuonAngular test: "
86  << DDName(childName, idNameSpace) << " number "
87  << copyNo << " positioned in " << parentName << " at "
88  << tran << " with " << rotstr << " " << rotation;
89  phi += stepAngle;
90  copyNo += incrCopyNo;
91  }
92 }
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:14
std::string dbl_to_string(const double &in)
Converts only the integer part of a double to a string.
Definition: DDutils.cc:12
double startAngle
Definition: DDMuonAngular.h:26
int ii
Definition: cuy.py:588
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
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
double stepAngle
Definition: DDMuonAngular.h:27
std::string idNameSpace
Definition: DDMuonAngular.h:34
const std::string & name() const
Returns the name.
Definition: DDName.cc:87
void DDMuonAngular::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)

Definition at line 22 of file DDMuonAngular.cc.

References childName, idNameSpace, incrCopyNo, n, DDName::name(), DDCurrentNamespace::ns(), rotns, startAngle, startCopyNo, stepAngle, and zoffset.

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

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().