CMS 3D CMS Logo

Public Member Functions | Private Attributes

DDTrackerXYZPosAlgo Class Reference

#include <DDTrackerXYZPosAlgo.h>

List of all members.

Public Member Functions

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

Private Attributes

std::string childName
std::string idNameSpace
int incrCopyNo
std::vector< std::string > rotMat
int startCopyNo
std::vector< double > xvec
std::vector< double > yvec
std::vector< double > zvec

Detailed Description

Definition at line 10 of file DDTrackerXYZPosAlgo.h.


Constructor & Destructor Documentation

DDTrackerXYZPosAlgo::DDTrackerXYZPosAlgo ( )

Definition at line 17 of file DDTrackerXYZPosAlgo.cc.

References LogDebug.

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

Definition at line 21 of file DDTrackerXYZPosAlgo.cc.

{}

Member Function Documentation

void DDTrackerXYZPosAlgo::execute ( DDCompactView cpv)

Definition at line 52 of file DDTrackerXYZPosAlgo.cc.

References childName, filterCSVwithJSON::copy, DDSplit(), first, i, incrCopyNo, LogDebug, dbtoconf::parent, DDCompactView::position(), makeMuonMisalignmentScenario::rot, rotMat, edm::second(), startCopyNo, xvec, yvec, and zvec.

                                                    {

  int    copy   = startCopyNo;
  DDName mother = parent().name();
  DDName child(DDSplit(childName).first, DDSplit(childName).second);

  for (int i=0; i<(int)(zvec.size()); i++) {
        
    DDTranslation tran(xvec[i], yvec[i], zvec[i]);
    std::string rotstr = DDSplit(rotMat[i]).first;
    DDRotation rot;
    if (rotstr != "NULL") {
      std::string rotns  = DDSplit(rotMat[i]).second;
      rot = DDRotation(DDName(rotstr, rotns));
    }
   cpv.position(child, mother, copy, tran, rot);
    LogDebug("TrackerGeom") << "DDTrackerXYZPosAlgo test: " << child 
                            <<" number " << copy << " positioned in " 
                            << mother << " at " << tran << " with " << rot;
    copy += incrCopyNo;
  }
}
void DDTrackerXYZPosAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)

Definition at line 23 of file DDTrackerXYZPosAlgo.cc.

References childName, i, idNameSpace, incrCopyNo, LogDebug, DDCurrentNamespace::ns(), dbtoconf::parent, rotMat, startCopyNo, xvec, yvec, and zvec.

                                                                           {

  startCopyNo = int(nArgs["StartCopyNo"]);
  incrCopyNo  = int(nArgs["IncrCopyNo"]);
  xvec        = vArgs["XPositions"];
  yvec        = vArgs["YPositions"];
  zvec        = vArgs["ZPositions"];
  rotMat      = vsArgs["Rotations"];
  
  idNameSpace = DDCurrentNamespace::ns();
  childName   = sArgs["ChildName"]; 
  DDName parentName = parent().name();
  LogDebug("TrackerGeom") << "DDTrackerXYZPosAlgo debug: Parent " << parentName 
                          << "\tChild " << childName << " NameSpace " 
                          << idNameSpace << "\tCopyNo (Start/Increment) " 
                          << startCopyNo << ", " << incrCopyNo << "\tNumber " 
                          << xvec.size() << ", " << yvec.size() << ", " << zvec.size();
  for (int i = 0; i < (int)(zvec.size()); i++) {
    LogDebug("TrackerGeom") << "\t[" << i << "]\tX = " << xvec[i]
                            << "\t[" << i << "]\tY = " << yvec[i] 
                            << "\t[" << i << "]\tZ = " << zvec[i] 
                            << ", Rot.Matrix = " << rotMat[i];
  }
}

Member Data Documentation

std::string DDTrackerXYZPosAlgo::childName [private]

Definition at line 32 of file DDTrackerXYZPosAlgo.h.

Referenced by execute(), and initialize().

std::string DDTrackerXYZPosAlgo::idNameSpace [private]

Definition at line 31 of file DDTrackerXYZPosAlgo.h.

Referenced by initialize().

Definition at line 34 of file DDTrackerXYZPosAlgo.h.

Referenced by execute(), and initialize().

std::vector<std::string> DDTrackerXYZPosAlgo::rotMat [private]

Definition at line 29 of file DDTrackerXYZPosAlgo.h.

Referenced by execute(), and initialize().

Definition at line 33 of file DDTrackerXYZPosAlgo.h.

Referenced by execute(), and initialize().

std::vector<double> DDTrackerXYZPosAlgo::xvec [private]

Definition at line 26 of file DDTrackerXYZPosAlgo.h.

Referenced by execute(), and initialize().

std::vector<double> DDTrackerXYZPosAlgo::yvec [private]

Definition at line 27 of file DDTrackerXYZPosAlgo.h.

Referenced by execute(), and initialize().

std::vector<double> DDTrackerXYZPosAlgo::zvec [private]

Definition at line 28 of file DDTrackerXYZPosAlgo.h.

Referenced by execute(), and initialize().