CMS 3D CMS Logo

DDTIDAxialCableAlgo Class Reference

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

List of all members.

Public Member Functions

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

Private Attributes

std::vector< double > angles
std::string childName
std::string idNameSpace
std::string matIn
std::string matOut
double rMax
double rMin
double rTop
double thick
double width
double zBend
double zEnd
std::vector< double > zposRing
std::vector< double > zposWheel


Detailed Description

Definition at line 10 of file DDTIDAxialCableAlgo.h.


Constructor & Destructor Documentation

DDTIDAxialCableAlgo::DDTIDAxialCableAlgo (  ) 

Definition at line 22 of file DDTIDAxialCableAlgo.cc.

References LogDebug.

00022                                          {
00023   LogDebug("TIDGeom") << "DDTIDAxialCableAlgo info: Creating an instance";
00024 }

DDTIDAxialCableAlgo::~DDTIDAxialCableAlgo (  )  [virtual]

Definition at line 26 of file DDTIDAxialCableAlgo.cc.

00026 {}


Member Function Documentation

void DDTIDAxialCableAlgo::execute (  ) 

Definition at line 75 of file DDTIDAxialCableAlgo.cc.

References angles, childName, dbl_to_string(), DDpos(), DDrot(), DDSplit(), first, i, idNameSpace, int, k, LogDebug, matIn, matOut, name, dbtoconf::parent, DDSolidFactory::polycone(), r, rMax, rMin, rTop, edm::second(), theta, thick, DDSolidFactory::tubs(), width, z, zBend, zEnd, zposRing, and zposWheel.

00075                                   {
00076 
00077   DDName mother = parent().name();
00078   std::vector<DDName> logs;
00079   double thk = thick/zposRing.size();
00080   double r   = rMin;
00081   double thktot = 0;
00082   double z;
00083 
00084   //Cables between the wheels
00085   for (int k=0; k<(int)(zposWheel.size()); k++) {
00086 
00087     std::vector<double> pconZ, pconRmin, pconRmax;
00088     for (int i=0; i<(int)(zposRing.size()); i++) {
00089       thktot += thk;
00090       z       = zposWheel[k] + zposRing[i] - 0.5*thk;
00091       if (i != 0) {
00092         pconZ.push_back(z);
00093         pconRmin.push_back(r);
00094         pconRmax.push_back(rMax);
00095       }
00096       r       = rMin;
00097       pconZ.push_back(z);
00098       pconRmin.push_back(r);
00099       pconRmax.push_back(rMax);
00100       z      += thk;
00101       pconZ.push_back(z);
00102       pconRmin.push_back(r);
00103       pconRmax.push_back(rMax);
00104       r       = rMax - thktot;
00105       pconZ.push_back(z);
00106       pconRmin.push_back(r);
00107       pconRmax.push_back(rMax);
00108     }
00109     if (k >= ((int)(zposWheel.size())-1)) z = zBend;
00110     else z = zposWheel[k+1] + zposRing[0] - 0.5*thk;
00111     pconZ.push_back(z);
00112     pconRmin.push_back(r);
00113     pconRmax.push_back(rMax);
00114     
00115     std::string name = childName + dbl_to_string(k);
00116     DDSolid solid = DDSolidFactory::polycone(DDName(name, idNameSpace),
00117                                              -0.5*width, width, pconZ, 
00118                                              pconRmin, pconRmax);
00119 
00120     LogDebug("TIDGeom") << "DDTIDAxialCableAlgo test: " 
00121                         << DDName(name,idNameSpace) << " Polycone made of "
00122                         << matIn << " from " << -0.5*width/deg << " to " 
00123                         << 0.5*width/deg << " and with " << pconZ.size()
00124                         << " sections ";
00125     for (int i = 0; i <(int)(pconZ.size()); i++) 
00126       LogDebug("TIDGeom") <<  "\t[" << i  << "]\tZ = " << pconZ[i] 
00127                           << "\tRmin = "<< pconRmin[i] << "\tRmax = " 
00128                           << pconRmax[i];
00129 
00130     DDName mat(DDSplit(matIn).first, DDSplit(matIn).second); 
00131     DDMaterial matter(mat);
00132     DDLogicalPart genlogic(DDName(name, idNameSpace), matter, solid);
00133     logs.push_back(DDName(name, idNameSpace));
00134   }
00135 
00136   //Cable in the vertical part
00137   std::vector<double> pconZ, pconRmin, pconRmax;
00138   r = thktot*rMax/rTop;
00139   z = zBend - thktot;
00140   LogDebug("TIDGeom") << "DDTIDAxialCableAlgo test: Thk " << thk 
00141                       << " Total " << thktot << " rMax " << rMax 
00142                       << " rTop " << rTop << " dR " << r << " z " << z;
00143   pconZ.push_back(z);
00144   pconRmin.push_back(rMax);
00145   pconRmax.push_back(rMax);
00146   z = zBend - r;
00147   pconZ.push_back(z);
00148   pconRmin.push_back(rMax);
00149   pconRmax.push_back(rTop);
00150   pconZ.push_back(zBend);
00151   pconRmin.push_back(rMax);
00152   pconRmax.push_back(rTop);
00153 
00154   std::string name = childName + dbl_to_string(zposWheel.size());
00155   DDSolid solid = DDSolidFactory::polycone(DDName(name, idNameSpace),
00156                                            -0.5*width, width, pconZ, 
00157                                            pconRmin, pconRmax);
00158 
00159   LogDebug("TIDGeom") << "DDTIDAxialCableAlgo test: " 
00160                       << DDName(name, idNameSpace) << " Polycone made of "
00161                       << matIn << " from " << -0.5*width/deg << " to "
00162                       << 0.5*width/deg << " and with "  << pconZ.size()
00163                       << " sections ";
00164   for (int i = 0; i < (int)(pconZ.size()); i++) 
00165     LogDebug("TIDGeom") << "\t[" << i << "]\tZ = " << pconZ[i] 
00166                         << "\tRmin = "<< pconRmin[i] << "\tRmax = " 
00167                         << pconRmax[i];
00168 
00169   DDName mat(DDSplit(matIn).first, DDSplit(matIn).second); 
00170   DDMaterial matter(mat);
00171   DDLogicalPart genlogic(DDName(name, idNameSpace), matter, solid);
00172   logs.push_back(DDName(name, idNameSpace));
00173 
00174   //Cable in the outer part
00175   name = childName + dbl_to_string(zposWheel.size()+1);
00176   r    = rTop-r;
00177   solid = DDSolidFactory::tubs(DDName(name, idNameSpace), 0.5*(zEnd-zBend),
00178                                r, rTop, -0.5*width, width);
00179   LogDebug("TIDGeom") << "DDTIDAxialCableAlgo test: " 
00180                       << DDName(name, idNameSpace) << " Tubs made of " 
00181                       << matOut << " from " << -0.5*width/deg << " to " 
00182                       << 0.5*width/deg << " with Rin " << r << " Rout " 
00183                       << rTop << " ZHalf " << 0.5*(zEnd-zBend);
00184   mat    = DDName(DDSplit(matOut).first, DDSplit(matOut).second);
00185   matter = DDMaterial(mat);
00186   genlogic = DDLogicalPart(DDName(name, idNameSpace), matter, solid);
00187   logs.push_back(DDName(name, idNameSpace));
00188 
00189   //Position the cables
00190   double theta = 90.*deg;
00191   for (int i=0; i<(int)(angles.size()); i++) {
00192     double phix = angles[i];
00193     double phiy = phix + 90.*deg;
00194     double phideg = phix/deg;
00195 
00196     DDRotation rotation;
00197     if (phideg != 0) {
00198       std::string rotstr = childName + dbl_to_string(phideg*10.);
00199       rotation = DDRotation(DDName(rotstr, idNameSpace));
00200       if (!rotation) {
00201         LogDebug("TIDGeom") << "DDTIDAxialCableAlgo test: Creating a new "
00202                             << "rotation: " << rotstr << " " << theta/deg 
00203                             << ", " << phix/deg << ", " << theta/deg 
00204                             << ", " << phiy/deg << ", 0, 0";
00205         rotation = DDrot(DDName(rotstr, idNameSpace), theta, phix, theta, 
00206                          phiy, 0., 0.);
00207       }
00208     }
00209     
00210     for (int k=0; k<(int)(logs.size()); k++) {
00211       DDTranslation tran(0,0,0);
00212       if (k == ((int)(logs.size())-1))
00213         tran = DDTranslation(0,0,0.5*(zEnd+zBend));
00214       DDpos (logs[k], mother, i+1, tran, rotation);
00215       LogDebug("TIDGeom") << "DDTIDAxialCableAlgo test " << logs[k] 
00216                           << " number " << i+1 << " positioned in "
00217                           << mother << " at " << tran << " with "
00218                           << rotation;
00219     }
00220   }
00221 }

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

Definition at line 28 of file DDTIDAxialCableAlgo.cc.

References angles, childName, i, idNameSpace, int, LogDebug, matIn, matOut, DDCurrentNamespace::ns(), dbtoconf::parent, rMax, rMin, rTop, thick, width, zBend, zEnd, zposRing, and zposWheel.

00032                                                                        {
00033 
00034   zBend       = nArgs["ZBend"];
00035   zEnd        = nArgs["ZEnd"];
00036   rMin        = nArgs["RMin"];
00037   rMax        = nArgs["RMax"];
00038   rTop        = nArgs["RTop"];
00039   width       = nArgs["Width"];
00040   thick       = nArgs["Thick"];
00041   angles      = vArgs["Angles"];
00042   zposWheel   = vArgs["ZPosWheel"];
00043   zposRing    = vArgs["ZPosRing"];
00044 
00045   LogDebug("TIDGeom") << "DDTIDAxialCableAlgo debug: Parameters for creating "
00046                       << (zposWheel.size()+2) << " axial cables and position"
00047                       << "ing " << angles.size() << " copies in Service volume"
00048                       << "\n                            zBend " << zBend 
00049                       << " zEnd " << zEnd << " rMin " << rMin << " rMax " 
00050                       << rMax << " Cable width " << width/deg << " thickness " 
00051                       << thick << " with Angles";
00052   for (int i=0; i<(int)(angles.size()); i++)
00053     LogDebug("TIDGeom") << "\tangles[" << i << "] = " << angles[i]/deg;
00054   LogDebug("TIDGeom") << "                          Wheels " 
00055                       << zposWheel.size() << " at Z";
00056   for (int i=0; i<(int)(zposWheel.size()); i++)
00057     LogDebug("TIDGeom") << "\tzposWheel[" << i <<"] = " << zposWheel[i];
00058   LogDebug("TIDGeom") << "                          each with " 
00059                       << zposRing.size() << " Rings at Z";
00060   for (int i=0; i<(int)(zposRing.size()); i++)
00061     LogDebug("TIDGeom") << "\tzposRing[" << i <<"] = " << zposRing[i];
00062 
00063   idNameSpace = DDCurrentNamespace::ns();
00064   childName   = sArgs["ChildName"]; 
00065   matIn       = sArgs["MaterialIn"]; 
00066   matOut      = sArgs["MaterialOut"]; 
00067 
00068   DDName parentName = parent().name();
00069   LogDebug("TIDGeom") << "DDTIDAxialCableAlgo debug: Parent " << parentName
00070                       << "\tChild " << childName << " NameSpace " 
00071                       << idNameSpace << "\tMaterial " << matIn << " and " 
00072                       << matOut;
00073 }


Member Data Documentation

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

Definition at line 34 of file DDTIDAxialCableAlgo.h.

Referenced by execute(), and initialize().

std::string DDTIDAxialCableAlgo::childName [private]

Definition at line 39 of file DDTIDAxialCableAlgo.h.

Referenced by execute(), and initialize().

std::string DDTIDAxialCableAlgo::idNameSpace [private]

Definition at line 38 of file DDTIDAxialCableAlgo.h.

Referenced by execute(), and initialize().

std::string DDTIDAxialCableAlgo::matIn [private]

Definition at line 40 of file DDTIDAxialCableAlgo.h.

Referenced by execute(), and initialize().

std::string DDTIDAxialCableAlgo::matOut [private]

Definition at line 41 of file DDTIDAxialCableAlgo.h.

Referenced by execute(), and initialize().

double DDTIDAxialCableAlgo::rMax [private]

Definition at line 30 of file DDTIDAxialCableAlgo.h.

Referenced by execute(), and initialize().

double DDTIDAxialCableAlgo::rMin [private]

Definition at line 29 of file DDTIDAxialCableAlgo.h.

Referenced by execute(), and initialize().

double DDTIDAxialCableAlgo::rTop [private]

Definition at line 31 of file DDTIDAxialCableAlgo.h.

Referenced by execute(), and initialize().

double DDTIDAxialCableAlgo::thick [private]

Definition at line 33 of file DDTIDAxialCableAlgo.h.

Referenced by execute(), and initialize().

double DDTIDAxialCableAlgo::width [private]

Definition at line 32 of file DDTIDAxialCableAlgo.h.

Referenced by execute(), and initialize().

double DDTIDAxialCableAlgo::zBend [private]

Definition at line 27 of file DDTIDAxialCableAlgo.h.

Referenced by execute(), and initialize().

double DDTIDAxialCableAlgo::zEnd [private]

Definition at line 28 of file DDTIDAxialCableAlgo.h.

Referenced by execute(), and initialize().

std::vector<double> DDTIDAxialCableAlgo::zposRing [private]

Definition at line 36 of file DDTIDAxialCableAlgo.h.

Referenced by execute(), and initialize().

std::vector<double> DDTIDAxialCableAlgo::zposWheel [private]

Definition at line 35 of file DDTIDAxialCableAlgo.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