CMS 3D CMS Logo

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 16 of file DDGEMAngular.cc.

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

Definition at line 20 of file DDGEMAngular.cc.

20 {}

Member Function Documentation

void DDGEMAngular::execute ( DDCompactView cpv)

Definition at line 53 of file DDGEMAngular.cc.

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

53  {
54 
55  double phi = startAngle;
56  int copyNo = startCopyNo;
57 
58  for (int ii=0; ii<n; ii++) {
59 
60  double phideg = phi/CLHEP::deg;
61  int iphi;
62  if (phideg > 0) iphi = int(phideg+0.1);
63  else iphi = int(phideg-0.1);
64  if (iphi >= 360) iphi -= 360;
65  phideg = iphi;
67  std::string rotstr("NULL");
68 
69  rotstr = "RG";
70  if (invert > 0) rotstr += "I";
71  if (phideg >=0 && phideg < 10) rotstr += "00";
72  else if (phideg < 100) rotstr += "0";
73  rotstr += std::to_string(phideg);
74  rotation = DDRotation(DDName(rotstr, rotns));
75  if (!rotation) {
76  double thetax = 90.0;
77  double phix = invert==0 ? (90.0+phideg) : (-90.0+phideg);
78  double thetay = invert==0 ? 0.0 : 180.0;
79  double phiz = phideg;
80  edm::LogInfo("MuonGeom") << "DDGEMAngular test: Creating a new rotation "
81  << DDName(rotstr, idNameSpace) << "\t "
82  << thetax << ", " << phix << ", " << thetay
83  << ", 0, " << thetax << ", " << phiz << std::endl;
84  rotation = DDrot(DDName(rotstr, rotns), thetax*CLHEP::deg,
85  phix*CLHEP::deg, thetay*CLHEP::deg, 0*CLHEP::deg,
86  thetax*CLHEP::deg, phiz*CLHEP::deg);
87  }
88 
89  DDTranslation tran(rPos*cos(phideg*CLHEP::deg), rPos*sin(phideg*CLHEP::deg), zoffset);
90 
91  DDName parentName = parent().name();
92  cpv.position(DDName(childName,idNameSpace), parentName, copyNo, tran, rotation);
93  edm::LogInfo("MuonGeom") << "DDGEMAngular test: "
94  << DDName(childName, idNameSpace) << " number "
95  << copyNo << " positioned in " << parentName << " at "
96  << tran << " with " << rotstr << " " << rotation << "\n";
97  phi += stepAngle;
98  copyNo += incrCopyNo;
99  }
100 }
std::string childName
Definition: DDGEMAngular.h:37
std::string rotns
Definition: DDGEMAngular.h:35
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:15
std::string idNameSpace
Definition: DDGEMAngular.h:36
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:64
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
ii
Definition: cuy.py:588
double zoffset
Definition: DDGEMAngular.h:30
double startAngle
Definition: DDGEMAngular.h:26
void DDGEMAngular::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)

Definition at line 22 of file DDGEMAngular.cc.

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

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