#include <Geometry/TrackerCommonData/interface/DDTrackerPhiAltAlgo.h>
Public Member Functions | |
DDTrackerPhiAltAlgo () | |
void | execute () |
void | initialize (const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) |
virtual | ~DDTrackerPhiAltAlgo () |
Private Attributes | |
std::string | childName |
std::string | idNameSpace |
int | incrCopyNo |
int | number |
double | radiusIn |
double | radiusOut |
double | rangeAngle |
double | startAngle |
int | startCopyNo |
double | tilt |
double | zpos |
Definition at line 10 of file DDTrackerPhiAltAlgo.h.
DDTrackerPhiAltAlgo::DDTrackerPhiAltAlgo | ( | ) |
Definition at line 19 of file DDTrackerPhiAltAlgo.cc.
References LogDebug.
00019 { 00020 LogDebug("TrackerGeom") << "DDTrackerPhiAltAlgo info: Creating an instance"; 00021 }
DDTrackerPhiAltAlgo::~DDTrackerPhiAltAlgo | ( | ) | [virtual] |
void DDTrackerPhiAltAlgo::execute | ( | ) |
Definition at line 58 of file DDTrackerPhiAltAlgo.cc.
References childName, funct::cos(), dbl_to_string(), DDpos(), DDrot(), DDSplit(), first, i, idNameSpace, incrCopyNo, LogDebug, number, dbtoconf::parent, phi, radiusIn, radiusOut, rangeAngle, edm::second(), funct::sin(), startAngle, startCopyNo, theta, tilt, and zpos.
00058 { 00059 00060 if (number > 0) { 00061 double theta = 90.*deg; 00062 double dphi; 00063 if (number == 1 || fabs(rangeAngle-360.0*deg)<0.001*deg) 00064 dphi = rangeAngle/number; 00065 else 00066 dphi = rangeAngle/(number-1); 00067 int copyNo = startCopyNo; 00068 00069 DDName mother = parent().name(); 00070 DDName child(DDSplit(childName).first, DDSplit(childName).second); 00071 for (int i=0; i<number; i++) { 00072 double phi = startAngle + i*dphi; 00073 double phix = phi - tilt + 90.*deg; 00074 double phiy = phix + 90.*deg; 00075 double phideg = phix/deg; 00076 00077 DDRotation rotation; 00078 if (phideg != 0) { 00079 std::string rotstr =DDSplit(childName).first+dbl_to_string(phideg*10.); 00080 rotation = DDRotation(DDName(rotstr, idNameSpace)); 00081 if (!rotation) { 00082 LogDebug("TrackerGeom") << "DDTrackerPhiAltAlgo test: Creating a new" 00083 << " rotation " << rotstr << "\t" << "90., " 00084 << phix/deg << ", 90.," << phiy/deg 00085 << ", 0, 0"; 00086 rotation = DDrot(DDName(rotstr, idNameSpace), theta, phix, theta, 00087 phiy, 0., 0.); 00088 } 00089 } 00090 00091 double xpos, ypos; 00092 if (i%2 == 0) { 00093 xpos = radiusIn*cos(phi); 00094 ypos = radiusIn*sin(phi); 00095 } else { 00096 xpos = radiusOut*cos(phi); 00097 ypos = radiusOut*sin(phi); 00098 } 00099 DDTranslation tran(xpos, ypos, zpos); 00100 00101 DDpos (child, mother, copyNo, tran, rotation); 00102 LogDebug("TrackerGeom") << "DDTrackerPhiAltAlgo test: " << child 00103 << " number " << copyNo << " positioned in " 00104 << mother << " at " << tran << " with " 00105 << rotation; 00106 copyNo += incrCopyNo; 00107 } 00108 } 00109 }
void DDTrackerPhiAltAlgo::initialize | ( | const DDNumericArguments & | nArgs, | |
const DDVectorArguments & | vArgs, | |||
const DDMapArguments & | mArgs, | |||
const DDStringArguments & | sArgs, | |||
const DDStringVectorArguments & | vsArgs | |||
) |
Definition at line 25 of file DDTrackerPhiAltAlgo.cc.
References childName, idNameSpace, incrCopyNo, int, LogDebug, DDCurrentNamespace::ns(), number, dbtoconf::parent, radiusIn, radiusOut, rangeAngle, startAngle, startCopyNo, tilt, and zpos.
00029 { 00030 00031 tilt = nArgs["Tilt"]; 00032 startAngle = nArgs["StartAngle"]; 00033 rangeAngle = nArgs["RangeAngle"]; 00034 radiusIn = nArgs["RadiusIn"]; 00035 radiusOut = nArgs["RadiusOut"]; 00036 zpos = nArgs["ZPosition"]; 00037 number = int (nArgs["Number"]); 00038 startCopyNo= int (nArgs["StartCopyNo"]); 00039 incrCopyNo = int (nArgs["IncrCopyNo"]); 00040 00041 LogDebug("TrackerGeom") << "DDTrackerPhiAltAlgo debug: Parameters for " 00042 << "positioning--" << " Tilt " << tilt 00043 << "\tStartAngle " << startAngle/deg 00044 << "\tRangeAngle " << rangeAngle/deg << "\tRin " 00045 << radiusIn << "\tRout " << radiusOut << "\t ZPos " 00046 << zpos << "\tCopy Numbers " << number 00047 << " Start/Increment " << startCopyNo << ", " 00048 << incrCopyNo; 00049 00050 idNameSpace = DDCurrentNamespace::ns(); 00051 childName = sArgs["ChildName"]; 00052 DDName parentName = parent().name(); 00053 LogDebug("TrackerGeom") << "DDTrackerPhiAltAlgo debug: Parent " << parentName 00054 << "\tChild " << childName << " NameSpace " 00055 << idNameSpace; 00056 }
std::string DDTrackerPhiAltAlgo::childName [private] |
std::string DDTrackerPhiAltAlgo::idNameSpace [private] |
int DDTrackerPhiAltAlgo::incrCopyNo [private] |
int DDTrackerPhiAltAlgo::number [private] |
double DDTrackerPhiAltAlgo::radiusIn [private] |
double DDTrackerPhiAltAlgo::radiusOut [private] |
double DDTrackerPhiAltAlgo::rangeAngle [private] |
double DDTrackerPhiAltAlgo::startAngle [private] |
int DDTrackerPhiAltAlgo::startCopyNo [private] |
double DDTrackerPhiAltAlgo::tilt [private] |
double DDTrackerPhiAltAlgo::zpos [private] |