![]() |
![]() |
#include <Geometry/HcalAlgo/interface/DDHCalForwardAlgo.h>
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< int > | number |
std::vector< int > | size |
double | startY |
std::vector< int > | type |
Definition at line 10 of file DDHCalForwardAlgo.h.
DDHCalForwardAlgo::DDHCalForwardAlgo | ( | ) |
DDHCalForwardAlgo::~DDHCalForwardAlgo | ( | ) | [virtual] |
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 }
double DDHCalForwardAlgo::cellDx [private] |
double DDHCalForwardAlgo::cellDy [private] |
double DDHCalForwardAlgo::cellDz [private] |
std::string DDHCalForwardAlgo::cellMat [private] |
std::vector<std::string> DDHCalForwardAlgo::childName [private] |
std::string DDHCalForwardAlgo::idNameSpace [private] |
std::vector<int> DDHCalForwardAlgo::number [private] |
std::vector<int> DDHCalForwardAlgo::size [private] |
double DDHCalForwardAlgo::startY [private] |
std::vector<int> DDHCalForwardAlgo::type [private] |
Definition at line 32 of file DDHCalForwardAlgo.h.