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
DDGEMAngular Class Reference

#include <DDGEMAngular.h>

Inheritance diagram for DDGEMAngular:

Public Member Functions

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

Private Attributes

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

Detailed Description

Definition at line 10 of file DDGEMAngular.h.

Constructor & Destructor Documentation

DDGEMAngular::DDGEMAngular ( )

Definition at line 17 of file DDGEMAngular.cc.

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

Definition at line 21 of file DDGEMAngular.cc.

21 {}

Member Function Documentation

void DDGEMAngular::execute ( DDCompactView cpv)

Definition at line 54 of file DDGEMAngular.cc.

References childName, funct::cos(), dbl_to_string(), DDrot(), idNameSpace, cuy::ii, incrCopyNo, invert, n, dbtoconf::parent, phi, DDCompactView::position(), idealTransformation::rotation, rotns, rPos, funct::sin(), startAngle, startCopyNo, stepAngle, AlCaHLTBitMon_QueryRunRegistry::string, and zoffset.

54  {
55 
56  double phi = startAngle;
57  int copyNo = startCopyNo;
58 
59  for (int ii=0; ii<n; ii++) {
60 
61  double phideg = phi/CLHEP::deg;
62  int iphi;
63  if (phideg > 0) iphi = int(phideg+0.1);
64  else iphi = int(phideg-0.1);
65  if (iphi >= 360) iphi -= 360;
66  phideg = iphi;
68  std::string rotstr("NULL");
69 
70  rotstr = "RG";
71  if (invert > 0) rotstr += "I";
72  if (phideg >=0 && phideg < 10) rotstr += "00";
73  else if (phideg < 100) rotstr += "0";
74  rotstr += dbl_to_string(phideg);
75  rotation = DDRotation(DDName(rotstr, rotns));
76  if (!rotation) {
77  double thetax = 90.0;
78  double phix = invert==0 ? (90.0+phideg) : (-90.0+phideg);
79  double thetay = invert==0 ? 0.0 : 180.0;
80  double phiz = phideg;
81  edm::LogInfo("MuonGeom") << "DDGEMAngular test: Creating a new rotation "
82  << DDName(rotstr, idNameSpace) << "\t "
83  << thetax << ", " << phix << ", " << thetay
84  << ", 0, " << thetax << ", " << phiz << std::endl;
85  rotation = DDrot(DDName(rotstr, rotns), thetax*CLHEP::deg,
86  phix*CLHEP::deg, thetay*CLHEP::deg, 0*CLHEP::deg,
87  thetax*CLHEP::deg, phiz*CLHEP::deg);
88  }
89 
90  DDTranslation tran(rPos*cos(phideg*CLHEP::deg), rPos*sin(phideg*CLHEP::deg), zoffset);
91 
92  DDName parentName = parent().name();
93  cpv.position(DDName(childName,idNameSpace), parentName, copyNo, tran, rotation);
94  edm::LogInfo("MuonGeom") << "DDGEMAngular test: "
95  << DDName(childName, idNameSpace) << " number "
96  << copyNo << " positioned in " << parentName << " at "
97  << tran << " with " << rotstr << " " << rotation << "\n";
98  phi += stepAngle;
99  copyNo += incrCopyNo;
100  }
101 }
std::string childName
Definition: DDGEMAngular.h:37
std::string rotns
Definition: DDGEMAngular.h:35
list parent
Definition: dbtoconf.py:74
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
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:18
std::string dbl_to_string(const double &in)
Converts only the integer part of a double to a string.
Definition: DDutils.cc:12
std::string idNameSpace
Definition: DDGEMAngular.h:36
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
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
double stepAngle
Definition: DDGEMAngular.h:27
DDRotation DDrot(const DDName &name, DDRotationMatrix *rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:90
double zoffset
Definition: DDGEMAngular.h:30
double startAngle
Definition: DDGEMAngular.h:26
Definition: DDAxes.h:10
void DDGEMAngular::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)

Definition at line 23 of file DDGEMAngular.cc.

References childName, idNameSpace, incrCopyNo, invert, n, DDCurrentNamespace::ns(), dbtoconf::parent, rotns, rPos, startAngle, startCopyNo, stepAngle, and zoffset.

27  {
28 
29  startAngle = nArgs["startAngle"];
30  stepAngle = nArgs["stepAngle"];
31  invert = int (nArgs["invert"]);
32  rPos = nArgs["rPosition"];
33  zoffset = nArgs["zoffset"];
34  n = int (nArgs["n"]);
35  startCopyNo = int (nArgs["startCopyNo"]);
36  incrCopyNo = int (nArgs["incrCopyNo"]);
37  edm::LogInfo("MuonGeom") << "DDGEMAngular debug: Parameters for positioning-- "
38  << n << " copies in steps of " << stepAngle/CLHEP::deg
39  << " from " << startAngle/CLHEP::deg
40  << " (inversion flag " << invert << ") \trPos " << rPos
41  << " Zoffest " << zoffset << "\tStart and inremental "
42  << "copy nos " << startCopyNo << ", " << incrCopyNo
43  << std::endl;
44 
45  rotns = sArgs["RotNameSpace"];
47  childName = sArgs["ChildName"];
48  DDName parentName = parent().name();
49  edm::LogInfo("MuonGeom") << "DDGEMAngular debug: Parent " << parentName
50  << "\tChild " << childName << "\tNameSpace "
51  << idNameSpace << "\tRotation Namespace " << rotns << std::endl;
52 }
std::string childName
Definition: DDGEMAngular.h:37
std::string rotns
Definition: DDGEMAngular.h:35
list parent
Definition: dbtoconf.py:74
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:18
static std::string & ns()
std::string idNameSpace
Definition: DDGEMAngular.h:36
double stepAngle
Definition: DDGEMAngular.h:27
double zoffset
Definition: DDGEMAngular.h:30
double startAngle
Definition: DDGEMAngular.h:26

Member Data Documentation

std::string DDGEMAngular::childName
private

Definition at line 37 of file DDGEMAngular.h.

Referenced by execute(), and initialize().

std::string DDGEMAngular::idNameSpace
private

Definition at line 36 of file DDGEMAngular.h.

Referenced by execute(), and initialize().

int DDGEMAngular::incrCopyNo
private

Definition at line 33 of file DDGEMAngular.h.

Referenced by execute(), and initialize().

int DDGEMAngular::invert
private

Definition at line 28 of file DDGEMAngular.h.

Referenced by execute(), and initialize().

int DDGEMAngular::n
private

Definition at line 31 of file DDGEMAngular.h.

Referenced by execute(), and initialize().

std::string DDGEMAngular::rotns
private

Definition at line 35 of file DDGEMAngular.h.

Referenced by execute(), and initialize().

double DDGEMAngular::rPos
private

Definition at line 29 of file DDGEMAngular.h.

Referenced by execute(), and initialize().

double DDGEMAngular::startAngle
private

Definition at line 26 of file DDGEMAngular.h.

Referenced by execute(), and initialize().

int DDGEMAngular::startCopyNo
private

Definition at line 32 of file DDGEMAngular.h.

Referenced by execute(), and initialize().

double DDGEMAngular::stepAngle
private

Definition at line 27 of file DDGEMAngular.h.

Referenced by execute(), and initialize().

double DDGEMAngular::zoffset
private

Definition at line 30 of file DDGEMAngular.h.

Referenced by execute(), and initialize().