CMS 3D CMS Logo

DDTrackerAngular Class Reference

#include <Geometry/TrackerCommonData/interface/DDTrackerAngular.h>

List of all members.

Public Member Functions

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

Private Attributes

std::vector< double > center
std::string childName
double delta
std::string idNameSpace
int incrCopyNo
int n
double radius
double rangeAngle
double startAngle
int startCopyNo


Detailed Description

Definition at line 10 of file DDTrackerAngular.h.


Constructor & Destructor Documentation

DDTrackerAngular::DDTrackerAngular (  ) 

Definition at line 19 of file DDTrackerAngular.cc.

References LogDebug.

00019                                    {
00020   LogDebug("TrackerGeom") << "DDTrackerAngular info: Creating an instance";
00021 }

DDTrackerAngular::~DDTrackerAngular (  )  [virtual]

Definition at line 23 of file DDTrackerAngular.cc.

00023 {}


Member Function Documentation

void DDTrackerAngular::execute (  ) 

Definition at line 64 of file DDTrackerAngular.cc.

References center, childName, edmNew::copy(), funct::cos(), dbl_to_string(), DDpos(), DDrot(), DDSplit(), delta, first, i, idNameSpace, incrCopyNo, LogDebug, n, dbtoconf::parent, phi, radius, edm::second(), funct::sin(), startAngle, startCopyNo, and theta.

00064                                {
00065 
00066   DDName mother = parent().name();
00067   DDName child(DDSplit(childName).first, DDSplit(childName).second);
00068   double theta  = 90.*deg;
00069   int    copy   = startCopyNo;
00070   double phi    = startAngle;
00071   for (int i=0; i<n; i++) {
00072     double phix = phi;
00073     double phiy = phix + 90.*deg;
00074     double phideg = phix/deg;
00075 
00076     DDRotation rotation;
00077     if (phideg != 0) {
00078       std::string rotstr = DDSplit(childName).first+dbl_to_string(phideg*10.);
00079       rotation = DDRotation(DDName(rotstr, idNameSpace));
00080       if (!rotation) {
00081         LogDebug("TrackerGeom") << "DDTrackerAngular test: Creating a new "
00082                                 << "rotation: " << rotstr << "\t90., " 
00083                                 << phix/deg << ", 90.," << phiy/deg <<", 0, 0";
00084         rotation = DDrot(DDName(rotstr, idNameSpace), theta, phix, theta, phiy,
00085                          0., 0.);
00086       }
00087     }
00088         
00089     double xpos = radius*cos(phi) + center[0];
00090     double ypos = radius*sin(phi) + center[1];
00091     double zpos = center[2];
00092     DDTranslation tran(xpos, ypos, zpos);
00093   
00094     DDpos (child, mother, copy, tran, rotation);
00095     LogDebug("TrackerGeom") << "DDTrackerAngular test " << child << " number " 
00096                             << copy << " positioned in " << mother << " at "
00097                             << tran  << " with " << rotation;
00098     copy += incrCopyNo;
00099     phi  += delta;
00100   }
00101 }

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

Definition at line 25 of file DDTrackerAngular.cc.

References center, childName, delta, idNameSpace, incrCopyNo, int, LogDebug, n, DDCurrentNamespace::ns(), dbtoconf::parent, radius, rangeAngle, startAngle, and startCopyNo.

00029                                                                     {
00030 
00031   n           = int(nArgs["N"]);
00032   startCopyNo = int(nArgs["StartCopyNo"]);
00033   incrCopyNo  = int(nArgs["IncrCopyNo"]);
00034   rangeAngle  = nArgs["RangeAngle"];
00035   startAngle  = nArgs["StartAngle"];
00036   radius      = nArgs["Radius"];
00037   center      = vArgs["Center"];
00038   
00039   if (fabs(rangeAngle-360.0*deg)<0.001*deg) { 
00040     delta    =   rangeAngle/double(n);
00041   } else {
00042     if (n > 1) {
00043       delta    =   rangeAngle/double(n-1);
00044     } else {
00045       delta = 0.;
00046     }
00047   }  
00048 
00049   LogDebug("TrackerGeom") << "DDTrackerAngular debug: Parameters for position"
00050                           << "ing:: n " << n << " Start, Range, Delta " 
00051                           << startAngle/deg << " " << rangeAngle/deg << " " 
00052                           << delta/deg << " Radius " << radius << " Centre " 
00053                           << center[0] << ", " << center[1] << ", "<<center[2];
00054 
00055   idNameSpace = DDCurrentNamespace::ns();
00056   childName   = sArgs["ChildName"]; 
00057 
00058   DDName parentName = parent().name();
00059   LogDebug("TrackerGeom") << "DDTrackerAngular debug: Parent " << parentName 
00060                           << "\tChild " << childName << " NameSpace "
00061                           << idNameSpace;
00062 }


Member Data Documentation

std::vector<double> DDTrackerAngular::center [private]

Definition at line 33 of file DDTrackerAngular.h.

Referenced by execute(), and initialize().

std::string DDTrackerAngular::childName [private]

Definition at line 37 of file DDTrackerAngular.h.

Referenced by execute(), and initialize().

double DDTrackerAngular::delta [private]

Definition at line 34 of file DDTrackerAngular.h.

Referenced by execute(), and initialize().

std::string DDTrackerAngular::idNameSpace [private]

Definition at line 36 of file DDTrackerAngular.h.

Referenced by execute(), and initialize().

int DDTrackerAngular::incrCopyNo [private]

Definition at line 29 of file DDTrackerAngular.h.

Referenced by execute(), and initialize().

int DDTrackerAngular::n [private]

Definition at line 27 of file DDTrackerAngular.h.

Referenced by execute(), and initialize().

double DDTrackerAngular::radius [private]

Definition at line 32 of file DDTrackerAngular.h.

Referenced by execute(), and initialize().

double DDTrackerAngular::rangeAngle [private]

Definition at line 30 of file DDTrackerAngular.h.

Referenced by initialize().

double DDTrackerAngular::startAngle [private]

Definition at line 31 of file DDTrackerAngular.h.

Referenced by execute(), and initialize().

int DDTrackerAngular::startCopyNo [private]

Definition at line 28 of file DDTrackerAngular.h.

Referenced by execute(), and initialize().


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