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

19  {
20 #ifdef EDM_ML_DEBUG
21  edm::LogVerbatim("HCalGeom") << "DDHCalAngular: Creating an instance";
22 #endif
23 }
DDHCalAngular::~DDHCalAngular ( )
override

Definition at line 25 of file DDHCalAngular.cc.

25 {}

Member Function Documentation

void DDHCalAngular::execute ( DDCompactView cpv)
override

Definition at line 63 of file DDHCalAngular.cc.

References funct::abs(), geant_units::operators::convertRadToDeg(), funct::cos(), DDrot(), formatAsDegreesInInteger(), cuy::ii, gen::n, class-composition::parent, DDCompactView::position(), idealTransformation::rotation, funct::sin(), AlCaHLTBitMon_QueryRunRegistry::string, and theta().

63  {
64 
65  double dphi = rangeAngle/n;
66  double phix = startAngle;
67  int copyNo = startCopyNo;
68  double theta = 90._deg;
69  for (int ii=0; ii<n; ii++) {
70  double phiy = phix + 90._deg;
72  std::string rotstr("NULL");
73 
74  static const double tol = 0.1;
75  if (std::abs(phix) > tol) {
76  rotstr = "R" + formatAsDegreesInInteger(phix);
77  rotation = DDRotation(DDName(rotstr, rotns));
78  if (!rotation) {
79 #ifdef EDM_ML_DEBUG
80  edm::LogVerbatim("HCalGeom") << "DDHCalAngular: Creating a rotation "
81  << DDName(rotstr, idNameSpace) << "\t90, "
82  << convertRadToDeg(phix) << ", 90, "
83  << (90+convertRadToDeg(phix)) << ", 0, 0";
84 #endif
85  rotation = DDrot(DDName(rotstr, rotns), theta, phix, theta, phiy, 0,0);
86  }
87  }
88 
89  double xpos = shiftX*cos(phix) - shiftY*sin(phix);
90  double ypos = shiftX*sin(phix) + shiftY*cos(phix);
91  DDTranslation tran(xpos, ypos, zoffset);
92 
93  DDName parentName = parent().name();
94  cpv.position(DDName(childName,idNameSpace),parentName,copyNo,tran,rotation);
95 #ifdef EDM_ML_DEBUG
96  edm::LogVerbatim("HCalGeom") << "DDHCalAngular: "
98  << " number " << copyNo << " positioned in "
99  << parentName << " at " << tran << " with "
100  << rotation;
101 #endif
102  phix += dphi;
103  copyNo += incrCopyNo;
104  }
105 }
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
Geom::Theta< T > theta() const
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
constexpr NumType convertRadToDeg(NumType radians)
Definition: GeantUnits.h:98
std::string formatAsDegreesInInteger(double radianVal)
Definition: DDTypes.cc:86
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:68
std::string childName
Definition: DDHCalAngular.h:37
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
DDRotation DDrot(const DDName &name, std::unique_ptr< DDRotationMatrix > rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:80
ii
Definition: cuy.py:590
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 27 of file DDHCalAngular.cc.

References geant_units::operators::convertRadToDeg(), createfilelist::int, gen::n, DDCurrentNamespace::ns(), and class-composition::parent.

31  {
32 
33  startAngle = nArgs["startAngle"];
34  rangeAngle = nArgs["rangeAngle"];
35  shiftX = nArgs["shiftX"];
36  shiftY = nArgs["shiftY"];
37  zoffset = nArgs["zoffset"];
38  n = int (nArgs["n"]);
39  startCopyNo = int (nArgs["startCopyNo"]);
40  incrCopyNo = int (nArgs["incrCopyNo"]);
41 #ifdef EDM_ML_DEBUG
42  edm::LogVerbatim("HCalGeom") << "DDHCalAngular: Parameters for positioning "
43  << "-- " << n << " copies in "
44  << convertRadToDeg(rangeAngle) << " from "
45  << convertRadToDeg(startAngle) << "\tShifts "
46  << shiftX << ", " << shiftY
47  << " along x, y axes; \tZoffest " << zoffset
48  << "\tStart and inremental copy nos "
49  << startCopyNo << ", " << incrCopyNo;
50 #endif
51  rotns = sArgs["RotNameSpace"];
53  childName = sArgs["ChildName"];
54 #ifdef EDM_ML_DEBUG
55  DDName parentName = parent().name();
56  edm::LogVerbatim("HCalGeom") << "DDHCalAngular: Parent " << parentName
57  << "\tChild " << childName << "\tNameSpace "
58  << idNameSpace << "\tRotation Namespace "
59  << rotns;
60 #endif
61 }
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
constexpr NumType convertRadToDeg(NumType radians)
Definition: GeantUnits.h:98
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.

std::string DDHCalAngular::idNameSpace
private

Definition at line 36 of file DDHCalAngular.h.

int DDHCalAngular::incrCopyNo
private

Definition at line 33 of file DDHCalAngular.h.

int DDHCalAngular::n
private

Definition at line 31 of file DDHCalAngular.h.

double DDHCalAngular::rangeAngle
private

Definition at line 27 of file DDHCalAngular.h.

std::string DDHCalAngular::rotns
private

Definition at line 35 of file DDHCalAngular.h.

double DDHCalAngular::shiftX
private

Definition at line 29 of file DDHCalAngular.h.

double DDHCalAngular::shiftY
private

Definition at line 28 of file DDHCalAngular.h.

double DDHCalAngular::startAngle
private

Definition at line 26 of file DDHCalAngular.h.

int DDHCalAngular::startCopyNo
private

Definition at line 32 of file DDHCalAngular.h.

double DDHCalAngular::zoffset
private

Definition at line 30 of file DDHCalAngular.h.