CMS 3D CMS Logo

DDHCalAngular Class Reference

#include <Geometry/HcalAlgo/interface/DDHCalAngular.h>

List of all members.

Public Member Functions

 DDHCalAngular ()
void execute ()
void initialize (const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs)
virtual ~DDHCalAngular ()

Private Attributes

std::string childName
std::string idNameSpace
int incrCopyNo
int n
double rangeAngle
std::string rotns
double shiftX
double shiftY
double startAngle
int startCopyNo
double zoffset


Detailed Description

Definition at line 10 of file DDHCalAngular.h.


Constructor & Destructor Documentation

DDHCalAngular::DDHCalAngular (  ) 

Definition at line 17 of file DDHCalAngular.cc.

References LogDebug.

00017                              {
00018   LogDebug("HCalGeom") << "DDHCalAngular test: Creating an instance";
00019 }

DDHCalAngular::~DDHCalAngular (  )  [virtual]

Definition at line 21 of file DDHCalAngular.cc.

00021 {}


Member Function Documentation

void DDHCalAngular::execute (  ) 

Definition at line 53 of file DDHCalAngular.cc.

References childName, funct::cos(), dbl_to_string(), DDpos(), DDrot(), idNameSpace, incrCopyNo, int, LogDebug, n, dbtoconf::parent, phi, rangeAngle, rotns, shiftX, shiftY, funct::sin(), startAngle, startCopyNo, and zoffset.

00053                             {
00054 
00055   double dphi   = rangeAngle/n;
00056   double phi    = startAngle;
00057   int    copyNo = startCopyNo;
00058 
00059   for (int ii=0; ii<n; ii++) {
00060 
00061     double phideg = phi/deg;
00062     int    iphi;
00063     if (phideg > 0) iphi = int(phideg+0.1);
00064     else            iphi = int(phideg-0.1);
00065     if (iphi >= 360) iphi   -= 360;
00066     phideg = iphi;
00067     DDRotation rotation;
00068     std::string rotstr("NULL");
00069 
00070     if (iphi != 0) {
00071       rotstr = "R"; 
00072       if (phideg >=0 && phideg < 100) rotstr = "R0"; 
00073       rotstr = rotstr + dbl_to_string(phideg);
00074       rotation = DDRotation(DDName(rotstr, rotns)); 
00075       if (!rotation) {
00076         LogDebug("HCalGeom") << "DDHCalAngular test: Creating a new rotation "
00077                              << DDName(rotstr, idNameSpace) << "\t90, " 
00078                              << phideg << ", 90, " << (phideg+90) << ", 0, 0";
00079         rotation = DDrot(DDName(rotstr, rotns), 90*deg, phideg*deg, 
00080                          90*deg, (90+phideg)*deg, 0*deg,  0*deg);
00081       } 
00082     }
00083     
00084     double xpos = shiftX*cos(phi) - shiftY*sin(phi);
00085     double ypos = shiftX*sin(phi) + shiftY*cos(phi);
00086     DDTranslation tran(xpos, ypos, zoffset);
00087   
00088     DDName parentName = parent().name(); 
00089     DDpos (DDName(childName,idNameSpace), parentName, copyNo, tran, rotation);
00090     LogDebug("HCalGeom") << "DDHCalAngular test: " 
00091                          << DDName(childName, idNameSpace) << " number " 
00092                          << copyNo << " positioned in " << parentName << " at "
00093                          << tran << " with " << rotation;
00094     phi    += dphi;
00095     copyNo += incrCopyNo;
00096   }
00097 }

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

Definition at line 23 of file DDHCalAngular.cc.

References childName, idNameSpace, incrCopyNo, int, LogDebug, n, DDCurrentNamespace::ns(), dbtoconf::parent, rangeAngle, rotns, shiftX, shiftY, startAngle, startCopyNo, and zoffset.

00027                                                                  {
00028 
00029   startAngle  = nArgs["startAngle"];
00030   rangeAngle  = nArgs["rangeAngle"];
00031   shiftX      = nArgs["shiftX"];
00032   shiftY      = nArgs["shiftY"];
00033   zoffset     = nArgs["zoffset"];
00034   n           = int (nArgs["n"]);
00035   startCopyNo = int (nArgs["startCopyNo"]);
00036   incrCopyNo  = int (nArgs["incrCopyNo"]);
00037   LogDebug("HCalGeom") << "DDHCalAngular debug: Parameters for positioning-- "
00038                        << n << " copies in " << rangeAngle/deg << " from " 
00039                        << startAngle/deg << "\tShifts " << shiftX << ", " 
00040                        << shiftY << " along x, y axes; \tZoffest " << zoffset
00041                        << "\tStart and inremental copy nos " << startCopyNo 
00042                        << ", " << incrCopyNo;
00043 
00044   rotns       = sArgs["RotNameSpace"];
00045   idNameSpace = DDCurrentNamespace::ns();
00046   childName   = sArgs["ChildName"]; 
00047   DDName parentName = parent().name(); 
00048   LogDebug("HCalGeom") << "DDHCalAngular debug: Parent " << parentName 
00049                        << "\tChild " << childName << "\tNameSpace "
00050                        << idNameSpace << "\tRotation Namespace " << rotns;
00051 }


Member Data Documentation

std::string DDHCalAngular::childName [private]

Definition at line 37 of file DDHCalAngular.h.

Referenced by execute(), and initialize().

std::string DDHCalAngular::idNameSpace [private]

Definition at line 36 of file DDHCalAngular.h.

Referenced by execute(), and initialize().

int DDHCalAngular::incrCopyNo [private]

Definition at line 33 of file DDHCalAngular.h.

Referenced by execute(), and initialize().

int DDHCalAngular::n [private]

Definition at line 31 of file DDHCalAngular.h.

Referenced by execute(), and initialize().

double DDHCalAngular::rangeAngle [private]

Definition at line 27 of file DDHCalAngular.h.

Referenced by execute(), and initialize().

std::string DDHCalAngular::rotns [private]

Definition at line 35 of file DDHCalAngular.h.

Referenced by execute(), and initialize().

double DDHCalAngular::shiftX [private]

Definition at line 29 of file DDHCalAngular.h.

Referenced by execute(), and initialize().

double DDHCalAngular::shiftY [private]

Definition at line 28 of file DDHCalAngular.h.

Referenced by execute(), and initialize().

double DDHCalAngular::startAngle [private]

Definition at line 26 of file DDHCalAngular.h.

Referenced by execute(), and initialize().

int DDHCalAngular::startCopyNo [private]

Definition at line 32 of file DDHCalAngular.h.

Referenced by execute(), and initialize().

double DDHCalAngular::zoffset [private]

Definition at line 30 of file DDHCalAngular.h.

Referenced by execute(), and initialize().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:17:55 2009 for CMSSW by  doxygen 1.5.4