CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 
void initialize (const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs)
 
virtual ~DDHGCalNoTaperEndcap (void)
 

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

18  {
19  edm::LogInfo("HGCalGeom") << "DDHGCalNoTaperEndcap test: Creating an instance";
20 }
DDHGCalNoTaperEndcap::~DDHGCalNoTaperEndcap ( void  )
virtual

Definition at line 22 of file DDHGCalNoTaperEndcap.cc.

22 {}

Member Function Documentation

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

Definition at line 53 of file DDHGCalNoTaperEndcap.cc.

References funct::abs(), gather_cfg::cout, dbl_to_string(), DDcreateRotationMatrix(), DDrot(), m_childName, m_idNameSpace, m_incrCopyNo, m_rMax, m_rMin, m_tiltAngle, m_xyoffset, m_zoffset, DDName::name(), DDCompactView::position(), idealTransformation::rotation, mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, and theta().

Referenced by execute().

53  {
54  int copyNo = startCopyNo;
55  double tiltAngle = m_tiltAngle;
56  double xphi = xQuadrant*tiltAngle;
57  double yphi = yQuadrant*tiltAngle;
58  double theta = 90.*CLHEP::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 DebugLog
69  int rowmax(0), column(0);
70 #endif
71  while (abs(offsetX) < m_rMax) {
72 #ifdef DebugLog
73  column++;
74  int row(0);
75 #endif
76  while (abs(offsetY) < m_rMax) {
77 #ifdef DebugLog
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 DebugLog
91  std::cout << m_childName << " copyNo = " << copyNo << " (" << column
92  << "," << row << "): offsetX,Y = " << offsetX << ","
93  << offsetY << " limit=" << limit1 << ":" << limit2
94  << " rMin, rMax = " << m_rMin << "," << m_rMax << std::endl;
95 #endif
97  std::string rotstr( "NULL" );
98 
99  // Check if we've already created the rotation matrix
100  rotstr = "R";
101  rotstr += dbl_to_string(copyNo);
102  rotation = DDRotation(DDName(rotstr));
103  if (!rotation) {
104  rotation = DDrot(DDName(rotstr, m_idNameSpace),
105  new DDRotationMatrix( *DDcreateRotationMatrix( theta, phiX, theta + yphi, phiY, -yphi, phiZ )
106  * ( *DDcreateRotationMatrix( theta + xphi, phiX, 90.*CLHEP::deg, 90.*CLHEP::deg, xphi, 0.0 ))));
107  }
108 
109 
110  DDTranslation tran(offsetX, offsetY, offsetZ);
111  edm::LogInfo("HGCalGeom") << "Module " << copyNo << ": location = "
112  << tran << " Rotation " << rotation;
113 
114  DDName parentName = parent().name();
115  cpv.position(DDName(m_childName), parentName, copyNo, tran, rotation);
116 
117  copyNo += m_incrCopyNo;
118  } else {
119 #ifdef DebugLog
120  std::cout << " (" << column << "," << row << "): offsetX,Y = "
121  << offsetX << "," << offsetY << " is out of limit=" << limit1
122  << ":" << limit2 << " rMin, rMax = " << m_rMin << ","
123  << m_rMax << std::endl;
124 #endif
125  }
126 
127  yphi += yQuadrant*2.*tiltAngle;
128  offsetY += yQuadrant*offsetXY;
129 
130  }
131 #ifdef DebugLog
132  if (row > rowmax) rowmax = row;
133 #endif
134  xphi += xQuadrant*2.*tiltAngle;
135  yphi = yQuadrant*tiltAngle;
136  offsetY = yQuadrant*0.5*offsetXY;
137  offsetX += xQuadrant*offsetXY;
138 
139  }
140 #ifdef DebugLog
141  std::cout << rowmax << " rows and " << column << " columns in quadrant "
142  << xQuadrant << ":" << yQuadrant << std::endl;
143 #endif
144  return copyNo;
145 }
Geom::Theta< T > theta() const
void position(const DDLogicalPart &self, const DDLogicalPart &parent, std::string copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=NULL)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:14
std::string dbl_to_string(const double &in)
Converts only the integer part of a double to a string.
Definition: DDutils.cc:12
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
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
tuple cout
Definition: gather_cfg.py:145
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
const std::string & name() const
Returns the name.
Definition: DDName.cc:87
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:165
void DDHGCalNoTaperEndcap::execute ( DDCompactView cpv)

Definition at line 44 of file DDHGCalNoTaperEndcap.cc.

References createQuarter(), and m_startCopyNo.

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 
)

Definition at line 24 of file DDHGCalNoTaperEndcap.cc.

References m_childName, m_idNameSpace, m_incrCopyNo, m_invert, m_n, m_rMax, m_rMin, m_startCopyNo, m_tiltAngle, m_xyoffset, m_zoffset, and DDCurrentNamespace::ns().

28  {
29  m_tiltAngle = nArgs["tiltAngle"];
30  m_invert = int( nArgs["invert"] );
31  m_rMin = int( nArgs["rMin"] );
32  m_rMax = int( nArgs["rMax"] );
33  m_zoffset = nArgs["zoffset"];
34  m_xyoffset = nArgs["xyoffset"];
35  m_n = int( nArgs["n"] );
36  m_startCopyNo = int( nArgs["startCopyNo"] );
37  m_incrCopyNo = int( nArgs["incrCopyNo"] );
38  m_childName = sArgs["ChildName"];
40  edm::LogInfo("HGCalGeom") << "DDHGCalNoTaperEndcap: NameSpace " << m_idNameSpace
41  << "\tParent " << parent().name();
42 }
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().