CMS 3D CMS Logo

DDTECOptoHybAlgo Class Reference

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

List of all members.

Public Member Functions

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

Private Attributes

std::vector< double > angles
std::string childName
std::string idNameSpace
double optoHeight
double optoWidth
double rpos
int startCopyNo
double zpos


Detailed Description

Definition at line 10 of file DDTECOptoHybAlgo.h.


Constructor & Destructor Documentation

DDTECOptoHybAlgo::DDTECOptoHybAlgo (  ) 

Definition at line 19 of file DDTECOptoHybAlgo.cc.

References LogDebug.

00019                                   : angles(0) {
00020   LogDebug("TECGeom") << "DDTECOptoHybAlgo info: Creating an instance";
00021 }

DDTECOptoHybAlgo::~DDTECOptoHybAlgo (  )  [virtual]

Definition at line 23 of file DDTECOptoHybAlgo.cc.

00023 {}


Member Function Documentation

void DDTECOptoHybAlgo::execute (  ) 

Definition at line 57 of file DDTECOptoHybAlgo.cc.

References angles, childName, funct::cos(), dbl_to_string(), DDpos(), DDrot(), DDSplit(), first, i, idNameSpace, int, LogDebug, optoHeight, optoWidth, dbtoconf::parent, rpos, edm::second(), funct::sin(), startCopyNo, theta, and zpos.

00057                                {
00058   
00059   LogDebug("TECGeom") << "==>> Constructing DDTECOptoHybAlgo...";
00060 
00061   DDName mother = parent().name();
00062   DDName child  = DDName(DDSplit(childName).first, DDSplit(childName).second);
00063 
00064   // given r positions are for the lower left corner
00065   rpos += optoHeight/2;
00066   int    copyNo = startCopyNo;
00067   for (int i = 0; i < (int)(angles.size()); i++) {
00068     double phix = -angles.at(i);
00069     // given phi positions are for the lower left corner
00070     phix += asin(optoWidth/2/rpos);
00071     double xpos = rpos * cos(phix);
00072     double ypos = rpos * sin(phix);
00073     DDTranslation tran(xpos, ypos, zpos);
00074 
00075     DDRotation rotation;
00076     double phiy = phix + 90.*deg;
00077     double phideg = phix/deg;
00078     if (phideg != 0) {
00079       std::string rotstr= DDSplit(childName).first+dbl_to_string(phideg*1000.);
00080       rotation = DDRotation(DDName(rotstr, idNameSpace));
00081       if (!rotation) {
00082         double theta = 90.*deg;
00083         LogDebug("TECGeom") << "DDTECOptoHybAlgo test: Creating a new "
00084                             << "rotation: " << rotstr << "\t90., " 
00085                             << phix/deg << ", 90.," << phiy/deg <<", 0, 0";
00086         rotation = DDrot(DDName(rotstr, idNameSpace), theta, phix, theta, phiy,
00087                          0., 0.);
00088       }
00089     }
00090 
00091     DDpos (child, mother, copyNo, tran, rotation);
00092     LogDebug("TECGeom") << "DDTECOptoHybAlgo test " << child << " number " 
00093                         << copyNo << " positioned in " << mother << " at "
00094                         << tran  << " with " << rotation;
00095     copyNo++;
00096   }
00097   
00098   LogDebug("TECGeom") << "<<== End of DDTECOptoHybAlgo construction ...";
00099 }

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

Definition at line 25 of file DDTECOptoHybAlgo.cc.

References angles, childName, i, idNameSpace, int, LogDebug, DDCurrentNamespace::ns(), optoHeight, optoWidth, dbtoconf::parent, rpos, startCopyNo, and zpos.

00029                                                                     {
00030 
00031   idNameSpace  = DDCurrentNamespace::ns();
00032   childName    = sArgs["ChildName"];
00033 
00034   DDName parentName = parent().name(); 
00035 
00036   LogDebug("TECGeom") << "DDTECOptoHybAlgo debug: Parent " << parentName 
00037                       << " Child " << childName << " NameSpace " <<idNameSpace;
00038 
00039   optoHeight     = nArgs["OptoHeight"];
00040   optoWidth      = nArgs["OptoWidth"];
00041   rpos           = nArgs["Rpos"];
00042   zpos           = nArgs["Zpos"];
00043   startCopyNo    = int (nArgs["StartCopyNo"]);
00044   angles         = vArgs["Angles"];
00045 
00046   LogDebug("TECGeom") << "DDTECOptoHybAlgo debug: Height of the Hybrid "
00047                       << optoHeight << " and Width " << optoWidth
00048                       <<"Rpos " << rpos << " Zpos " << zpos 
00049                       << " StartCopyNo " << startCopyNo << " Number " 
00050                       << angles.size();
00051 
00052   for (int i = 0; i < (int)(angles.size()); i++)
00053     LogDebug("TECGeom") << "\tAngles[" << i << "] = " << angles[i];
00054 
00055 }


Member Data Documentation

std::vector<double> DDTECOptoHybAlgo::angles [private]

Definition at line 33 of file DDTECOptoHybAlgo.h.

Referenced by execute(), and initialize().

std::string DDTECOptoHybAlgo::childName [private]

Definition at line 27 of file DDTECOptoHybAlgo.h.

Referenced by execute(), and initialize().

std::string DDTECOptoHybAlgo::idNameSpace [private]

Definition at line 26 of file DDTECOptoHybAlgo.h.

Referenced by execute(), and initialize().

double DDTECOptoHybAlgo::optoHeight [private]

Definition at line 30 of file DDTECOptoHybAlgo.h.

Referenced by execute(), and initialize().

double DDTECOptoHybAlgo::optoWidth [private]

Definition at line 31 of file DDTECOptoHybAlgo.h.

Referenced by execute(), and initialize().

double DDTECOptoHybAlgo::rpos [private]

Definition at line 28 of file DDTECOptoHybAlgo.h.

Referenced by execute(), and initialize().

int DDTECOptoHybAlgo::startCopyNo [private]

Definition at line 32 of file DDTECOptoHybAlgo.h.

Referenced by execute(), and initialize().

double DDTECOptoHybAlgo::zpos [private]

Definition at line 29 of file DDTECOptoHybAlgo.h.

Referenced by execute(), and initialize().


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