CMS 3D CMS Logo

DDHCalForwardAlgo Class Reference

#include <Geometry/HcalAlgo/interface/DDHCalForwardAlgo.h>

List of all members.

Public Member Functions

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

Private Attributes

double cellDx
double cellDy
double cellDz
std::string cellMat
std::vector< std::string > childName
std::string idNameSpace
std::vector< intnumber
std::vector< intsize
double startY
std::vector< inttype


Detailed Description

Definition at line 10 of file DDHCalForwardAlgo.h.


Constructor & Destructor Documentation

DDHCalForwardAlgo::DDHCalForwardAlgo (  ) 

Definition at line 20 of file DDHCalForwardAlgo.cc.

References LogDebug.

00020                                     : number(0),size(0),type(0) {
00021   LogDebug("HCalGeom") << "DDHCalForwardAlgo info: Creating an instance";
00022 }

DDHCalForwardAlgo::~DDHCalForwardAlgo (  )  [virtual]

Definition at line 24 of file DDHCalForwardAlgo.cc.

00024 {}


Member Function Documentation

void DDHCalForwardAlgo::execute (  ) 

Definition at line 61 of file DDHCalForwardAlgo.cc.

References DDSolidFactory::box(), cellDx, cellDy, cellDz, cellMat, childName, dbl_to_string(), DDBase< N, C >::ddname(), DDpos(), DDSplit(), first, i, idNameSpace, j, k, LogDebug, name, number, dbtoconf::parent, r1, rot, edm::second(), size, and startY.

00061                                 {
00062   
00063   LogDebug("HCalGeom") << "==>> Constructing DDHCalForwardAlgo...";
00064 
00065   DDName parentName = parent().name(); 
00066   string idName     = DDSplit(parentName).first;
00067   double ypos       = startY;
00068   int    box        = 0;
00069 
00070   for (unsigned int i=0; i<number.size(); i++) {
00071     double dx   = cellDx*size[i];
00072     int    indx = type[i];
00073     for (int j=0; j<number[i]; j++) {
00074       box++;
00075       string name = idName + dbl_to_string(box);
00076       DDSolid solid = DDSolidFactory::box(DDName(name, idNameSpace),
00077                                           dx, cellDy, cellDz);
00078       LogDebug("HCalGeom") << "DDHCalForwardAlgo test: " 
00079                            << DDName(name, idNameSpace) << " Box made of " 
00080                            << cellMat << " of Size " << dx << ", " << cellDy
00081                            << ", " << cellDz;
00082   
00083       DDName matname(DDSplit(cellMat).first, DDSplit(cellMat).second); 
00084       DDMaterial matter(matname);
00085       DDLogicalPart genlogic(solid.ddname(), matter, solid);
00086 
00087       DDTranslation r0(0.0, ypos, 0.0);
00088       DDRotation rot;
00089       DDpos(solid.ddname(), parentName, box, r0, rot);
00090       LogDebug("HCalGeom") << "DDHCalForwardAlgo test: " << solid.ddname() 
00091                            << " number " << box << " positioned in " 
00092                            << parentName << " at " << r0 << " with " << rot;
00093   
00094       DDName child(DDSplit(childName[indx]).first, 
00095                    DDSplit(childName[indx]).second); 
00096       double xpos = -dx + cellDx;
00097       ypos       += 2*cellDy;
00098       indx        = 1 - indx;
00099 
00100       for (int k=0; k<size[i]; k++) {
00101         DDTranslation r1(xpos, 0.0, 0.0);
00102         DDpos (child, solid.ddname(), k+1, r1, rot);
00103         LogDebug("HCalGeom") << "DDHCalForwardAlgo test: " << child 
00104                              << " number " << k+1 << " positioned in " 
00105                              << solid.ddname() << " at " << r1 << " with "
00106                              << rot;
00107         xpos += 2*cellDx;
00108       }
00109     }  
00110   }
00111   LogDebug("HCalGeom") << "<<== End of DDHCalForwardAlgo construction ...";
00112 }

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

Definition at line 27 of file DDHCalForwardAlgo.cc.

References cellDx, cellDy, cellDz, cellMat, childName, dbl_to_int(), i, idNameSpace, LogDebug, DDCurrentNamespace::ns(), number, dbtoconf::parent, size, and startY.

00031                                                                            {
00032 
00033   cellMat     = sArgs["CellMaterial"];
00034   cellDx      = nArgs["CellDx"];
00035   cellDy      = nArgs["CellDy"];
00036   cellDz      = nArgs["CellDz"];
00037   startY      = nArgs["StartY"];
00038 
00039   childName   = vsArgs["Child"];
00040   number      = dbl_to_int(vArgs["Number"]);
00041   size        = dbl_to_int(vArgs["Size"]);
00042   type        = dbl_to_int(vArgs["Type"]);
00043 
00044   LogDebug("HCalGeom") << "DDHCalForwardAlgo debug: Cell material " << cellMat
00045                        << "\tCell Size "  << cellDx << ", " << cellDy << ", "
00046                        << cellDz << "\tStarting Y " << startY << "\tChildren "
00047                        << childName[0] << ", " << childName[1] << "\n"
00048                        << "                         Cell positioning done for "
00049                        << number.size() << " times";
00050   for (unsigned int i = 0; i < number.size(); i++)
00051     LogDebug("HCalGeom") << "\t" << i << " Number of children " << size[i] 
00052                          << " occurence " << number[i] << " first child index "
00053                          << type[i];
00054 
00055   idNameSpace = DDCurrentNamespace::ns();
00056   DDName parentName = parent().name(); 
00057   LogDebug("HCalGeom") << "DDHCalForwardAlgo debug: Parent " << parentName
00058                        << " NameSpace " << idNameSpace;
00059 }


Member Data Documentation

double DDHCalForwardAlgo::cellDx [private]

Definition at line 27 of file DDHCalForwardAlgo.h.

Referenced by execute(), and initialize().

double DDHCalForwardAlgo::cellDy [private]

Definition at line 27 of file DDHCalForwardAlgo.h.

Referenced by execute(), and initialize().

double DDHCalForwardAlgo::cellDz [private]

Definition at line 27 of file DDHCalForwardAlgo.h.

Referenced by execute(), and initialize().

std::string DDHCalForwardAlgo::cellMat [private]

Definition at line 26 of file DDHCalForwardAlgo.h.

Referenced by execute(), and initialize().

std::vector<std::string> DDHCalForwardAlgo::childName [private]

Definition at line 29 of file DDHCalForwardAlgo.h.

Referenced by execute(), and initialize().

std::string DDHCalForwardAlgo::idNameSpace [private]

Definition at line 34 of file DDHCalForwardAlgo.h.

Referenced by execute(), and initialize().

std::vector<int> DDHCalForwardAlgo::number [private]

Definition at line 30 of file DDHCalForwardAlgo.h.

Referenced by execute(), and initialize().

std::vector<int> DDHCalForwardAlgo::size [private]

Definition at line 31 of file DDHCalForwardAlgo.h.

Referenced by execute(), and initialize().

double DDHCalForwardAlgo::startY [private]

Definition at line 28 of file DDHCalForwardAlgo.h.

Referenced by execute(), and initialize().

std::vector<int> DDHCalForwardAlgo::type [private]

Definition at line 32 of file DDHCalForwardAlgo.h.


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