CMS 3D CMS Logo

Public Member Functions | Private Attributes

DDTECPhiAltAlgo Class Reference

#include <DDTECPhiAltAlgo.h>

List of all members.

Public Member Functions

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

Private Attributes

std::string childName
std::string idNameSpace
double incrAngle
int incrCopyNo
int number
double radius
double startAngle
int startCopyNo
double zIn
double zOut

Detailed Description

Definition at line 10 of file DDTECPhiAltAlgo.h.


Constructor & Destructor Documentation

DDTECPhiAltAlgo::DDTECPhiAltAlgo ( )

Definition at line 18 of file DDTECPhiAltAlgo.cc.

References LogDebug.

                                 {
  LogDebug("TECGeom") << "DDTECPhiAltAlgo info: Creating an instance";
}
DDTECPhiAltAlgo::~DDTECPhiAltAlgo ( ) [virtual]

Definition at line 22 of file DDTECPhiAltAlgo.cc.

{}

Member Function Documentation

void DDTECPhiAltAlgo::execute ( DDCompactView cpv)

Definition at line 55 of file DDTECPhiAltAlgo.cc.

References childName, funct::cos(), dbl_to_string(), DDrot(), DDSplit(), first, i, idNameSpace, incrAngle, incrCopyNo, LogDebug, number, dbtoconf::parent, DDCompactView::position(), radius, edm::second(), funct::sin(), startAngle, startCopyNo, theta(), zIn, and zOut.

                                                {

  if (number > 0) {
    double theta  = 90.*CLHEP::deg;
    int    copyNo = startCopyNo;

    DDName mother = parent().name();
    DDName child(DDSplit(childName).first, DDSplit(childName).second);
    for (int i=0; i<number; i++) {
      double phiz = startAngle + i*incrAngle;
      double phix = phiz + 90.*CLHEP::deg;
      double phideg = phiz/CLHEP::deg;
  
      DDRotation rotation;
      std::string rotstr = DDSplit(childName).first+dbl_to_string(phideg*10.);
      rotation = DDRotation(DDName(rotstr, idNameSpace));
      if (!rotation) {
        LogDebug("TECGeom") << "DDTECPhiAltAlgo test: Creating a new "
                            << "rotation " << rotstr << "\t" 
                            << theta/CLHEP::deg << ", " << phix/CLHEP::deg 
                            << ", 0, 0, " << theta/CLHEP::deg << ", " 
                            << phiz/CLHEP::deg;
        rotation = DDrot(DDName(rotstr, idNameSpace), theta, phix, 0., 0.,
                         theta, phiz);
      }
        
      double xpos = radius*cos(phiz);
      double ypos = radius*sin(phiz);
      double zpos;
      if (i%2 == 0) zpos = zIn;
      else          zpos = zOut;
      DDTranslation tran(xpos, ypos, zpos);
  
     cpv.position(child, mother, copyNo, tran, rotation);
      LogDebug("TECGeom") << "DDTECPhiAltAlgo test: " << child <<" number "
                          << copyNo << " positioned in " << mother <<" at "
                          << tran << " with " << rotation;
      copyNo += incrCopyNo;
    }
  }
}
void DDTECPhiAltAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)

Definition at line 24 of file DDTECPhiAltAlgo.cc.

References childName, idNameSpace, incrAngle, incrCopyNo, LogDebug, DDCurrentNamespace::ns(), number, dbtoconf::parent, radius, startAngle, startCopyNo, zIn, and zOut.

                                                                   {

  startAngle = nArgs["StartAngle"];
  incrAngle  = nArgs["IncrAngle"];
  radius     = nArgs["Radius"];
  zIn        = nArgs["ZIn"];
  zOut       = nArgs["ZOut"];
  number     = int (nArgs["Number"]);
  startCopyNo= int (nArgs["StartCopyNo"]);
  incrCopyNo = int (nArgs["IncrCopyNo"]);

  LogDebug("TECGeom") << "DDTECPhiAltAlgo debug: Parameters for "
                      << "positioning--" << "\tStartAngle " 
                      << startAngle/CLHEP::deg << "\tIncrAngle " 
                      << incrAngle/CLHEP::deg << "\tRadius " << radius 
                      << "\tZ in/out " << zIn << ", " << zOut 
                      << "\tCopy Numbers " << number  << " Start/Increment " 
                      << startCopyNo << ", " << incrCopyNo;

  idNameSpace = DDCurrentNamespace::ns();
  childName   = sArgs["ChildName"]; 
  DDName parentName = parent().name();
  LogDebug("TECGeom") << "DDTECPhiAltAlgo debug: Parent " << parentName 
                      << "\tChild " << childName << " NameSpace " 
                      << idNameSpace;
}

Member Data Documentation

std::string DDTECPhiAltAlgo::childName [private]

Definition at line 37 of file DDTECPhiAltAlgo.h.

Referenced by execute(), and initialize().

std::string DDTECPhiAltAlgo::idNameSpace [private]

Definition at line 36 of file DDTECPhiAltAlgo.h.

Referenced by execute(), and initialize().

double DDTECPhiAltAlgo::incrAngle [private]

Definition at line 28 of file DDTECPhiAltAlgo.h.

Referenced by execute(), and initialize().

Definition at line 34 of file DDTECPhiAltAlgo.h.

Referenced by execute(), and initialize().

int DDTECPhiAltAlgo::number [private]

Definition at line 32 of file DDTECPhiAltAlgo.h.

Referenced by execute(), and initialize().

double DDTECPhiAltAlgo::radius [private]

Definition at line 29 of file DDTECPhiAltAlgo.h.

Referenced by execute(), and initialize().

double DDTECPhiAltAlgo::startAngle [private]

Definition at line 27 of file DDTECPhiAltAlgo.h.

Referenced by execute(), and initialize().

Definition at line 33 of file DDTECPhiAltAlgo.h.

Referenced by execute(), and initialize().

double DDTECPhiAltAlgo::zIn [private]

Definition at line 30 of file DDTECPhiAltAlgo.h.

Referenced by execute(), and initialize().

double DDTECPhiAltAlgo::zOut [private]

Definition at line 31 of file DDTECPhiAltAlgo.h.

Referenced by execute(), and initialize().