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

17  {
18  edm::LogInfo("HGCalGeom") << "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(), gather_cfg::cout, DDcreateRotationMatrix(), DDrot(), m_childName, m_idNameSpace, m_incrCopyNo, m_rMax, m_rMin, m_tiltAngle, m_xyoffset, m_zoffset, class-composition::parent, DDCompactView::position(), idealTransformation::rotation, mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, and theta().

Referenced by execute().

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

Definition at line 43 of file DDHGCalNoTaperEndcap.cc.

References createQuarter(), and m_startCopyNo.

43  {
44  int lastCopyNo = m_startCopyNo;
45  lastCopyNo = createQuarter( cpv, 1, 1, lastCopyNo );
46  lastCopyNo = createQuarter( cpv, -1, 1, lastCopyNo );
47  lastCopyNo = createQuarter( cpv, -1, -1, lastCopyNo );
48  createQuarter( cpv, 1, -1, lastCopyNo );
49 }
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, m_childName, m_idNameSpace, m_incrCopyNo, m_invert, m_n, m_rMax, m_rMin, m_startCopyNo, m_tiltAngle, m_xyoffset, m_zoffset, 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::LogInfo("HGCalGeom") << "DDHGCalNoTaperEndcap: NameSpace " << m_idNameSpace
40  << "\tParent " << parent().name();
41 }
static std::string & ns()

Member Data Documentation

std::string DDHGCalNoTaperEndcap::m_childName
private

Definition at line 37 of file DDHGCalNoTaperEndcap.h.

Referenced by createQuarter(), and initialize().

std::string DDHGCalNoTaperEndcap::m_idNameSpace
private

Definition at line 38 of file DDHGCalNoTaperEndcap.h.

Referenced by createQuarter(), and initialize().

int DDHGCalNoTaperEndcap::m_incrCopyNo
private

Definition at line 36 of file DDHGCalNoTaperEndcap.h.

Referenced by createQuarter(), and initialize().

int DDHGCalNoTaperEndcap::m_invert
private

Definition at line 29 of file DDHGCalNoTaperEndcap.h.

Referenced by initialize().

int DDHGCalNoTaperEndcap::m_n
private

Definition at line 34 of file DDHGCalNoTaperEndcap.h.

Referenced by initialize().

double DDHGCalNoTaperEndcap::m_rMax
private

Definition at line 31 of file DDHGCalNoTaperEndcap.h.

Referenced by createQuarter(), and initialize().

double DDHGCalNoTaperEndcap::m_rMin
private

Definition at line 30 of file DDHGCalNoTaperEndcap.h.

Referenced by createQuarter(), and initialize().

double DDHGCalNoTaperEndcap::m_startAngle
private

Definition at line 27 of file DDHGCalNoTaperEndcap.h.

int DDHGCalNoTaperEndcap::m_startCopyNo
private

Definition at line 35 of file DDHGCalNoTaperEndcap.h.

Referenced by execute(), and initialize().

double DDHGCalNoTaperEndcap::m_tiltAngle
private

Definition at line 28 of file DDHGCalNoTaperEndcap.h.

Referenced by createQuarter(), and initialize().

double DDHGCalNoTaperEndcap::m_xyoffset
private

Definition at line 33 of file DDHGCalNoTaperEndcap.h.

Referenced by createQuarter(), and initialize().

double DDHGCalNoTaperEndcap::m_zoffset
private

Definition at line 32 of file DDHGCalNoTaperEndcap.h.

Referenced by createQuarter(), and initialize().