CMS 3D CMS Logo

Public Member Functions | Private Attributes

DDTECCoolAlgo Class Reference

#include <DDTECCoolAlgo.h>

List of all members.

Public Member Functions

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

Private Attributes

std::vector< std::string > coolInsert
std::string idNameSpace
std::vector< double > phiPosition
double rPosition
int startCopyNo

Detailed Description

Definition at line 10 of file DDTECCoolAlgo.h.


Constructor & Destructor Documentation

DDTECCoolAlgo::DDTECCoolAlgo ( )

Definition at line 21 of file DDTECCoolAlgo.cc.

References LogDebug.

                            : phiPosition(0),coolInsert(0) {
  LogDebug("TECGeom") << "DDTECCoolAlgo info: Creating an instance";
}
DDTECCoolAlgo::~DDTECCoolAlgo ( ) [virtual]

Definition at line 25 of file DDTECCoolAlgo.cc.

{}

Member Function Documentation

void DDTECCoolAlgo::execute ( DDCompactView cpv)

Definition at line 54 of file DDTECCoolAlgo.cc.

References coolInsert, funct::cos(), DDSplit(), first, i, LogDebug, dbtoconf::parent, phiPosition, DDCompactView::position(), rPosition, edm::second(), funct::sin(), and startCopyNo.

                                              {
  LogDebug("TECGeom") << "==>> Constructing DDTECCoolAlgo...";
  int copyNo  = startCopyNo;
  // loop over the inserts to be placed
  for (int i = 0; i < (int)(coolInsert.size()); i++) {
    // get objects
    DDName child  = DDName(DDSplit(coolInsert.at(i)).first, 
                           DDSplit(coolInsert.at(i)).second);
    DDName mother = parent().name();
    // get positions
    double xpos = rPosition*cos(phiPosition.at(i));
    double ypos = -rPosition*sin(phiPosition.at(i));
    // place inserts
    DDTranslation tran(xpos, ypos, 0.0);
    DDRotation rotation;
   cpv.position(child, mother, copyNo, tran, rotation);
    LogDebug("TECGeom") << "DDTECCoolAlgo test " << child << "["  
                        << copyNo << "] positioned in " << mother 
                        << " at " << tran  << " with " << rotation 
                        << " phi " << phiPosition.at(i)/CLHEP::deg << " r " 
                        << rPosition;
    copyNo++;
  }
  LogDebug("TECGeom") << "<<== End of DDTECCoolAlgo construction ...";
}
void DDTECCoolAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)

Definition at line 27 of file DDTECCoolAlgo.cc.

References coolInsert, i, idNameSpace, LogDebug, DDCurrentNamespace::ns(), dbtoconf::parent, phiPosition, rPosition, and startCopyNo.

                                                                       {

  idNameSpace    = DDCurrentNamespace::ns();
  startCopyNo    = int(nArgs["StartCopyNo"]);

  DDName parentName = parent().name(); 
  rPosition       = nArgs["RPosition"];
  LogDebug("TECGeom") << "DDTECCoolAlgo debug: Parent " << parentName 
                      <<" NameSpace " << idNameSpace << " at radial Position " 
                      << rPosition ;
  phiPosition    = vArgs["PhiPosition"]; 
  coolInsert     = vsArgs["CoolInsert"];
  if (phiPosition.size() == coolInsert.size()) {
    for (int i=0; i<(int)(phiPosition.size()); i++) 
      LogDebug("TECGeom") << "DDTECCoolAlgo debug: Insert[" << i << "]: "
                          << coolInsert.at(i) << " at Phi " 
                          << phiPosition.at(i)/CLHEP::deg;
  } else {
    LogDebug("TECGeom") << "ERROR: Number of inserts does not match the numer of PhiPositions!";
  }
  LogDebug("TECGeom") << " Done creating instance of DDTECCoolAlgo ";
}

Member Data Documentation

std::vector<std::string> DDTECCoolAlgo::coolInsert [private]

Definition at line 29 of file DDTECCoolAlgo.h.

Referenced by execute(), and initialize().

std::string DDTECCoolAlgo::idNameSpace [private]

Definition at line 25 of file DDTECCoolAlgo.h.

Referenced by initialize().

std::vector<double> DDTECCoolAlgo::phiPosition [private]

Definition at line 28 of file DDTECCoolAlgo.h.

Referenced by execute(), and initialize().

double DDTECCoolAlgo::rPosition [private]

Definition at line 27 of file DDTECCoolAlgo.h.

Referenced by execute(), and initialize().

Definition at line 26 of file DDTECCoolAlgo.h.

Referenced by execute(), and initialize().