CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DDHCalAngular Class Reference

#include <DDHCalAngular.h>

Inheritance diagram for DDHCalAngular:

Public Member Functions

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

Private Attributes

std::string childName
 
std::string idNameSpace
 
int incrCopyNo
 
int n
 
double rangeAngle
 
std::string rotns
 
double shiftX
 
double shiftY
 
double startAngle
 
int startCopyNo
 
double zoffset
 

Detailed Description

Definition at line 10 of file DDHCalAngular.h.

Constructor & Destructor Documentation

DDHCalAngular::DDHCalAngular ( )

Definition at line 15 of file DDHCalAngular.cc.

References LogDebug.

15  {
16  LogDebug("HCalGeom") << "DDHCalAngular test: Creating an instance";
17 }
#define LogDebug(id)
DDHCalAngular::~DDHCalAngular ( )
override

Definition at line 19 of file DDHCalAngular.cc.

19 {}

Member Function Documentation

void DDHCalAngular::execute ( DDCompactView cpv)
override

Definition at line 52 of file DDHCalAngular.cc.

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

52  {
53 
54  double dphi = rangeAngle/n;
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  if (iphi != 0) {
70  rotstr = "R";
71  if (phideg >=0 && phideg < 100) rotstr = "R0";
72  rotstr = rotstr + std::to_string(phideg);
73  rotation = DDRotation(DDName(rotstr, rotns));
74  if (!rotation) {
75  LogDebug("HCalGeom") << "DDHCalAngular test: Creating a new rotation "
76  << DDName(rotstr, idNameSpace) << "\t90, "
77  << phideg << ", 90, " << (phideg+90) << ", 0, 0";
78  rotation = DDrot(DDName(rotstr, rotns), 90*CLHEP::deg,
79  phideg*CLHEP::deg, 90*CLHEP::deg,
80  (90+phideg)*CLHEP::deg, 0*CLHEP::deg, 0*CLHEP::deg);
81  }
82  }
83 
84  double xpos = shiftX*cos(phi) - shiftY*sin(phi);
85  double ypos = shiftX*sin(phi) + shiftY*cos(phi);
86  DDTranslation tran(xpos, ypos, zoffset);
87 
88  DDName parentName = parent().name();
89  cpv.position(DDName(childName,idNameSpace), parentName, copyNo, tran, rotation);
90  LogDebug("HCalGeom") << "DDHCalAngular test: "
91  << DDName(childName, idNameSpace) << " number "
92  << copyNo << " positioned in " << parentName << " at "
93  << tran << " with " << rotation;
94  phi += dphi;
95  copyNo += incrCopyNo;
96  }
97 }
#define LogDebug(id)
double startAngle
Definition: DDHCalAngular.h:26
std::string rotns
Definition: DDHCalAngular.h:35
double rangeAngle
Definition: DDHCalAngular.h:27
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:67
std::string childName
Definition: DDHCalAngular.h:37
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
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:589
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
std::string idNameSpace
Definition: DDHCalAngular.h:36
void DDHCalAngular::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 21 of file DDHCalAngular.cc.

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

25  {
26 
27  startAngle = nArgs["startAngle"];
28  rangeAngle = nArgs["rangeAngle"];
29  shiftX = nArgs["shiftX"];
30  shiftY = nArgs["shiftY"];
31  zoffset = nArgs["zoffset"];
32  n = int (nArgs["n"]);
33  startCopyNo = int (nArgs["startCopyNo"]);
34  incrCopyNo = int (nArgs["incrCopyNo"]);
35  LogDebug("HCalGeom") << "DDHCalAngular debug: Parameters for positioning-- "
36  << n << " copies in " << rangeAngle/CLHEP::deg
37  << " from " << startAngle/CLHEP::deg << "\tShifts "
38  << shiftX << ", " << shiftY
39  << " along x, y axes; \tZoffest " << zoffset
40  << "\tStart and inremental copy nos " << startCopyNo
41  << ", " << incrCopyNo;
42 
43  rotns = sArgs["RotNameSpace"];
45  childName = sArgs["ChildName"];
46  DDName parentName = parent().name();
47  LogDebug("HCalGeom") << "DDHCalAngular debug: Parent " << parentName
48  << "\tChild " << childName << "\tNameSpace "
49  << idNameSpace << "\tRotation Namespace " << rotns;
50 }
#define LogDebug(id)
double startAngle
Definition: DDHCalAngular.h:26
std::string rotns
Definition: DDHCalAngular.h:35
double rangeAngle
Definition: DDHCalAngular.h:27
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
static std::string & ns()
std::string childName
Definition: DDHCalAngular.h:37
std::string idNameSpace
Definition: DDHCalAngular.h:36

Member Data Documentation

std::string DDHCalAngular::childName
private

Definition at line 37 of file DDHCalAngular.h.

Referenced by execute(), and initialize().

std::string DDHCalAngular::idNameSpace
private

Definition at line 36 of file DDHCalAngular.h.

Referenced by execute(), and initialize().

int DDHCalAngular::incrCopyNo
private

Definition at line 33 of file DDHCalAngular.h.

Referenced by execute(), and initialize().

int DDHCalAngular::n
private

Definition at line 31 of file DDHCalAngular.h.

Referenced by execute(), and initialize().

double DDHCalAngular::rangeAngle
private

Definition at line 27 of file DDHCalAngular.h.

Referenced by execute(), and initialize().

std::string DDHCalAngular::rotns
private

Definition at line 35 of file DDHCalAngular.h.

Referenced by execute(), and initialize().

double DDHCalAngular::shiftX
private

Definition at line 29 of file DDHCalAngular.h.

Referenced by execute(), and initialize().

double DDHCalAngular::shiftY
private

Definition at line 28 of file DDHCalAngular.h.

Referenced by execute(), and initialize().

double DDHCalAngular::startAngle
private

Definition at line 26 of file DDHCalAngular.h.

Referenced by execute(), and initialize().

int DDHCalAngular::startCopyNo
private

Definition at line 32 of file DDHCalAngular.h.

Referenced by execute(), and initialize().

double DDHCalAngular::zoffset
private

Definition at line 30 of file DDHCalAngular.h.

Referenced by execute(), and initialize().