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

#include <DDHCalAngular.h>

Inheritance diagram for DDHCalAngular:

Public Member Functions

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

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

References LogDebug.

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

Definition at line 20 of file DDHCalAngular.cc.

20 {}

Member Function Documentation

void DDHCalAngular::execute ( DDCompactView cpv)

Definition at line 53 of file DDHCalAngular.cc.

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

53  {
54 
55  double dphi = rangeAngle/n;
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  if (iphi != 0) {
71  rotstr = "R";
72  if (phideg >=0 && phideg < 100) rotstr = "R0";
73  rotstr = rotstr + dbl_to_string(phideg);
74  rotation = DDRotation(DDName(rotstr, rotns));
75  if (!rotation) {
76  LogDebug("HCalGeom") << "DDHCalAngular test: Creating a new rotation "
77  << DDName(rotstr, idNameSpace) << "\t90, "
78  << phideg << ", 90, " << (phideg+90) << ", 0, 0";
79  rotation = DDrot(DDName(rotstr, rotns), 90*CLHEP::deg,
80  phideg*CLHEP::deg, 90*CLHEP::deg,
81  (90+phideg)*CLHEP::deg, 0*CLHEP::deg, 0*CLHEP::deg);
82  }
83  }
84 
85  double xpos = shiftX*cos(phi) - shiftY*sin(phi);
86  double ypos = shiftX*sin(phi) + shiftY*cos(phi);
87  DDTranslation tran(xpos, ypos, zoffset);
88 
89  DDName parentName = parent().name();
90  cpv.position(DDName(childName,idNameSpace), parentName, copyNo, tran, rotation);
91  LogDebug("HCalGeom") << "DDHCalAngular test: "
92  << DDName(childName, idNameSpace) << " number "
93  << copyNo << " positioned in " << parentName << " at "
94  << tran << " with " << rotation;
95  phi += dphi;
96  copyNo += incrCopyNo;
97  }
98 }
#define LogDebug(id)
double startAngle
Definition: DDHCalAngular.h:26
list parent
Definition: dbtoconf.py:74
std::string rotns
Definition: DDHCalAngular.h:35
double rangeAngle
Definition: DDHCalAngular.h:27
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
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 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
std::string idNameSpace
Definition: DDHCalAngular.h:36
Definition: DDAxes.h:10
void DDHCalAngular::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)

Definition at line 22 of file DDHCalAngular.cc.

References childName, idNameSpace, incrCopyNo, LogDebug, n, DDCurrentNamespace::ns(), dbtoconf::parent, rangeAngle, rotns, shiftX, shiftY, startAngle, startCopyNo, and zoffset.

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