#include <DDTECOptoHybAlgo.h>
Public Member Functions | |
DDTECOptoHybAlgo () | |
void | execute (DDCompactView &cpv) |
void | initialize (const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) |
virtual | ~DDTECOptoHybAlgo () |
Private Attributes | |
std::vector< double > | angles |
std::string | childName |
std::string | idNameSpace |
double | optoHeight |
double | optoWidth |
double | rpos |
int | startCopyNo |
double | zpos |
Definition at line 10 of file DDTECOptoHybAlgo.h.
DDTECOptoHybAlgo::DDTECOptoHybAlgo | ( | ) |
Definition at line 18 of file DDTECOptoHybAlgo.cc.
References LogDebug.
DDTECOptoHybAlgo::~DDTECOptoHybAlgo | ( | ) | [virtual] |
Definition at line 22 of file DDTECOptoHybAlgo.cc.
{}
void DDTECOptoHybAlgo::execute | ( | DDCompactView & | cpv | ) |
Definition at line 56 of file DDTECOptoHybAlgo.cc.
References angles, childName, funct::cos(), dbl_to_string(), DDrot(), DDSplit(), first, i, idNameSpace, LogDebug, optoHeight, optoWidth, dbtoconf::parent, DDCompactView::position(), idealTransformation::rotation, rpos, edm::second(), funct::sin(), startCopyNo, theta(), and zpos.
{ LogDebug("TECGeom") << "==>> Constructing DDTECOptoHybAlgo..."; DDName mother = parent().name(); DDName child = DDName(DDSplit(childName).first, DDSplit(childName).second); // given r positions are for the lower left corner rpos += optoHeight/2; int copyNo = startCopyNo; for (int i = 0; i < (int)(angles.size()); i++) { double phix = -angles.at(i); // given phi positions are for the lower left corner phix += asin(optoWidth/2/rpos); double xpos = rpos * cos(phix); double ypos = rpos * sin(phix); DDTranslation tran(xpos, ypos, zpos); DDRotation rotation; double phiy = phix + 90.*CLHEP::deg; double phideg = phix/CLHEP::deg; if (phideg != 0) { std::string rotstr= DDSplit(childName).first+dbl_to_string(phideg*1000.); rotation = DDRotation(DDName(rotstr, idNameSpace)); if (!rotation) { double theta = 90.*CLHEP::deg; LogDebug("TECGeom") << "DDTECOptoHybAlgo test: Creating a new " << "rotation: " << rotstr << "\t90., " << phix/CLHEP::deg << ", 90.," << phiy/CLHEP::deg << ", 0, 0"; rotation = DDrot(DDName(rotstr, idNameSpace), theta, phix, theta, phiy, 0., 0.); } } cpv.position(child, mother, copyNo, tran, rotation); LogDebug("TECGeom") << "DDTECOptoHybAlgo test " << child << " number " << copyNo << " positioned in " << mother << " at " << tran << " with " << rotation; copyNo++; } LogDebug("TECGeom") << "<<== End of DDTECOptoHybAlgo construction ..."; }
void DDTECOptoHybAlgo::initialize | ( | const DDNumericArguments & | nArgs, |
const DDVectorArguments & | vArgs, | ||
const DDMapArguments & | mArgs, | ||
const DDStringArguments & | sArgs, | ||
const DDStringVectorArguments & | vsArgs | ||
) |
Definition at line 24 of file DDTECOptoHybAlgo.cc.
References angles, childName, i, idNameSpace, LogDebug, DDCurrentNamespace::ns(), optoHeight, optoWidth, dbtoconf::parent, rpos, startCopyNo, and zpos.
{ idNameSpace = DDCurrentNamespace::ns(); childName = sArgs["ChildName"]; DDName parentName = parent().name(); LogDebug("TECGeom") << "DDTECOptoHybAlgo debug: Parent " << parentName << " Child " << childName << " NameSpace " <<idNameSpace; optoHeight = nArgs["OptoHeight"]; optoWidth = nArgs["OptoWidth"]; rpos = nArgs["Rpos"]; zpos = nArgs["Zpos"]; startCopyNo = int (nArgs["StartCopyNo"]); angles = vArgs["Angles"]; LogDebug("TECGeom") << "DDTECOptoHybAlgo debug: Height of the Hybrid " << optoHeight << " and Width " << optoWidth <<"Rpos " << rpos << " Zpos " << zpos << " StartCopyNo " << startCopyNo << " Number " << angles.size(); for (int i = 0; i < (int)(angles.size()); i++) LogDebug("TECGeom") << "\tAngles[" << i << "] = " << angles[i]; }
std::vector<double> DDTECOptoHybAlgo::angles [private] |
Definition at line 33 of file DDTECOptoHybAlgo.h.
Referenced by execute(), and initialize().
std::string DDTECOptoHybAlgo::childName [private] |
Definition at line 27 of file DDTECOptoHybAlgo.h.
Referenced by execute(), and initialize().
std::string DDTECOptoHybAlgo::idNameSpace [private] |
Definition at line 26 of file DDTECOptoHybAlgo.h.
Referenced by execute(), and initialize().
double DDTECOptoHybAlgo::optoHeight [private] |
Definition at line 30 of file DDTECOptoHybAlgo.h.
Referenced by execute(), and initialize().
double DDTECOptoHybAlgo::optoWidth [private] |
Definition at line 31 of file DDTECOptoHybAlgo.h.
Referenced by execute(), and initialize().
double DDTECOptoHybAlgo::rpos [private] |
Definition at line 28 of file DDTECOptoHybAlgo.h.
Referenced by execute(), and initialize().
int DDTECOptoHybAlgo::startCopyNo [private] |
Definition at line 32 of file DDTECOptoHybAlgo.h.
Referenced by execute(), and initialize().
double DDTECOptoHybAlgo::zpos [private] |
Definition at line 29 of file DDTECOptoHybAlgo.h.
Referenced by execute(), and initialize().