CMS 3D CMS Logo

Public Member Functions | Private Attributes

DDTrackerAngular Class Reference

#include <DDTrackerAngular.h>

List of all members.

Public Member Functions

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

Private Attributes

std::vector< double > center
std::string childName
double delta
std::string idNameSpace
int incrCopyNo
int n
double radius
double rangeAngle
double startAngle
int startCopyNo

Detailed Description

Definition at line 10 of file DDTrackerAngular.h.


Constructor & Destructor Documentation

DDTrackerAngular::DDTrackerAngular ( )

Definition at line 18 of file DDTrackerAngular.cc.

References LogDebug.

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

Definition at line 22 of file DDTrackerAngular.cc.

{}

Member Function Documentation

void DDTrackerAngular::execute ( DDCompactView cpv)

Definition at line 64 of file DDTrackerAngular.cc.

References center, childName, filterCSVwithJSON::copy, funct::cos(), dbl_to_string(), DDrot(), DDSplit(), delta, first, i, idNameSpace, incrCopyNo, LogDebug, n, dbtoconf::parent, phi, DDCompactView::position(), radius, idealTransformation::rotation, edm::second(), funct::sin(), startAngle, startCopyNo, AlCaHLTBitMon_QueryRunRegistry::string, and theta().

                                                 {

  DDName mother = parent().name();
  DDName child(DDSplit(childName).first, DDSplit(childName).second);
  double theta  = 90.*CLHEP::deg;
  int    copy   = startCopyNo;
  double phi    = startAngle;
  for (int i=0; i<n; i++) {
    double phix = phi;
    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") << "DDTrackerAngular 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.);
      }
    }
        
    double xpos = radius*cos(phi) + center[0];
    double ypos = radius*sin(phi) + center[1];
    double zpos = center[2];
    DDTranslation tran(xpos, ypos, zpos);
  
   cpv.position(child, mother, copy, tran, rotation);
    LogDebug("TrackerGeom") << "DDTrackerAngular test " << child << " number " 
                            << copy << " positioned in " << mother << " at "
                            << tran  << " with " << rotation;
    copy += incrCopyNo;
    phi  += delta;
  }
}
void DDTrackerAngular::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)

Definition at line 24 of file DDTrackerAngular.cc.

References center, childName, delta, idNameSpace, incrCopyNo, LogDebug, n, DDCurrentNamespace::ns(), dbtoconf::parent, radius, rangeAngle, startAngle, and startCopyNo.

                                                                    {

  n           = int(nArgs["N"]);
  startCopyNo = int(nArgs["StartCopyNo"]);
  incrCopyNo  = int(nArgs["IncrCopyNo"]);
  rangeAngle  = nArgs["RangeAngle"];
  startAngle  = nArgs["StartAngle"];
  radius      = nArgs["Radius"];
  center      = vArgs["Center"];
  
  if (fabs(rangeAngle-360.0*CLHEP::deg)<0.001*CLHEP::deg) { 
    delta    =   rangeAngle/double(n);
  } else {
    if (n > 1) {
      delta    =   rangeAngle/double(n-1);
    } else {
      delta = 0.;
    }
  }  

  LogDebug("TrackerGeom") << "DDTrackerAngular debug: Parameters for position"
                          << "ing:: n " << n << " Start, Range, Delta " 
                          << startAngle/CLHEP::deg << " " 
                          << rangeAngle/CLHEP::deg << " " << delta/CLHEP::deg
                          << " Radius " << radius << " Centre " << center[0] 
                          << ", " << center[1] << ", "<<center[2];

  idNameSpace = DDCurrentNamespace::ns();
  childName   = sArgs["ChildName"]; 

  DDName parentName = parent().name();
  LogDebug("TrackerGeom") << "DDTrackerAngular debug: Parent " << parentName 
                          << "\tChild " << childName << " NameSpace "
                          << idNameSpace;
}

Member Data Documentation

std::vector<double> DDTrackerAngular::center [private]

Definition at line 33 of file DDTrackerAngular.h.

Referenced by execute(), and initialize().

std::string DDTrackerAngular::childName [private]

Definition at line 37 of file DDTrackerAngular.h.

Referenced by execute(), and initialize().

double DDTrackerAngular::delta [private]

Definition at line 34 of file DDTrackerAngular.h.

Referenced by execute(), and initialize().

std::string DDTrackerAngular::idNameSpace [private]

Definition at line 36 of file DDTrackerAngular.h.

Referenced by execute(), and initialize().

Definition at line 29 of file DDTrackerAngular.h.

Referenced by execute(), and initialize().

int DDTrackerAngular::n [private]

Definition at line 27 of file DDTrackerAngular.h.

Referenced by execute(), and initialize().

double DDTrackerAngular::radius [private]

Definition at line 32 of file DDTrackerAngular.h.

Referenced by execute(), and initialize().

double DDTrackerAngular::rangeAngle [private]

Definition at line 30 of file DDTrackerAngular.h.

Referenced by initialize().

double DDTrackerAngular::startAngle [private]

Definition at line 31 of file DDTrackerAngular.h.

Referenced by execute(), and initialize().

Definition at line 28 of file DDTrackerAngular.h.

Referenced by execute(), and initialize().