CMS 3D CMS Logo

Public Member Functions | Private Attributes

DDTrackerLinear Class Reference

#include <DDTrackerLinear.h>

List of all members.

Public Member Functions

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

Private Attributes

std::vector< double > centre
std::string childName
double delta
std::string idNameSpace
int incrcn
int number
double offset
double phi
std::string rotMat
int startcn
double theta

Detailed Description

Definition at line 10 of file DDTrackerLinear.h.


Constructor & Destructor Documentation

DDTrackerLinear::DDTrackerLinear ( )

Definition at line 17 of file DDTrackerLinear.cc.

References LogDebug.

                                 : startcn(1), incrcn(1) {
  LogDebug("TrackerGeom") << "DDTrackerLinear info: Creating an instance";
}
DDTrackerLinear::~DDTrackerLinear ( ) [virtual]

Definition at line 21 of file DDTrackerLinear.cc.

{}

Member Function Documentation

void DDTrackerLinear::execute ( DDCompactView cpv)

Definition at line 60 of file DDTrackerLinear.cc.

References newFWLiteAna::base, centre, childName, funct::cos(), DDSplit(), delta, first, i, LogDebug, number, offset, dbtoconf::parent, phi, DDCompactView::position(), rotMat, edm::second(), funct::sin(), startcn, and theta.

                                                {

  DDName mother = parent().name();
  DDName child(DDSplit(childName).first, DDSplit(childName).second);
  DDTranslation direction(sin(theta)*cos(phi),sin(theta)*sin(phi),cos(theta));
  DDTranslation base(centre[0],centre[1],centre[2]);
  std::string rotstr = DDSplit(rotMat).first;
  DDRotation rot;
  if (rotstr != "NULL") {
    std::string rotns  = DDSplit(rotMat).second;
    rot = DDRotation(DDName(rotstr, rotns));
  }
  int ci = startcn;
  for (int i=0; i<number; i++) {
        
    DDTranslation tran = base + (offset + double(i)*delta)*direction;
   cpv.position(child, mother, ci, tran, rot);
    LogDebug("TrackerGeom") << "DDTrackerLinear test: " << child << " number "
                            << ci << " positioned in " << mother << " at "
                            << tran << " with " << rot;
    ++ci;
  }
}
void DDTrackerLinear::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)

Definition at line 23 of file DDTrackerLinear.cc.

References centre, childName, delta, idNameSpace, incrcn, LogDebug, DDCurrentNamespace::ns(), number, offset, dbtoconf::parent, phi, rotMat, startcn, and theta.

                                                                  {

  number    = int(nArgs["Number"]);
  theta     = nArgs["Theta"];
  phi       = nArgs["Phi"];
  offset    = nArgs["Offset"];
  delta     = nArgs["Delta"];
  centre    = vArgs["Center"];
  rotMat    = sArgs["Rotation"];
  if ( nArgs.find("StartCopyNo") != nArgs.end() ) {
    startcn = size_t(nArgs["StartCopyNo"]);
  } else {
    startcn = 1;
  }
  if ( nArgs.find("IncrCopyNo") != nArgs.end() ) {
    incrcn = int(nArgs["IncrCopyNo"]);
  } else {
    incrcn = 1;
  }
  
  idNameSpace = DDCurrentNamespace::ns();
  childName   = sArgs["ChildName"]; 
  DDName parentName = parent().name();
  LogDebug("TrackerGeom") << "DDTrackerLinear debug: Parent " << parentName 
                          << "\tChild " << childName << " NameSpace " 
                          << idNameSpace << "\tNumber " << number 
                          << "\tAxis (theta/phi) " << theta/CLHEP::deg << ", "
                          << phi/CLHEP::deg << "\t(Offset/Delta) " << offset 
                          << ", "  << delta << "\tCentre " << centre[0] << ", "
                          << centre[1] << ", " << centre[2] << "\tRotation "
                          << rotMat;
}

Member Data Documentation

std::vector<double> DDTrackerLinear::centre [private]

Definition at line 35 of file DDTrackerLinear.h.

Referenced by execute(), and initialize().

std::string DDTrackerLinear::childName [private]

Definition at line 27 of file DDTrackerLinear.h.

Referenced by execute(), and initialize().

double DDTrackerLinear::delta [private]

Definition at line 34 of file DDTrackerLinear.h.

Referenced by execute(), and initialize().

std::string DDTrackerLinear::idNameSpace [private]

Definition at line 26 of file DDTrackerLinear.h.

Referenced by initialize().

int DDTrackerLinear::incrcn [private]

Definition at line 30 of file DDTrackerLinear.h.

Referenced by initialize().

int DDTrackerLinear::number [private]

Definition at line 28 of file DDTrackerLinear.h.

Referenced by execute(), and initialize().

double DDTrackerLinear::offset [private]

Definition at line 33 of file DDTrackerLinear.h.

Referenced by execute(), and initialize().

double DDTrackerLinear::phi [private]

Definition at line 32 of file DDTrackerLinear.h.

Referenced by execute(), and initialize().

std::string DDTrackerLinear::rotMat [private]

Definition at line 36 of file DDTrackerLinear.h.

Referenced by execute(), and initialize().

int DDTrackerLinear::startcn [private]

Definition at line 29 of file DDTrackerLinear.h.

Referenced by execute(), and initialize().

double DDTrackerLinear::theta [private]

Definition at line 31 of file DDTrackerLinear.h.

Referenced by execute(), and initialize().