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

Constructor & Destructor Documentation

◆ DDHGCalNoTaperEndcap()

DDHGCalNoTaperEndcap::DDHGCalNoTaperEndcap ( void  )

Definition at line 51 of file DDHGCalNoTaperEndcap.cc.

51  {
52  edm::LogVerbatim("HGCalGeom") << "DDHGCalNoTaperEndcap test: Creating an instance";
53 }

◆ ~DDHGCalNoTaperEndcap()

DDHGCalNoTaperEndcap::~DDHGCalNoTaperEndcap ( void  )
override

Definition at line 55 of file DDHGCalNoTaperEndcap.cc.

55 {}

Member Function Documentation

◆ createQuarter()

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

Definition at line 85 of file DDHGCalNoTaperEndcap.cc.

85  {
86  int copyNo = startCopyNo;
87  double tiltAngle = m_tiltAngle;
88  double xphi = xQuadrant * tiltAngle;
89  double yphi = yQuadrant * tiltAngle;
90  double theta = 90._deg;
91  double phiX = 0.0;
92  double phiY = theta;
93  double phiZ = 3 * theta;
94  double offsetZ = m_zoffset;
95  double offsetXY = m_xyoffset;
96 
97  double offsetX = xQuadrant * 0.5 * offsetXY;
98  double offsetY = yQuadrant * 0.5 * offsetXY;
99 
100 #ifdef EDM_ML_DEBUG
101  int rowmax(0), column(0);
102 #endif
103  while (std::abs(offsetX) < m_rMax) {
104 #ifdef EDM_ML_DEBUG
105  column++;
106  int row(0);
107 #endif
108  while (std::abs(offsetY) < m_rMax) {
109 #ifdef EDM_ML_DEBUG
110  row++;
111 #endif
112  double limit1 = sqrt((offsetX + 0.5 * xQuadrant * offsetXY) * (offsetX + 0.5 * xQuadrant * offsetXY) +
113  (offsetY + 0.5 * yQuadrant * offsetXY) * (offsetY + 0.5 * yQuadrant * offsetXY));
114  double limit2 = sqrt((offsetX - 0.5 * xQuadrant * offsetXY) * (offsetX - 0.5 * xQuadrant * offsetXY) +
115  (offsetY - 0.5 * yQuadrant * offsetXY) * (offsetY - 0.5 * yQuadrant * offsetXY));
116  // Make sure we do not add supermodules in rMin area
117  if (limit2 > m_rMin && limit1 < m_rMax) {
118 #ifdef EDM_ML_DEBUG
119  edm::LogVerbatim("HGCalGeom") << m_childName << " copyNo = " << copyNo << " (" << column << "," << row
120  << "): offsetX,Y = " << offsetX << "," << offsetY << " limit=" << limit1 << ":"
121  << limit2 << " rMin, rMax = " << m_rMin << "," << m_rMax;
122 #endif
124  std::string rotstr("NULL");
125 
126  // Check if we've already created the rotation matrix
127  rotstr = "R";
128  rotstr += std::to_string(copyNo);
129  rotation = DDRotation(DDName(rotstr));
130  if (!rotation) {
131  rotation = DDrot(DDName(rotstr, m_idNameSpace),
132  std::make_unique<DDRotationMatrix>(
133  *DDcreateRotationMatrix(theta, phiX, theta + yphi, phiY, -yphi, phiZ) *
134  (*DDcreateRotationMatrix(theta + xphi, phiX, 90._deg, 90._deg, xphi, 0.0))));
135  }
136 
137  DDTranslation tran(offsetX, offsetY, offsetZ);
138  edm::LogVerbatim("HGCalGeom") << "Module " << copyNo << ": location = " << tran << " Rotation " << rotation;
139 
140  DDName parentName = parent().name();
141  cpv.position(DDName(m_childName), parentName, copyNo, tran, rotation);
142 
143  copyNo += m_incrCopyNo;
144  } else {
145 #ifdef EDM_ML_DEBUG
146  edm::LogVerbatim("HGCalGeom") << " (" << column << "," << row << "): offsetX,Y = " << offsetX << "," << offsetY
147  << " is out of limit=" << limit1 << ":" << limit2 << " rMin, rMax = " << m_rMin
148  << "," << m_rMax;
149 #endif
150  }
151 
152  yphi += yQuadrant * 2. * tiltAngle;
153  offsetY += yQuadrant * offsetXY;
154  }
155 #ifdef EDM_ML_DEBUG
156  if (row > rowmax)
157  rowmax = row;
158 #endif
159  xphi += xQuadrant * 2. * tiltAngle;
160  yphi = yQuadrant * tiltAngle;
161  offsetY = yQuadrant * 0.5 * offsetXY;
162  offsetX += xQuadrant * offsetXY;
163  }
164 #ifdef EDM_ML_DEBUG
165  edm::LogVerbatim("HGCalGeom") << rowmax << " rows and " << column << " columns in quadrant " << xQuadrant << ":"
166  << yQuadrant;
167 #endif
168  return copyNo;
169 }

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

◆ execute()

void DDHGCalNoTaperEndcap::execute ( DDCompactView cpv)
override

Definition at line 77 of file DDHGCalNoTaperEndcap.cc.

77  {
78  int lastCopyNo = m_startCopyNo;
79  lastCopyNo = createQuarter(cpv, 1, 1, lastCopyNo);
80  lastCopyNo = createQuarter(cpv, -1, 1, lastCopyNo);
81  lastCopyNo = createQuarter(cpv, -1, -1, lastCopyNo);
82  createQuarter(cpv, 1, -1, lastCopyNo);
83 }

◆ initialize()

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

Definition at line 57 of file DDHGCalNoTaperEndcap.cc.

61  {
62  m_tiltAngle = nArgs["tiltAngle"];
63  m_invert = int(nArgs["invert"]);
64  m_rMin = int(nArgs["rMin"]);
65  m_rMax = int(nArgs["rMax"]);
66  m_zoffset = nArgs["zoffset"];
67  m_xyoffset = nArgs["xyoffset"];
68  m_n = int(nArgs["n"]);
69  m_startCopyNo = int(nArgs["startCopyNo"]);
70  m_incrCopyNo = int(nArgs["incrCopyNo"]);
71  m_childName = sArgs["ChildName"];
73  edm::LogVerbatim("HGCalGeom") << "DDHGCalNoTaperEndcap: NameSpace " << m_idNameSpace << "\tParent "
74  << parent().name();
75 }

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

Member Data Documentation

◆ m_childName

std::string DDHGCalNoTaperEndcap::m_childName
private

Definition at line 47 of file DDHGCalNoTaperEndcap.cc.

◆ m_idNameSpace

std::string DDHGCalNoTaperEndcap::m_idNameSpace
private

Definition at line 48 of file DDHGCalNoTaperEndcap.cc.

◆ m_incrCopyNo

int DDHGCalNoTaperEndcap::m_incrCopyNo
private

Definition at line 46 of file DDHGCalNoTaperEndcap.cc.

◆ m_invert

int DDHGCalNoTaperEndcap::m_invert
private

Definition at line 39 of file DDHGCalNoTaperEndcap.cc.

◆ m_n

int DDHGCalNoTaperEndcap::m_n
private

Definition at line 44 of file DDHGCalNoTaperEndcap.cc.

◆ m_rMax

double DDHGCalNoTaperEndcap::m_rMax
private

Definition at line 41 of file DDHGCalNoTaperEndcap.cc.

◆ m_rMin

double DDHGCalNoTaperEndcap::m_rMin
private

Definition at line 40 of file DDHGCalNoTaperEndcap.cc.

◆ m_startAngle

double DDHGCalNoTaperEndcap::m_startAngle
private

Definition at line 37 of file DDHGCalNoTaperEndcap.cc.

◆ m_startCopyNo

int DDHGCalNoTaperEndcap::m_startCopyNo
private

Definition at line 45 of file DDHGCalNoTaperEndcap.cc.

◆ m_tiltAngle

double DDHGCalNoTaperEndcap::m_tiltAngle
private

Definition at line 38 of file DDHGCalNoTaperEndcap.cc.

◆ m_xyoffset

double DDHGCalNoTaperEndcap::m_xyoffset
private

Definition at line 43 of file DDHGCalNoTaperEndcap.cc.

◆ m_zoffset

double DDHGCalNoTaperEndcap::m_zoffset
private

Definition at line 42 of file DDHGCalNoTaperEndcap.cc.

DDHGCalNoTaperEndcap::m_n
int m_n
Definition: DDHGCalNoTaperEndcap.cc:44
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:15
DDHGCalNoTaperEndcap::m_tiltAngle
double m_tiltAngle
Definition: DDHGCalNoTaperEndcap.cc:38
DDHGCalNoTaperEndcap::m_startCopyNo
int m_startCopyNo
Definition: DDHGCalNoTaperEndcap.cc:45
DDHGCalNoTaperEndcap::m_rMin
double m_rMin
Definition: DDHGCalNoTaperEndcap.cc:40
DDTranslation
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
theta
Geom::Theta< T > theta() const
Definition: Basic3DVectorLD.h:150
DDHGCalNoTaperEndcap::m_incrCopyNo
int m_incrCopyNo
Definition: DDHGCalNoTaperEndcap.cc:46
DDHGCalNoTaperEndcap::createQuarter
int createQuarter(DDCompactView &cpv, int xQuadrant, int yQuadrant, int startCopyNo)
Definition: DDHGCalNoTaperEndcap.cc:85
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DDHGCalNoTaperEndcap::m_invert
int m_invert
Definition: DDHGCalNoTaperEndcap.cc:39
idealTransformation.rotation
dictionary rotation
Definition: idealTransformation.py:1
DDHGCalNoTaperEndcap::m_zoffset
double m_zoffset
Definition: DDHGCalNoTaperEndcap.cc:42
createfilelist.int
int
Definition: createfilelist.py:10
edm::LogVerbatim
Definition: MessageLogger.h:297
DDHGCalNoTaperEndcap::m_childName
std::string m_childName
Definition: DDHGCalNoTaperEndcap.cc:47
DDCurrentNamespace::ns
static std::string & ns()
Definition: DDCurrentNamespace.cc:3
DDRotation
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
DDHGCalNoTaperEndcap::m_idNameSpace
std::string m_idNameSpace
Definition: DDHGCalNoTaperEndcap.cc:48
DDcreateRotationMatrix
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
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
DDHGCalNoTaperEndcap::m_rMax
double m_rMax
Definition: DDHGCalNoTaperEndcap.cc:41
DDHGCalNoTaperEndcap::m_xyoffset
double m_xyoffset
Definition: DDHGCalNoTaperEndcap.cc:43
class-composition.parent
parent
Definition: class-composition.py:88
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:66
DDRotation
ROOT::Math::Rotation3D DDRotation
Definition: DDEcalEndcapAlgo.cc:18