CMS 3D CMS Logo

DDPixBarLayerAlgo Class Reference

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

List of all members.

Public Member Functions

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

Private Attributes

double coolDist
double coolDz
std::string coolMat
double coolSide
double coolThick
double coolWidth
std::string genMat
std::string idNameSpace
std::vector< std::string > ladder
std::vector< double > ladderThick
std::vector< double > ladderWidth
double layerDz
int number
double sensorEdge
std::string tubeMat


Detailed Description

Definition at line 10 of file DDPixBarLayerAlgo.h.


Constructor & Destructor Documentation

DDPixBarLayerAlgo::DDPixBarLayerAlgo (  ) 

Definition at line 22 of file DDPixBarLayerAlgo.cc.

References LogDebug.

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

DDPixBarLayerAlgo::~DDPixBarLayerAlgo (  )  [virtual]

Definition at line 26 of file DDPixBarLayerAlgo.cc.

00026 {}


Member Function Documentation

void DDPixBarLayerAlgo::execute (  ) 

Definition at line 70 of file DDPixBarLayerAlgo.cc.

References coolDist, coolDz, coolMat, coolSide, coolThick, coolWidth, edmNew::copy(), funct::cos(), d1, d2, dbl_to_string(), DDBase< N, C >::ddname(), DDpos(), DDrot(), DDSplit(), first, genMat, h1, i, idNameSpace, ladder, ladderThick, ladderWidth, layerDz, LogDebug, name, DDBase< N, C >::name(), number, dbtoconf::parent, phi, rot, edm::second(), sensorEdge, funct::sin(), funct::sqrt(), DDSolidFactory::trap(), tubeMat, and DDSolidFactory::tubs().

00070                                 {
00071 
00072   DDName      mother = parent().name();
00073   std::string idName = DDSplit(mother).first;
00074 
00075   double dphi = twopi/number;
00076   double d2   = 0.5*coolWidth;
00077   double d1   = d2 - coolSide*sin(0.5*dphi);
00078   double x1   = (d1+d2)/(2.*sin(0.5*dphi));
00079   double x2   = coolDist*sin(0.5*dphi);
00080   double rmin = (coolDist-0.5*(d1+d2))*cos(0.5*dphi)-0.5*ladderThick[0];
00081   double rmax = (coolDist+0.5*(d1+d2))*cos(0.5*dphi)+0.5*ladderThick[0];
00082   double rmxh = rmax - 0.5*ladderThick[0] + ladderThick[1];
00083   LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: Rmin/Rmax " << rmin 
00084                         << ", " << rmax << " d1/d2 " << d1 << ", " << d2 
00085                         << " x1/x2 " << x1 << ", " << x2;
00086 
00087   double rtmi = rmin + 0.5*ladderThick[0] - ladderThick[1];
00088   double rtmx = sqrt(rmxh*rmxh+ladderWidth[1]*ladderWidth[1]);
00089   DDSolid solid = DDSolidFactory::tubs(DDName(idName, idNameSpace),0.5*layerDz,
00090                                        rtmi, rtmx, 0, twopi);
00091   LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: " 
00092                         << DDName(idName, idNameSpace) << " Tubs made of " 
00093                         << genMat << " from 0 to " << twopi/deg 
00094                         << " with Rin " << rtmi << " Rout " << rtmx 
00095                         << " ZHalf " << 0.5*layerDz;
00096   DDName matname(DDSplit(genMat).first, DDSplit(genMat).second);
00097   DDMaterial matter(matname);
00098   DDLogicalPart layer(solid.ddname(), matter, solid);
00099 
00100   double rr = 0.5*(rmax+rmin);
00101   double dr = 0.5*(rmax-rmin);
00102   double h1 = 0.5*coolSide*cos(0.5*dphi);
00103   std::string name = idName + "CoolTube";
00104   solid = DDSolidFactory::trap(DDName(name,idNameSpace), 0.5*coolDz, 0, 0,
00105                                h1, d2, d1, 0, h1, d2, d1, 0);
00106   LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: " <<solid.name() 
00107                         << " Trap made of " << tubeMat << " of dimensions " 
00108                         << 0.5*coolDz << ", 0, 0, " << h1 << ", " << d2 
00109                         << ", " << d1 << ", 0, " << h1 << ", " << d2 << ", " 
00110                         << d1 << ", 0";
00111   matter = DDMaterial(DDName(DDSplit(tubeMat).first, DDSplit(tubeMat).second));
00112   DDLogicalPart coolTube(solid.ddname(), matter, solid);
00113 
00114   name = idName + "Coolant";
00115   h1  -= coolThick;
00116   d1  -= coolThick;
00117   d2  -= coolThick;
00118   solid = DDSolidFactory::trap(DDName(name,idNameSpace), 0.5*coolDz, 0, 0,
00119                                h1, d2, d1, 0, h1, d2, d1, 0);
00120   LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: " <<solid.name() 
00121                         << " Trap made of " << coolMat << " of dimensions " 
00122                         << 0.5*coolDz << ", 0, 0, " << h1 << ", " << d2
00123                         << ", " << d1 << ", 0, " << h1 << ", " << d2 << ", " 
00124                         << d1 << ", 0";
00125   matter = DDMaterial(DDName(DDSplit(coolMat).first, DDSplit(coolMat).second));
00126   DDLogicalPart cool(solid.ddname(), matter, solid);
00127   DDpos (cool, coolTube, 1, DDTranslation(0.0, 0.0, 0.0), DDRotation());
00128   LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: " << cool.name() 
00129                         << " number 1 positioned in " << coolTube.name() 
00130                         << " at (0,0,0) with no rotation";
00131 
00132   DDName ladderFull(DDSplit(ladder[0]).first, DDSplit(ladder[0]).second);
00133   DDName ladderHalf(DDSplit(ladder[1]).first, DDSplit(ladder[1]).second);
00134 
00135   int nphi=number/2, copy=1, iup=-1;
00136   double phi0 = 90*deg;
00137   for (int i=0; i<number; i++) {
00138         
00139     double phi = phi0 + i*dphi;
00140     double phix, phiy, rrr, xx;
00141     std::string rots;
00142     DDTranslation tran;
00143     DDRotation rot;
00144     if (i == 0 || i == nphi) {
00145       rrr  = rr + dr + 0.5*(ladderThick[1]-ladderThick[0]);
00146       xx   = (0.5*ladderWidth[1] - sensorEdge) * sin(phi);
00147       tran = DDTranslation(xx, rrr*sin(phi), 0);
00148       rots = idName + dbl_to_string(copy);
00149       phix = phi-90*deg;
00150       phiy = 90*deg+phix;
00151       LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: Creating a new "
00152                             << "rotation: " << rots << "\t90., " << phix/deg 
00153                             << ", 90.," << phiy/deg << ", 0, 0";
00154       rot = DDrot(DDName(rots,idNameSpace), 90*deg, phix, 90*deg, phiy, 0.,0.);
00155       DDpos (ladderHalf, layer, copy, tran, rot);
00156       LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: " << ladderHalf 
00157                             << " number " << copy << " positioned in " 
00158                             << layer.name() << " at " << tran << " with " 
00159                             << rot;
00160       copy++;
00161       iup  = -1;
00162       rrr  = rr - dr - 0.5*(ladderThick[1]-ladderThick[0]);
00163       tran = DDTranslation(-xx, rrr*sin(phi), 0);
00164       rots = idName + dbl_to_string(copy);
00165       phix = phi+90*deg;
00166       phiy = 90*deg+phix;
00167       LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: Creating a new "
00168                             << "rotation: " << rots << "\t90., " << phix/deg 
00169                             << ", 90.," << phiy/deg << ", 0, 0";
00170       rot = DDrot(DDName(rots,idNameSpace), 90*deg, phix, 90*deg, phiy, 0.,0.);
00171       DDpos (ladderHalf, layer, copy, tran, rot);
00172       LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: " << ladderHalf 
00173                             << " number " << copy << " positioned in " 
00174                             << layer.name() << " at " << tran << " with " 
00175                             << rot;
00176       copy++;
00177     } else {
00178       iup  =-iup;
00179       rrr  = rr + iup*dr;
00180       tran = DDTranslation(rrr*cos(phi), rrr*sin(phi), 0);
00181       rots = idName + dbl_to_string(copy);
00182       if (iup > 0) phix = phi-90*deg;
00183       else         phix = phi+90*deg;
00184       phiy = phix+90.*deg;
00185       LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: Creating a new "
00186                             << "rotation: " << rots << "\t90., " << phix/deg 
00187                             << ", 90.," << phiy/deg << ", 0, 0";
00188       rot = DDrot(DDName(rots,idNameSpace), 90*deg, phix, 90*deg, phiy, 0.,0.);
00189       DDpos (ladderFull, layer, copy, tran, rot);
00190       LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: " << ladderFull 
00191                             << " number " << copy << " positioned in " 
00192                             << layer.name() << " at " << tran << " with " 
00193                             << rot;
00194       copy++;
00195     }
00196     rrr  = coolDist*cos(0.5*dphi);
00197     tran = DDTranslation(rrr*cos(phi)-x2*sin(phi), 
00198                          rrr*sin(phi)+x2*cos(phi), 0);
00199     rots = idName + dbl_to_string(i+100);
00200     phix = phi+0.5*dphi;
00201     if (iup > 0) phix += 180*deg;
00202     phiy = phix+90.*deg;
00203     LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: Creating a new "
00204                           << "rotation: " << rots << "\t90., " << phix/deg 
00205                           << ", 90.," << phiy/deg << ", 0, 0";
00206     rot = DDrot(DDName(rots,idNameSpace), 90*deg, phix, 90*deg, phiy, 0.,0.);
00207     DDpos (coolTube, layer, i+1, tran, rot);
00208     LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: " << coolTube.name() 
00209                           << " number " << i+1 << " positioned in " 
00210                           << layer.name() << " at " << tran << " with "<< rot;
00211   }
00212 }

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

Definition at line 28 of file DDPixBarLayerAlgo.cc.

References coolDist, coolDz, coolMat, coolSide, coolThick, coolWidth, genMat, idNameSpace, int, ladder, ladderThick, ladderWidth, layerDz, LogDebug, DDCurrentNamespace::ns(), number, dbtoconf::parent, sensorEdge, and tubeMat.

00032                                                                            {
00033 
00034   idNameSpace = DDCurrentNamespace::ns();
00035   DDName parentName = parent().name();
00036 
00037   genMat    = sArgs["GeneralMaterial"];
00038   number    = int(nArgs["Ladders"]);
00039   layerDz   = nArgs["LayerDz"];
00040   sensorEdge= nArgs["SensorEdge"];
00041   coolDz    = nArgs["CoolDz"];
00042   coolWidth = nArgs["CoolWidth"];
00043   coolSide  = nArgs["CoolSide"];
00044   coolThick = nArgs["CoolThick"];
00045   coolDist  = nArgs["CoolDist"];
00046   coolMat   = sArgs["CoolMaterial"];
00047   tubeMat   = sArgs["CoolTubeMaterial"];
00048 
00049   LogDebug("PixelGeom") << "DDPixBarLayerAlgo debug: Parent " << parentName 
00050                         << " NameSpace " << idNameSpace << "\n"
00051                         << "\tLadders " << number << "\tGeneral Material " 
00052                         << genMat << "\tLength " << layerDz << "\tSensorEdge "
00053                         << sensorEdge << "\tSpecification of Cooling Pieces:\n"
00054                         << "\tLength " << coolDz << " Width " << coolWidth 
00055                         << " Side " << coolSide << " Thickness of Shell " 
00056                         << coolThick << " Radial distance " << coolDist 
00057                         << " Materials " << coolMat << ", " << tubeMat;
00058 
00059   ladder      = vsArgs["LadderName"];
00060   ladderWidth = vArgs["LadderWidth"];
00061   ladderThick = vArgs["LadderThick"];
00062   
00063   LogDebug("PixelGeom") << "DDPixBarLayerAlgo debug: Full Ladder " 
00064                         << ladder[0] << " width/thickness " << ladderWidth[0]
00065                         << ", " << ladderThick[0] << "\tHalf Ladder " 
00066                         << ladder[1] << " width/thickness " << ladderWidth[1]
00067                         << ", " << ladderThick[1];
00068 }


Member Data Documentation

double DDPixBarLayerAlgo::coolDist [private]

Definition at line 35 of file DDPixBarLayerAlgo.h.

Referenced by execute(), and initialize().

double DDPixBarLayerAlgo::coolDz [private]

Definition at line 31 of file DDPixBarLayerAlgo.h.

Referenced by execute(), and initialize().

std::string DDPixBarLayerAlgo::coolMat [private]

Definition at line 36 of file DDPixBarLayerAlgo.h.

Referenced by execute(), and initialize().

double DDPixBarLayerAlgo::coolSide [private]

Definition at line 33 of file DDPixBarLayerAlgo.h.

Referenced by execute(), and initialize().

double DDPixBarLayerAlgo::coolThick [private]

Definition at line 34 of file DDPixBarLayerAlgo.h.

Referenced by execute(), and initialize().

double DDPixBarLayerAlgo::coolWidth [private]

Definition at line 32 of file DDPixBarLayerAlgo.h.

Referenced by execute(), and initialize().

std::string DDPixBarLayerAlgo::genMat [private]

Definition at line 27 of file DDPixBarLayerAlgo.h.

Referenced by execute(), and initialize().

std::string DDPixBarLayerAlgo::idNameSpace [private]

Definition at line 26 of file DDPixBarLayerAlgo.h.

Referenced by execute(), and initialize().

std::vector<std::string> DDPixBarLayerAlgo::ladder [private]

Definition at line 38 of file DDPixBarLayerAlgo.h.

Referenced by execute(), and initialize().

std::vector<double> DDPixBarLayerAlgo::ladderThick [private]

Definition at line 40 of file DDPixBarLayerAlgo.h.

Referenced by execute(), and initialize().

std::vector<double> DDPixBarLayerAlgo::ladderWidth [private]

Definition at line 39 of file DDPixBarLayerAlgo.h.

Referenced by execute(), and initialize().

double DDPixBarLayerAlgo::layerDz [private]

Definition at line 29 of file DDPixBarLayerAlgo.h.

Referenced by execute(), and initialize().

int DDPixBarLayerAlgo::number [private]

Definition at line 28 of file DDPixBarLayerAlgo.h.

Referenced by execute(), and initialize().

double DDPixBarLayerAlgo::sensorEdge [private]

Definition at line 30 of file DDPixBarLayerAlgo.h.

Referenced by execute(), and initialize().

std::string DDPixBarLayerAlgo::tubeMat [private]

Definition at line 37 of file DDPixBarLayerAlgo.h.

Referenced by execute(), and initialize().


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