CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DDHCalAngular Class Reference
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 24 of file DDHCalAngular.cc.

Constructor & Destructor Documentation

◆ DDHCalAngular()

DDHCalAngular::DDHCalAngular ( )

Definition at line 53 of file DDHCalAngular.cc.

53  {
54 #ifdef EDM_ML_DEBUG
55  edm::LogVerbatim("HCalGeom") << "DDHCalAngular: Creating an instance";
56 #endif
57 }

◆ ~DDHCalAngular()

DDHCalAngular::~DDHCalAngular ( )
override

Definition at line 59 of file DDHCalAngular.cc.

59 {}

Member Function Documentation

◆ execute()

void DDHCalAngular::execute ( DDCompactView cpv)
override

Definition at line 91 of file DDHCalAngular.cc.

91  {
92  double dphi = rangeAngle / n;
93  double phix = startAngle;
94  int copyNo = startCopyNo;
95  double theta = 90._deg;
96  for (int ii = 0; ii < n; ii++) {
97  double phiy = phix + 90._deg;
99  std::string rotstr("NULL");
100 
101  static const double tol = 0.1;
102  if (std::abs(phix) > tol) {
103  rotstr = "R" + formatAsDegreesInInteger(phix);
104  rotation = DDRotation(DDName(rotstr, rotns));
105  if (!rotation) {
106 #ifdef EDM_ML_DEBUG
107  edm::LogVerbatim("HCalGeom") << "DDHCalAngular: Creating a rotation " << DDName(rotstr, idNameSpace) << "\t90, "
108  << convertRadToDeg(phix) << ", 90, " << (90 + convertRadToDeg(phix)) << ", 0, 0";
109 #endif
110  rotation = DDrot(DDName(rotstr, rotns), theta, phix, theta, phiy, 0, 0);
111  }
112  }
113 
114  double xpos = shiftX * cos(phix) - shiftY * sin(phix);
115  double ypos = shiftX * sin(phix) + shiftY * cos(phix);
116  DDTranslation tran(xpos, ypos, zoffset);
117 
118  DDName parentName = parent().name();
119  cpv.position(DDName(childName, idNameSpace), parentName, copyNo, tran, rotation);
120 #ifdef EDM_ML_DEBUG
121  edm::LogVerbatim("HCalGeom") << "DDHCalAngular: " << DDName(childName, idNameSpace) << " number " << copyNo
122  << " positioned in " << parentName << " at " << tran << " with " << rotation;
123 #endif
124  phix += dphi;
125  copyNo += incrCopyNo;
126  }
127 }

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

◆ initialize()

void DDHCalAngular::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 61 of file DDHCalAngular.cc.

65  {
66  startAngle = nArgs["startAngle"];
67  rangeAngle = nArgs["rangeAngle"];
68  shiftX = nArgs["shiftX"];
69  shiftY = nArgs["shiftY"];
70  zoffset = nArgs["zoffset"];
71  n = int(nArgs["n"]);
72  startCopyNo = int(nArgs["startCopyNo"]);
73  incrCopyNo = int(nArgs["incrCopyNo"]);
74 #ifdef EDM_ML_DEBUG
75  edm::LogVerbatim("HCalGeom") << "DDHCalAngular: Parameters for positioning "
76  << "-- " << n << " copies in " << convertRadToDeg(rangeAngle) << " from "
77  << convertRadToDeg(startAngle) << "\tShifts " << shiftX << ", " << shiftY
78  << " along x, y axes; \tZoffest " << zoffset << "\tStart and inremental copy nos "
79  << startCopyNo << ", " << incrCopyNo;
80 #endif
81  rotns = sArgs["RotNameSpace"];
83  childName = sArgs["ChildName"];
84 #ifdef EDM_ML_DEBUG
85  DDName parentName = parent().name();
86  edm::LogVerbatim("HCalGeom") << "DDHCalAngular: Parent " << parentName << "\tChild " << childName << "\tNameSpace "
87  << idNameSpace << "\tRotation Namespace " << rotns;
88 #endif
89 }

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

Member Data Documentation

◆ childName

std::string DDHCalAngular::childName
private

Definition at line 50 of file DDHCalAngular.cc.

◆ idNameSpace

std::string DDHCalAngular::idNameSpace
private

Definition at line 49 of file DDHCalAngular.cc.

◆ incrCopyNo

int DDHCalAngular::incrCopyNo
private

Definition at line 46 of file DDHCalAngular.cc.

◆ n

int DDHCalAngular::n
private

Definition at line 44 of file DDHCalAngular.cc.

◆ rangeAngle

double DDHCalAngular::rangeAngle
private

Definition at line 40 of file DDHCalAngular.cc.

◆ rotns

std::string DDHCalAngular::rotns
private

Definition at line 48 of file DDHCalAngular.cc.

◆ shiftX

double DDHCalAngular::shiftX
private

Definition at line 42 of file DDHCalAngular.cc.

◆ shiftY

double DDHCalAngular::shiftY
private

Definition at line 41 of file DDHCalAngular.cc.

◆ startAngle

double DDHCalAngular::startAngle
private

Definition at line 39 of file DDHCalAngular.cc.

◆ startCopyNo

int DDHCalAngular::startCopyNo
private

Definition at line 45 of file DDHCalAngular.cc.

◆ zoffset

double DDHCalAngular::zoffset
private

Definition at line 43 of file DDHCalAngular.cc.

DDHCalAngular::idNameSpace
std::string idNameSpace
Definition: DDHCalAngular.cc:49
DDrot
DDRotation DDrot(const DDName &name, std::unique_ptr< DDRotationMatrix > rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:67
DDName
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
DDHCalAngular::shiftY
double shiftY
Definition: DDHCalAngular.cc:41
angle_units::operators::convertRadToDeg
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
formatAsDegreesInInteger
std::string formatAsDegreesInInteger(double radianVal)
Definition: DDTypes.cc:79
DDHCalAngular::startAngle
double startAngle
Definition: DDHCalAngular.cc:39
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
DDTranslation
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
DDHCalAngular::rotns
std::string rotns
Definition: DDHCalAngular.cc:48
theta
Geom::Theta< T > theta() const
Definition: Basic3DVectorLD.h:150
DDHCalAngular::zoffset
double zoffset
Definition: DDHCalAngular.cc:43
idealTransformation.rotation
dictionary rotation
Definition: idealTransformation.py:1
DDHCalAngular::shiftX
double shiftX
Definition: DDHCalAngular.cc:42
createfilelist.int
int
Definition: createfilelist.py:10
DDHCalAngular::incrCopyNo
int incrCopyNo
Definition: DDHCalAngular.cc:46
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DDHCalAngular::childName
std::string childName
Definition: DDHCalAngular.cc:50
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
DDCurrentNamespace::ns
static std::string & ns()
Definition: DDCurrentNamespace.cc:3
DDHCalAngular::rangeAngle
double rangeAngle
Definition: DDHCalAngular.cc:40
DDHCalAngular::startCopyNo
int startCopyNo
Definition: DDHCalAngular.cc:45
DDRotation
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
DDHCalAngular::n
int n
Definition: DDHCalAngular.cc:44
class-composition.parent
parent
Definition: class-composition.py:98
cuy.ii
ii
Definition: cuy.py:589
DDCompactView::position
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
Definition: DDCompactView.cc:76