CMS 3D CMS Logo

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

#include <DDHGCalNoTaperEndcap.h>

Inheritance diagram for DDHGCalNoTaperEndcap:

Public Member Functions

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

Private Member Functions

int createQuarter (DDCompactView &cpv, int xQuadrant, int yQuadrant, int startCopyNo)
 

Private Attributes

std::string m_childName
 
std::string m_idNameSpace
 
int m_incrCopyNo
 
int m_invert
 
int m_n
 
double m_rMax
 
double m_rMin
 
double m_startAngle
 
int m_startCopyNo
 
double m_tiltAngle
 
double m_xyoffset
 
double m_zoffset
 

Detailed Description

Definition at line 9 of file DDHGCalNoTaperEndcap.h.

Constructor & Destructor Documentation

DDHGCalNoTaperEndcap::DDHGCalNoTaperEndcap ( void  )

Definition at line 16 of file DDHGCalNoTaperEndcap.cc.

16  {
17  edm::LogVerbatim("HGCalGeom")
18  << "DDHGCalNoTaperEndcap test: Creating an instance";
19 }
DDHGCalNoTaperEndcap::~DDHGCalNoTaperEndcap ( void  )
override

Definition at line 21 of file DDHGCalNoTaperEndcap.cc.

21 {}

Member Function Documentation

int DDHGCalNoTaperEndcap::createQuarter ( DDCompactView cpv,
int  xQuadrant,
int  yQuadrant,
int  startCopyNo 
)
private

Definition at line 52 of file DDHGCalNoTaperEndcap.cc.

References funct::abs(), DDcreateRotationMatrix(), DDrot(), class-composition::parent, DDCompactView::position(), idealTransformation::rotation, mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, and theta().

53  {
54  int copyNo = startCopyNo;
55  double tiltAngle = m_tiltAngle;
56  double xphi = xQuadrant * tiltAngle;
57  double yphi = yQuadrant * tiltAngle;
58  double theta = 90._deg;
59  double phiX = 0.0;
60  double phiY = theta;
61  double phiZ = 3 * theta;
62  double offsetZ = m_zoffset;
63  double offsetXY = m_xyoffset;
64 
65  double offsetX = xQuadrant * 0.5 * offsetXY;
66  double offsetY = yQuadrant * 0.5 * offsetXY;
67 
68 #ifdef EDM_ML_DEBUG
69  int rowmax(0), column(0);
70 #endif
71  while (std::abs(offsetX) < m_rMax) {
72 #ifdef EDM_ML_DEBUG
73  column++;
74  int row(0);
75 #endif
76  while (std::abs(offsetY) < m_rMax) {
77 #ifdef EDM_ML_DEBUG
78  row++;
79 #endif
80  double limit1 = sqrt((offsetX + 0.5 * xQuadrant * offsetXY) *
81  (offsetX + 0.5 * xQuadrant * offsetXY) +
82  (offsetY + 0.5 * yQuadrant * offsetXY) *
83  (offsetY + 0.5 * yQuadrant * offsetXY));
84  double limit2 = sqrt((offsetX - 0.5 * xQuadrant * offsetXY) *
85  (offsetX - 0.5 * xQuadrant * offsetXY) +
86  (offsetY - 0.5 * yQuadrant * offsetXY) *
87  (offsetY - 0.5 * yQuadrant * offsetXY));
88  // Make sure we do not add supermodules in rMin area
89  if (limit2 > m_rMin && limit1 < m_rMax) {
90 #ifdef EDM_ML_DEBUG
91  edm::LogVerbatim("HGCalGeom")
92  << m_childName << " copyNo = " << copyNo << " (" << column
93  << "," << row << "): offsetX,Y = " << offsetX << ","
94  << offsetY << " limit=" << limit1 << ":" << limit2
95  << " rMin, rMax = " << m_rMin << "," << m_rMax;
96 #endif
98  std::string rotstr("NULL");
99 
100  // Check if we've already created the rotation matrix
101  rotstr = "R";
102  rotstr += std::to_string(copyNo);
103  rotation = DDRotation(DDName(rotstr));
104  if (!rotation) {
105  rotation = DDrot(
106  DDName(rotstr, m_idNameSpace),
107  std::make_unique<DDRotationMatrix>(
108  *DDcreateRotationMatrix(theta, phiX, theta + yphi, phiY,
109  -yphi, phiZ) *
110  (*DDcreateRotationMatrix(theta + xphi, phiX, 90._deg,
111  90._deg, xphi, 0.0))));
112  }
113 
114  DDTranslation tran(offsetX, offsetY, offsetZ);
115  edm::LogVerbatim("HGCalGeom")
116  << "Module " << copyNo << ": location = " << tran << " Rotation "
117  << rotation;
118 
119  DDName parentName = parent().name();
120  cpv.position(DDName(m_childName), parentName, copyNo, tran, rotation);
121 
122  copyNo += m_incrCopyNo;
123  } else {
124 #ifdef EDM_ML_DEBUG
125  edm::LogVerbatim("HGCalGeom")
126  << " (" << column << "," << row << "): offsetX,Y = " << offsetX
127  << "," << offsetY << " is out of limit=" << limit1 << ":" << limit2
128  << " rMin, rMax = " << m_rMin << "," << m_rMax;
129 #endif
130  }
131 
132  yphi += yQuadrant * 2. * tiltAngle;
133  offsetY += yQuadrant * offsetXY;
134  }
135 #ifdef EDM_ML_DEBUG
136  if (row > rowmax) rowmax = row;
137 #endif
138  xphi += xQuadrant * 2. * tiltAngle;
139  yphi = yQuadrant * tiltAngle;
140  offsetY = yQuadrant * 0.5 * offsetXY;
141  offsetX += xQuadrant * offsetXY;
142  }
143 #ifdef EDM_ML_DEBUG
144  edm::LogVerbatim("HGCalGeom")
145  << rowmax << " rows and " << column << " columns in quadrant "
146  << xQuadrant << ":" << yQuadrant;
147 #endif
148  return copyNo;
149 }
Geom::Theta< T > theta() const
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:68
T sqrt(T t)
Definition: SSEVec.h:18
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
std::unique_ptr< DDRotationMatrix > DDcreateRotationMatrix(double thetaX, double phiX, double thetaY, double phiY, double thetaZ, double phiZ)
create a new DDRotationMatrix in the GEANT3 style.
Definition: DDRotation.cc:149
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
void DDHGCalNoTaperEndcap::execute ( DDCompactView cpv)
override

Definition at line 44 of file DDHGCalNoTaperEndcap.cc.

44  {
45  int lastCopyNo = m_startCopyNo;
46  lastCopyNo = createQuarter(cpv, 1, 1, lastCopyNo);
47  lastCopyNo = createQuarter(cpv, -1, 1, lastCopyNo);
48  lastCopyNo = createQuarter(cpv, -1, -1, lastCopyNo);
49  createQuarter(cpv, 1, -1, lastCopyNo);
50 }
int createQuarter(DDCompactView &cpv, int xQuadrant, int yQuadrant, int startCopyNo)
void DDHGCalNoTaperEndcap::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 23 of file DDHGCalNoTaperEndcap.cc.

References createfilelist::int, DDCurrentNamespace::ns(), and class-composition::parent.

27  {
28  m_tiltAngle = nArgs["tiltAngle"];
29  m_invert = int(nArgs["invert"]);
30  m_rMin = int(nArgs["rMin"]);
31  m_rMax = int(nArgs["rMax"]);
32  m_zoffset = nArgs["zoffset"];
33  m_xyoffset = nArgs["xyoffset"];
34  m_n = int(nArgs["n"]);
35  m_startCopyNo = int(nArgs["startCopyNo"]);
36  m_incrCopyNo = int(nArgs["incrCopyNo"]);
37  m_childName = sArgs["ChildName"];
39  edm::LogVerbatim("HGCalGeom")
40  << "DDHGCalNoTaperEndcap: NameSpace " << m_idNameSpace << "\tParent "
41  << parent().name();
42 }
static std::string & ns()

Member Data Documentation

std::string DDHGCalNoTaperEndcap::m_childName
private

Definition at line 35 of file DDHGCalNoTaperEndcap.h.

std::string DDHGCalNoTaperEndcap::m_idNameSpace
private

Definition at line 36 of file DDHGCalNoTaperEndcap.h.

int DDHGCalNoTaperEndcap::m_incrCopyNo
private

Definition at line 34 of file DDHGCalNoTaperEndcap.h.

int DDHGCalNoTaperEndcap::m_invert
private

Definition at line 27 of file DDHGCalNoTaperEndcap.h.

int DDHGCalNoTaperEndcap::m_n
private

Definition at line 32 of file DDHGCalNoTaperEndcap.h.

double DDHGCalNoTaperEndcap::m_rMax
private

Definition at line 29 of file DDHGCalNoTaperEndcap.h.

double DDHGCalNoTaperEndcap::m_rMin
private

Definition at line 28 of file DDHGCalNoTaperEndcap.h.

double DDHGCalNoTaperEndcap::m_startAngle
private

Definition at line 25 of file DDHGCalNoTaperEndcap.h.

int DDHGCalNoTaperEndcap::m_startCopyNo
private

Definition at line 33 of file DDHGCalNoTaperEndcap.h.

double DDHGCalNoTaperEndcap::m_tiltAngle
private

Definition at line 26 of file DDHGCalNoTaperEndcap.h.

double DDHGCalNoTaperEndcap::m_xyoffset
private

Definition at line 31 of file DDHGCalNoTaperEndcap.h.

double DDHGCalNoTaperEndcap::m_zoffset
private

Definition at line 30 of file DDHGCalNoTaperEndcap.h.