CMS 3D CMS Logo

Public Member Functions | Private Attributes

DDTrackerPhiAltAlgo Class Reference

#include <DDTrackerPhiAltAlgo.h>

List of all members.

Public Member Functions

 DDTrackerPhiAltAlgo ()
void execute (DDCompactView &cpv)
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

Detailed Description

Definition at line 10 of file DDTrackerPhiAltAlgo.h.


Constructor & Destructor Documentation

DDTrackerPhiAltAlgo::DDTrackerPhiAltAlgo ( )

Definition at line 18 of file DDTrackerPhiAltAlgo.cc.

References LogDebug.

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

Definition at line 22 of file DDTrackerPhiAltAlgo.cc.

{}

Member Function Documentation

void DDTrackerPhiAltAlgo::execute ( DDCompactView cpv)

Definition at line 57 of file DDTrackerPhiAltAlgo.cc.

References childName, funct::cos(), dbl_to_string(), DDrot(), DDSplit(), first, i, idNameSpace, incrCopyNo, LogDebug, number, dbtoconf::parent, phi, DDCompactView::position(), radiusIn, radiusOut, rangeAngle, idealTransformation::rotation, edm::second(), funct::sin(), startAngle, startCopyNo, AlCaHLTBitMon_QueryRunRegistry::string, theta(), tilt, and zpos.

                                                    {

  if (number > 0) {
    double theta  = 90.*CLHEP::deg;
    double dphi;
    if (number == 1 || fabs(rangeAngle-360.0*CLHEP::deg)<0.001*CLHEP::deg) 
      dphi = rangeAngle/number;
    else
      dphi = rangeAngle/(number-1);
    int copyNo = startCopyNo;

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

Definition at line 24 of file DDTrackerPhiAltAlgo.cc.

References childName, idNameSpace, incrCopyNo, LogDebug, DDCurrentNamespace::ns(), number, dbtoconf::parent, radiusIn, radiusOut, rangeAngle, startAngle, startCopyNo, tilt, and zpos.

                                                                       {

  tilt       = nArgs["Tilt"];
  startAngle = nArgs["StartAngle"];
  rangeAngle = nArgs["RangeAngle"];
  radiusIn   = nArgs["RadiusIn"];
  radiusOut  = nArgs["RadiusOut"];
  zpos       = nArgs["ZPosition"];
  number     = int (nArgs["Number"]);
  startCopyNo= int (nArgs["StartCopyNo"]);
  incrCopyNo = int (nArgs["IncrCopyNo"]);

  LogDebug("TrackerGeom") << "DDTrackerPhiAltAlgo debug: Parameters for "
                          << "positioning--" << " Tilt " << tilt 
                          << "\tStartAngle " << startAngle/CLHEP::deg 
                          << "\tRangeAngle " << rangeAngle/CLHEP::deg 
                          << "\tRin " << radiusIn << "\tRout " << radiusOut 
                          << "\t ZPos " << zpos << "\tCopy Numbers " << number 
                          << " Start/Increment " << startCopyNo << ", " 
                          << incrCopyNo;

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

Member Data Documentation

std::string DDTrackerPhiAltAlgo::childName [private]

Definition at line 38 of file DDTrackerPhiAltAlgo.h.

Referenced by execute(), and initialize().

std::string DDTrackerPhiAltAlgo::idNameSpace [private]

Definition at line 37 of file DDTrackerPhiAltAlgo.h.

Referenced by execute(), and initialize().

Definition at line 35 of file DDTrackerPhiAltAlgo.h.

Referenced by execute(), and initialize().

Definition at line 33 of file DDTrackerPhiAltAlgo.h.

Referenced by execute(), and initialize().

Definition at line 30 of file DDTrackerPhiAltAlgo.h.

Referenced by execute(), and initialize().

Definition at line 31 of file DDTrackerPhiAltAlgo.h.

Referenced by execute(), and initialize().

Definition at line 29 of file DDTrackerPhiAltAlgo.h.

Referenced by execute(), and initialize().

Definition at line 28 of file DDTrackerPhiAltAlgo.h.

Referenced by execute(), and initialize().

Definition at line 34 of file DDTrackerPhiAltAlgo.h.

Referenced by execute(), and initialize().

double DDTrackerPhiAltAlgo::tilt [private]

Definition at line 27 of file DDTrackerPhiAltAlgo.h.

Referenced by execute(), and initialize().

double DDTrackerPhiAltAlgo::zpos [private]

Definition at line 32 of file DDTrackerPhiAltAlgo.h.

Referenced by execute(), and initialize().