CMS 3D CMS Logo

DDTrackerPhiAlgo Class Reference

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

List of all members.

Public Member Functions

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

Private Attributes

std::string childName
std::string idNameSpace
int incrcn
size_t numcopies
std::vector< double > phi
double radius
size_t startcn
double tilt
std::vector< double > zpos


Detailed Description

Definition at line 10 of file DDTrackerPhiAlgo.h.


Constructor & Destructor Documentation

DDTrackerPhiAlgo::DDTrackerPhiAlgo (  ) 

Definition at line 19 of file DDTrackerPhiAlgo.cc.

References LogDebug.

00019                                    : startcn(1), incrcn(1) {
00020   LogDebug("TrackerGeom") << "DDTrackerPhiAlgo info: Creating an instance";
00021 }

DDTrackerPhiAlgo::~DDTrackerPhiAlgo (  )  [virtual]

Definition at line 23 of file DDTrackerPhiAlgo.cc.

00023 {}


Member Function Documentation

void DDTrackerPhiAlgo::execute (  ) 

Definition at line 71 of file DDTrackerPhiAlgo.cc.

References childName, funct::cos(), dbl_to_string(), DDpos(), DDrot(), DDSplit(), first, i, idNameSpace, incrcn, LogDebug, numcopies, dbtoconf::parent, phi, radius, edm::second(), funct::sin(), startcn, theta, tilt, and zpos.

00071                                {
00072 
00073   DDName mother = parent().name();
00074   DDName child(DDSplit(childName).first, DDSplit(childName).second);
00075   double theta  = 90.*deg;
00076   int i = 0;
00077   for (size_t ci=startcn; ci<numcopies+1; ci = ci+incrcn) {
00078     double phix = phi[i] + tilt;
00079     double phiy = phix + 90.*deg;
00080     double phideg = phi[i]/deg;
00081 
00082     std::string rotstr = DDSplit(childName).first + dbl_to_string(phideg);
00083     DDRotation rotation = DDRotation(DDName(rotstr, idNameSpace));
00084     if (!rotation) {
00085       LogDebug("TrackerGeom") << "DDTrackerPhiAlgo test: Creating a new "
00086                               << "rotation: " << rotstr << "\t" << "90., "
00087                               << phix/deg << ", 90.," << phiy/deg << ", 0, 0";
00088       rotation = DDrot(DDName(rotstr, idNameSpace), theta, phix, theta, phiy,
00089                        0., 0.);
00090     }
00091         
00092     double xpos = radius*cos(phi[i]);
00093     double ypos = radius*sin(phi[i]);
00094     DDTranslation tran(xpos, ypos, zpos[i]);
00095   
00096     DDpos (child, mother, ci, tran, rotation);
00097     LogDebug("TrackerGeom") << "DDTrackerPhiAlgo test: " << child << " number "
00098                             << i+1 << " positioned in " << mother << " at "
00099                             << tran  << " with " << rotation;
00100     ++i;
00101   }
00102 }

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

Definition at line 25 of file DDTrackerPhiAlgo.cc.

References childName, i, idNameSpace, incrcn, int, LogDebug, DDCurrentNamespace::ns(), numcopies, dbtoconf::parent, phi, radius, startcn, tilt, and zpos.

00029                                                                      {
00030 
00031   if ( nArgs.find("StartCopyNo") != nArgs.end() ) {
00032     startcn = size_t(nArgs["StartCopyNo"]);
00033   }
00034   if ( nArgs.find("IncrCopyNo") != nArgs.end() ) {
00035     incrcn = int(nArgs["IncrCopyNo"]);
00036   }
00037 
00038   radius     = nArgs["Radius"];
00039   tilt       = nArgs["Tilt"];
00040   phi        = vArgs["Phi"];
00041   zpos       = vArgs["ZPos"];
00042 
00043   if ( nArgs.find("NumCopies") != nArgs.end() ) {
00044     numcopies = size_t(nArgs["NumCopies"]);
00045     if ( numcopies != phi.size() ) {
00046       edm::LogError("TrackerGeom") << "DDTrackerPhiAlgo error: Parameter NumCopies "
00047                                    << "does not agree with the size of the Phi "
00048                                    << "vector.  It was adjusted to be the size "
00049                                    << "of the Phi vector and may lead to crashes "
00050                                    << "or errors.";
00051     } 
00052   }
00053   numcopies = phi.size() - 1; // -1 for loop in execute.  seems almost redundant...
00054     
00055 
00056   LogDebug("TrackerGeom") << "DDTrackerPhiAlgo debug: Parameters for position"
00057                           << "ing:: " << " Radius " << radius << " Tilt " 
00058                           << tilt/deg << " Copies " << phi.size() << " at";
00059   for (int i=0; i<(int)(phi.size()); i++)
00060     LogDebug("TrackerGeom") << "\t[" << i << "] phi = " << phi[i]/deg 
00061                             << " z = " << zpos[i];
00062 
00063   idNameSpace = DDCurrentNamespace::ns();
00064   childName   = sArgs["ChildName"]; 
00065   DDName parentName = parent().name();
00066   LogDebug("TrackerGeom") <<  "DDTrackerPhiAlgo debug: Parent " << parentName
00067                           <<"\tChild " << childName << " NameSpace " 
00068                           << idNameSpace;
00069 }


Member Data Documentation

std::string DDTrackerPhiAlgo::childName [private]

Definition at line 33 of file DDTrackerPhiAlgo.h.

Referenced by execute(), and initialize().

std::string DDTrackerPhiAlgo::idNameSpace [private]

Definition at line 32 of file DDTrackerPhiAlgo.h.

Referenced by execute(), and initialize().

int DDTrackerPhiAlgo::incrcn [private]

Definition at line 36 of file DDTrackerPhiAlgo.h.

Referenced by execute(), and initialize().

size_t DDTrackerPhiAlgo::numcopies [private]

Definition at line 37 of file DDTrackerPhiAlgo.h.

Referenced by execute(), and initialize().

std::vector<double> DDTrackerPhiAlgo::phi [private]

Definition at line 29 of file DDTrackerPhiAlgo.h.

Referenced by execute(), and initialize().

double DDTrackerPhiAlgo::radius [private]

Definition at line 27 of file DDTrackerPhiAlgo.h.

Referenced by execute(), and initialize().

size_t DDTrackerPhiAlgo::startcn [private]

Definition at line 35 of file DDTrackerPhiAlgo.h.

Referenced by execute(), and initialize().

double DDTrackerPhiAlgo::tilt [private]

Definition at line 28 of file DDTrackerPhiAlgo.h.

Referenced by execute(), and initialize().

std::vector<double> DDTrackerPhiAlgo::zpos [private]

Definition at line 30 of file DDTrackerPhiAlgo.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