CMS 3D CMS Logo

Public Member Functions | Private Attributes

DDTrackerZPosAlgo Class Reference

#include <DDTrackerZPosAlgo.h>

List of all members.

Public Member Functions

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

Private Attributes

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

Detailed Description

Definition at line 10 of file DDTrackerZPosAlgo.h.


Constructor & Destructor Documentation

DDTrackerZPosAlgo::DDTrackerZPosAlgo ( )

Definition at line 17 of file DDTrackerZPosAlgo.cc.

References LogDebug.

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

Definition at line 21 of file DDTrackerZPosAlgo.cc.

{}

Member Function Documentation

void DDTrackerZPosAlgo::execute ( DDCompactView cpv)

Definition at line 48 of file DDTrackerZPosAlgo.cc.

References childName, filterCSVwithJSON::copy, DDSplit(), first, i, incrCopyNo, LogDebug, dbtoconf::parent, DDCompactView::position(), makeMuonMisalignmentScenario::rot, rotMat, edm::second(), startCopyNo, 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(0, 0, 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") << "DDTrackerZPosAlgo test: " << child <<" number "
                            << copy << " positioned in " << mother << " at "
                            << tran << " with " << rot;
    copy += incrCopyNo;
  }
}
void DDTrackerZPosAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)

Definition at line 23 of file DDTrackerZPosAlgo.cc.

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

                                                                           {

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

Member Data Documentation

std::string DDTrackerZPosAlgo::childName [private]

Definition at line 30 of file DDTrackerZPosAlgo.h.

Referenced by execute(), and initialize().

std::string DDTrackerZPosAlgo::idNameSpace [private]

Definition at line 29 of file DDTrackerZPosAlgo.h.

Referenced by initialize().

Definition at line 32 of file DDTrackerZPosAlgo.h.

Referenced by execute(), and initialize().

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

Definition at line 27 of file DDTrackerZPosAlgo.h.

Referenced by execute(), and initialize().

Definition at line 31 of file DDTrackerZPosAlgo.h.

Referenced by execute(), and initialize().

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

Definition at line 26 of file DDTrackerZPosAlgo.h.

Referenced by execute(), and initialize().