#include <Geometry/TrackerCommonData/interface/DDTrackerPhiAlgo.h>
Public Member Functions | |
DDTrackerPhiAlgo () | |
void | execute () |
void | initialize (const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) |
virtual | ~DDTrackerPhiAlgo () |
Private Attributes | |
std::string | childName |
std::string | idNameSpace |
int | incrcn |
size_t | numcopies |
std::vector< double > | phi |
double | radius |
size_t | startcn |
double | tilt |
std::vector< double > | zpos |
Definition at line 10 of file DDTrackerPhiAlgo.h.
DDTrackerPhiAlgo::DDTrackerPhiAlgo | ( | ) |
DDTrackerPhiAlgo::~DDTrackerPhiAlgo | ( | ) | [virtual] |
void DDTrackerPhiAlgo::execute | ( | ) |
Definition at line 71 of file DDTrackerPhiAlgo.cc.
References childName, funct::cos(), dbl_to_string(), DDpos(), DDrot(), DDSplit(), first, i, idNameSpace, incrcn, LogDebug, numcopies, dbtoconf::parent, phi, radius, edm::second(), funct::sin(), startcn, theta, tilt, and zpos.
00071 { 00072 00073 DDName mother = parent().name(); 00074 DDName child(DDSplit(childName).first, DDSplit(childName).second); 00075 double theta = 90.*deg; 00076 int i = 0; 00077 for (size_t ci=startcn; ci<numcopies+1; ci = ci+incrcn) { 00078 double phix = phi[i] + tilt; 00079 double phiy = phix + 90.*deg; 00080 double phideg = phi[i]/deg; 00081 00082 std::string rotstr = DDSplit(childName).first + dbl_to_string(phideg); 00083 DDRotation rotation = DDRotation(DDName(rotstr, idNameSpace)); 00084 if (!rotation) { 00085 LogDebug("TrackerGeom") << "DDTrackerPhiAlgo test: Creating a new " 00086 << "rotation: " << rotstr << "\t" << "90., " 00087 << phix/deg << ", 90.," << phiy/deg << ", 0, 0"; 00088 rotation = DDrot(DDName(rotstr, idNameSpace), theta, phix, theta, phiy, 00089 0., 0.); 00090 } 00091 00092 double xpos = radius*cos(phi[i]); 00093 double ypos = radius*sin(phi[i]); 00094 DDTranslation tran(xpos, ypos, zpos[i]); 00095 00096 DDpos (child, mother, ci, tran, rotation); 00097 LogDebug("TrackerGeom") << "DDTrackerPhiAlgo test: " << child << " number " 00098 << i+1 << " positioned in " << mother << " at " 00099 << tran << " with " << rotation; 00100 ++i; 00101 } 00102 }
void DDTrackerPhiAlgo::initialize | ( | const DDNumericArguments & | nArgs, | |
const DDVectorArguments & | vArgs, | |||
const DDMapArguments & | mArgs, | |||
const DDStringArguments & | sArgs, | |||
const DDStringVectorArguments & | vsArgs | |||
) |
Definition at line 25 of file DDTrackerPhiAlgo.cc.
References childName, i, idNameSpace, incrcn, int, LogDebug, DDCurrentNamespace::ns(), numcopies, dbtoconf::parent, phi, radius, startcn, tilt, and zpos.
00029 { 00030 00031 if ( nArgs.find("StartCopyNo") != nArgs.end() ) { 00032 startcn = size_t(nArgs["StartCopyNo"]); 00033 } 00034 if ( nArgs.find("IncrCopyNo") != nArgs.end() ) { 00035 incrcn = int(nArgs["IncrCopyNo"]); 00036 } 00037 00038 radius = nArgs["Radius"]; 00039 tilt = nArgs["Tilt"]; 00040 phi = vArgs["Phi"]; 00041 zpos = vArgs["ZPos"]; 00042 00043 if ( nArgs.find("NumCopies") != nArgs.end() ) { 00044 numcopies = size_t(nArgs["NumCopies"]); 00045 if ( numcopies != phi.size() ) { 00046 edm::LogError("TrackerGeom") << "DDTrackerPhiAlgo error: Parameter NumCopies " 00047 << "does not agree with the size of the Phi " 00048 << "vector. It was adjusted to be the size " 00049 << "of the Phi vector and may lead to crashes " 00050 << "or errors."; 00051 } 00052 } 00053 numcopies = phi.size() - 1; // -1 for loop in execute. seems almost redundant... 00054 00055 00056 LogDebug("TrackerGeom") << "DDTrackerPhiAlgo debug: Parameters for position" 00057 << "ing:: " << " Radius " << radius << " Tilt " 00058 << tilt/deg << " Copies " << phi.size() << " at"; 00059 for (int i=0; i<(int)(phi.size()); i++) 00060 LogDebug("TrackerGeom") << "\t[" << i << "] phi = " << phi[i]/deg 00061 << " z = " << zpos[i]; 00062 00063 idNameSpace = DDCurrentNamespace::ns(); 00064 childName = sArgs["ChildName"]; 00065 DDName parentName = parent().name(); 00066 LogDebug("TrackerGeom") << "DDTrackerPhiAlgo debug: Parent " << parentName 00067 <<"\tChild " << childName << " NameSpace " 00068 << idNameSpace; 00069 }
std::string DDTrackerPhiAlgo::childName [private] |
std::string DDTrackerPhiAlgo::idNameSpace [private] |
int DDTrackerPhiAlgo::incrcn [private] |
size_t DDTrackerPhiAlgo::numcopies [private] |
std::vector<double> DDTrackerPhiAlgo::phi [private] |
double DDTrackerPhiAlgo::radius [private] |
size_t DDTrackerPhiAlgo::startcn [private] |
double DDTrackerPhiAlgo::tilt [private] |
std::vector<double> DDTrackerPhiAlgo::zpos [private] |