CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
DDHGCalNoTaperEndcap Class Reference
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
 

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 21 of file DDHGCalNoTaperEndcap.cc.

Constructor & Destructor Documentation

◆ DDHGCalNoTaperEndcap()

DDHGCalNoTaperEndcap::DDHGCalNoTaperEndcap ( void  )

Definition at line 50 of file DDHGCalNoTaperEndcap.cc.

50  {
51  edm::LogVerbatim("HGCalGeom") << "DDHGCalNoTaperEndcap test: Creating an instance";
52 }
Log< level::Info, true > LogVerbatim

Member Function Documentation

◆ createQuarter()

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

Definition at line 102 of file DDHGCalNoTaperEndcap.cc.

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

102  {
103  int copyNo = startCopyNo;
104  double tiltAngle = m_tiltAngle;
105  double xphi = xQuadrant * tiltAngle;
106  double yphi = yQuadrant * tiltAngle;
107  double theta = 90._deg;
108  double phiX = 0.0;
109  double phiY = theta;
110  double phiZ = 3 * theta;
111  double offsetZ = m_zoffset;
112  double offsetXY = m_xyoffset;
113 
114  double offsetX = xQuadrant * 0.5 * offsetXY;
115  double offsetY = yQuadrant * 0.5 * offsetXY;
116 
117 #ifdef EDM_ML_DEBUG
118  int rowmax(0), column(0);
119 #endif
120  while (std::abs(offsetX) < m_rMax) {
121 #ifdef EDM_ML_DEBUG
122  column++;
123  int row(0);
124 #endif
125  while (std::abs(offsetY) < m_rMax) {
126 #ifdef EDM_ML_DEBUG
127  row++;
128 #endif
129  double limit1 = sqrt((offsetX + 0.5 * xQuadrant * offsetXY) * (offsetX + 0.5 * xQuadrant * offsetXY) +
130  (offsetY + 0.5 * yQuadrant * offsetXY) * (offsetY + 0.5 * yQuadrant * offsetXY));
131  double limit2 = sqrt((offsetX - 0.5 * xQuadrant * offsetXY) * (offsetX - 0.5 * xQuadrant * offsetXY) +
132  (offsetY - 0.5 * yQuadrant * offsetXY) * (offsetY - 0.5 * yQuadrant * offsetXY));
133  // Make sure we do not add supermodules in rMin area
134  if (limit2 > m_rMin && limit1 < m_rMax) {
135 #ifdef EDM_ML_DEBUG
136  edm::LogVerbatim("HGCalGeom") << m_childName << " copyNo = " << copyNo << " (" << column << "," << row
137  << "): offsetX,Y = " << offsetX << "," << offsetY << " limit=" << limit1 << ":"
138  << limit2 << " rMin, rMax = " << m_rMin << "," << m_rMax;
139 #endif
141  std::string rotstr("NULL");
142 
143  // Check if we've already created the rotation matrix
144  rotstr = "R";
145  rotstr += std::to_string(copyNo);
146  rotation = DDRotation(DDName(rotstr));
147  if (!rotation) {
148  rotation = DDrot(DDName(rotstr, m_idNameSpace),
149  std::make_unique<DDRotationMatrix>(
150  *DDcreateRotationMatrix(theta, phiX, theta + yphi, phiY, -yphi, phiZ) *
151  (*DDcreateRotationMatrix(theta + xphi, phiX, 90._deg, 90._deg, xphi, 0.0))));
152  }
153 
154  DDTranslation tran(offsetX, offsetY, offsetZ);
155 #ifdef EDM_ML_DEBUG
156  edm::LogVerbatim("HGCalGeom") << "Module " << copyNo << ": location = " << tran << " Rotation " << rotation;
157 #endif
158  DDName parentName = parent().name();
159  cpv.position(DDName(m_childName), parentName, copyNo, tran, rotation);
160 
161  copyNo += m_incrCopyNo;
162  } else {
163 #ifdef EDM_ML_DEBUG
164  edm::LogVerbatim("HGCalGeom") << " (" << column << "," << row << "): offsetX,Y = " << offsetX << "," << offsetY
165  << " is out of limit=" << limit1 << ":" << limit2 << " rMin, rMax = " << m_rMin
166  << "," << m_rMax;
167 #endif
168  }
169 
170  yphi += yQuadrant * 2. * tiltAngle;
171  offsetY += yQuadrant * offsetXY;
172  }
173 #ifdef EDM_ML_DEBUG
174  if (row > rowmax)
175  rowmax = row;
176 #endif
177  xphi += xQuadrant * 2. * tiltAngle;
178  yphi = yQuadrant * tiltAngle;
179  offsetY = yQuadrant * 0.5 * offsetXY;
180  offsetX += xQuadrant * offsetXY;
181  }
182 #ifdef EDM_ML_DEBUG
183  edm::LogVerbatim("HGCalGeom") << rowmax << " rows and " << column << " columns in quadrant " << xQuadrant << ":"
184  << yQuadrant;
185 #endif
186  return copyNo;
187 }
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)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
static std::string to_string(const XMLCh *ch)
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
T sqrt(T t)
Definition: SSEVec.h:19
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
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:120
Geom::Theta< T > theta() const
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7

◆ execute()

void DDHGCalNoTaperEndcap::execute ( DDCompactView cpv)
override

Definition at line 82 of file DDHGCalNoTaperEndcap.cc.

82  {
83  int lastCopyNo = m_startCopyNo;
84 #ifdef EDM_ML_DEBUG
85  edm::LogVerbatim("HGCalGeom") << "Create quarter 1:1";
86 #endif
87  lastCopyNo = createQuarter(cpv, 1, 1, lastCopyNo);
88 #ifdef EDM_ML_DEBUG
89  edm::LogVerbatim("HGCalGeom") << "Create quarter -1:1";
90 #endif
91  lastCopyNo = createQuarter(cpv, -1, 1, lastCopyNo);
92 #ifdef EDM_ML_DEBUG
93  edm::LogVerbatim("HGCalGeom") << "Create quarter -1:-1";
94 #endif
95  lastCopyNo = createQuarter(cpv, -1, -1, lastCopyNo);
96 #ifdef EDM_ML_DEBUG
97  edm::LogVerbatim("HGCalGeom") << "Create quarter 1:-1";
98 #endif
99  createQuarter(cpv, 1, -1, lastCopyNo);
100 }
Log< level::Info, true > LogVerbatim
int createQuarter(DDCompactView &cpv, int xQuadrant, int yQuadrant, int startCopyNo)

◆ initialize()

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

Definition at line 54 of file DDHGCalNoTaperEndcap.cc.

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

58  {
59  m_tiltAngle = nArgs["tiltAngle"];
60  m_invert = int(nArgs["invert"]);
61  m_rMin = int(nArgs["rMin"]);
62  m_rMax = int(nArgs["rMax"]);
63  m_zoffset = nArgs["zoffset"];
64  m_xyoffset = nArgs["xyoffset"];
65  m_n = int(nArgs["n"]);
66  m_startCopyNo = int(nArgs["startCopyNo"]);
67  m_incrCopyNo = int(nArgs["incrCopyNo"]);
68  m_childName = sArgs["ChildName"];
69 #ifdef EDM_ML_DEBUG
70  edm::LogVerbatim("HGCalGeom") << "Tilt Angle " << m_tiltAngle << " Invert " << m_invert << " R " << m_rMin << ":"
71  << m_rMax << " Offset " << m_zoffset << ":" << m_xyoffset << " N " << m_n << " Copy "
72  << m_startCopyNo << ":" << m_incrCopyNo << " Child " << m_childName;
73 #endif
74 
76 #ifdef EDM_ML_DEBUG
77  edm::LogVerbatim("HGCalGeom") << "DDHGCalNoTaperEndcap: NameSpace " << m_idNameSpace << "\tParent "
78  << parent().name();
79 #endif
80 }
Log< level::Info, true > LogVerbatim
static std::string & ns()

Member Data Documentation

◆ m_childName

std::string DDHGCalNoTaperEndcap::m_childName
private

Definition at line 46 of file DDHGCalNoTaperEndcap.cc.

◆ m_idNameSpace

std::string DDHGCalNoTaperEndcap::m_idNameSpace
private

Definition at line 47 of file DDHGCalNoTaperEndcap.cc.

◆ m_incrCopyNo

int DDHGCalNoTaperEndcap::m_incrCopyNo
private

Definition at line 45 of file DDHGCalNoTaperEndcap.cc.

◆ m_invert

int DDHGCalNoTaperEndcap::m_invert
private

Definition at line 38 of file DDHGCalNoTaperEndcap.cc.

◆ m_n

int DDHGCalNoTaperEndcap::m_n
private

Definition at line 43 of file DDHGCalNoTaperEndcap.cc.

◆ m_rMax

double DDHGCalNoTaperEndcap::m_rMax
private

Definition at line 40 of file DDHGCalNoTaperEndcap.cc.

◆ m_rMin

double DDHGCalNoTaperEndcap::m_rMin
private

Definition at line 39 of file DDHGCalNoTaperEndcap.cc.

◆ m_startAngle

double DDHGCalNoTaperEndcap::m_startAngle
private

Definition at line 36 of file DDHGCalNoTaperEndcap.cc.

◆ m_startCopyNo

int DDHGCalNoTaperEndcap::m_startCopyNo
private

Definition at line 44 of file DDHGCalNoTaperEndcap.cc.

◆ m_tiltAngle

double DDHGCalNoTaperEndcap::m_tiltAngle
private

Definition at line 37 of file DDHGCalNoTaperEndcap.cc.

◆ m_xyoffset

double DDHGCalNoTaperEndcap::m_xyoffset
private

Definition at line 42 of file DDHGCalNoTaperEndcap.cc.

◆ m_zoffset

double DDHGCalNoTaperEndcap::m_zoffset
private

Definition at line 41 of file DDHGCalNoTaperEndcap.cc.