CMS 3D CMS Logo

DDHCalXtalAlgo Class Reference

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

List of all members.

Public Member Functions

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

Private Attributes

double angwidth
double dx
double dz
int iaxis
std::string idName
std::string idNameSpace
std::vector< std::string > names
double offset
double radius


Detailed Description

Definition at line 10 of file DDHCalXtalAlgo.h.


Constructor & Destructor Documentation

DDHCalXtalAlgo::DDHCalXtalAlgo (  ) 

Definition at line 17 of file DDHCalXtalAlgo.cc.

References LogDebug.

00017                                {
00018   LogDebug("HCalGeom") << "DDHCalXtalAlgo info: Creating an instance";
00019 }

DDHCalXtalAlgo::~DDHCalXtalAlgo (  )  [virtual]

Definition at line 21 of file DDHCalXtalAlgo.cc.

00021 {}


Member Function Documentation

void DDHCalXtalAlgo::execute (  ) 

Definition at line 52 of file DDHCalXtalAlgo.cc.

References funct::abs(), angle(), angwidth, DDpos(), DDrot(), dx, dz, i, iaxis, idName, idNameSpace, int, LogDebug, names, offset, dbtoconf::parent, phi, radius, funct::sin(), and theta.

00052                              {
00053 
00054   double theta[3], phi[3], pos[3];
00055   phi[0] = 0;
00056   phi[1] = 90*deg;
00057   theta[1-iaxis] = 90*deg;
00058   pos[1-iaxis]   = 0;
00059   int number = (int)(names.size());
00060   for (int i=0; i<number; i++) {
00061     double angle = 0.5*angwidth*(2*i+1-number);
00062     theta[iaxis] = 90*deg + angle;
00063     if (angle>0) {
00064       theta[2]   = angle;
00065       phi[2]     = 90*iaxis*deg;
00066     } else {
00067       theta[2]   =-angle;
00068       phi[2]     = 90*(2-3*iaxis)*deg;
00069     }
00070     pos[iaxis]   = angle*(dz+radius);
00071     pos[2]       = dx*abs(sin(angle)) + offset;
00072   
00073     DDRotation rotation;
00074     string rotstr = names[i];
00075     DDTranslation tran(pos[0], pos[1], pos[2]);
00076     DDName parentName = parent().name(); 
00077 
00078     if (abs(angle) > 0.01*deg) {
00079       LogDebug("HCalGeom") << "DDHCalXtalAlgo test: Creating a new rotation " 
00080                            << rotstr << "\t" << theta[0]/deg << "," 
00081                            << phi[0]/deg << "," << theta[1]/deg << "," 
00082                            << phi[1]/deg << "," << theta[2]/deg << "," 
00083                            << phi[2]/deg;
00084       rotation = DDrot(DDName(rotstr, idNameSpace), theta[0], phi[0], theta[1],
00085                        phi[1], theta[2], phi[2]);
00086     }
00087     DDpos (DDName(idName, idNameSpace), parentName, i+1, tran, rotation);
00088     LogDebug("HCalGeom") << "DDHCalXtalAlgo test: "
00089                          << DDName(idName,idNameSpace) << " number " << i+1 
00090                          << " positioned in " << parentName << " at " << tran
00091                          << " with " << rotation;
00092   }
00093 }

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

Definition at line 23 of file DDHCalXtalAlgo.cc.

References angwidth, dx, dz, i, iaxis, idName, idNameSpace, int, LogDebug, names, DDCurrentNamespace::ns(), offset, dbtoconf::parent, and radius.

00027                                                                         {
00028 
00029   radius     = nArgs["Radius"];
00030   offset     = nArgs["Offset"];
00031   dx         = nArgs["Dx"];
00032   dz         = nArgs["Dz"];
00033   angwidth   = nArgs["AngWidth"];
00034   iaxis      = int (nArgs["Axis"]);
00035   names      = vsArgs["Names"];
00036 
00037   LogDebug("HCalGeom") << "DDHCalXtalAlgo debug: Parameters for positioning:: "
00038                        << "Axis " << iaxis << "\tRadius " << radius 
00039                        << "\tOffset " << offset << "\tDx " << dx << "\tDz " 
00040                        << dz << "\tAngWidth " << angwidth/deg << "\tNumbers " 
00041                        << names.size();
00042   for (unsigned int i = 0; i < names.size(); i++)
00043     LogDebug("HCalGeom") << "\tnames[" << i << "] = " << names[i];
00044 
00045   idNameSpace = DDCurrentNamespace::ns();
00046   idName      = sArgs["ChildName"]; 
00047   DDName parentName = parent().name(); 
00048   LogDebug("HCalGeom") << "DDHCalXtalAlgo debug: Parent " << parentName 
00049                        << "\tChild " << idName << " NameSpace " << idNameSpace;
00050 }


Member Data Documentation

double DDHCalXtalAlgo::angwidth [private]

Definition at line 30 of file DDHCalXtalAlgo.h.

Referenced by execute(), and initialize().

double DDHCalXtalAlgo::dx [private]

Definition at line 28 of file DDHCalXtalAlgo.h.

Referenced by execute(), and initialize().

double DDHCalXtalAlgo::dz [private]

Definition at line 29 of file DDHCalXtalAlgo.h.

Referenced by execute(), and initialize().

int DDHCalXtalAlgo::iaxis [private]

Definition at line 31 of file DDHCalXtalAlgo.h.

Referenced by execute(), and initialize().

std::string DDHCalXtalAlgo::idName [private]

Definition at line 35 of file DDHCalXtalAlgo.h.

Referenced by execute(), and initialize().

std::string DDHCalXtalAlgo::idNameSpace [private]

Definition at line 34 of file DDHCalXtalAlgo.h.

Referenced by execute(), and initialize().

std::vector<std::string> DDHCalXtalAlgo::names [private]

Definition at line 32 of file DDHCalXtalAlgo.h.

Referenced by execute(), and initialize().

double DDHCalXtalAlgo::offset [private]

Definition at line 27 of file DDHCalXtalAlgo.h.

Referenced by execute(), and initialize().

double DDHCalXtalAlgo::radius [private]

Definition at line 26 of file DDHCalXtalAlgo.h.

Referenced by execute(), and initialize().


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