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 }
Log< level::Info, true > LogVerbatim

◆ ~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.

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

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 }
Log< level::Info, true > LogVerbatim
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
std::string rotns
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
std::string formatAsDegreesInInteger(double radianVal)
Definition: DDTypes.cc:79
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
std::string childName
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:67
ii
Definition: cuy.py:589
std::string idNameSpace
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7

◆ 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.

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

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 }
Log< level::Info, true > LogVerbatim
std::string rotns
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
static std::string & ns()
std::string childName
std::string idNameSpace

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.

Referenced by output.OutputBranch::fill().

◆ 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.