CMS 3D CMS Logo

Public Member Functions | Private Attributes

DDTECAxialCableAlgo Class Reference

#include <DDTECAxialCableAlgo.h>

List of all members.

Public Member Functions

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

Private Attributes

std::string childName
double delta
double dZ
std::string idNameSpace
std::string matName
int n
double rangeAngle
double rMax
double rMin
std::vector< double > startAngle
double thickR
double thickZ
double width
double zEnd
std::vector< double > zPos
double zStart

Detailed Description

Definition at line 10 of file DDTECAxialCableAlgo.h.


Constructor & Destructor Documentation

DDTECAxialCableAlgo::DDTECAxialCableAlgo ( )

Definition at line 20 of file DDTECAxialCableAlgo.cc.

References LogDebug.

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

Definition at line 24 of file DDTECAxialCableAlgo.cc.

{}

Member Function Documentation

void DDTECAxialCableAlgo::execute ( DDCompactView cpv)

Definition at line 79 of file DDTECAxialCableAlgo.cc.

References childName, dbl_to_string(), DDrot(), DDSplit(), delta, dZ, first, i, idNameSpace, gen::k, LogDebug, matName, n, mergeVDriftHistosByStation::name, dbtoconf::parent, phi, DDSolidFactory::polycone(), DDCompactView::position(), rMax, rMin, edm::second(), startAngle, theta(), thickR, thickZ, width, zEnd, zPos, and zStart.

                                                    {

  DDName mother = parent().name();
  double theta  = 90.*CLHEP::deg;

  for (int k=0; k<(int)(startAngle.size()); k++) {

    int i;
    double zv = zPos[k]-dZ-0.5*(zStart+zEnd);
    std::vector<double> pconZ, pconRmin, pconRmax;
    pconZ.push_back(zv);
    pconRmin.push_back(rMin);
    pconRmax.push_back(rMax);
    pconZ.push_back(zv+thickZ);
    pconRmin.push_back(rMin);
    pconRmax.push_back(rMax);
    pconZ.push_back(zv+thickZ);
    pconRmin.push_back(rMax-thickR);
    pconRmax.push_back(rMax);
    zv = zPos[k]+dZ-0.5*(zStart+zEnd);
    pconZ.push_back(zv-thickZ);
    pconRmin.push_back(rMax-thickR);
    pconRmax.push_back(rMax);
    pconZ.push_back(zv-thickZ);
    pconRmin.push_back(rMin);
    pconRmax.push_back(rMax);
    pconZ.push_back(zv);
    pconRmin.push_back(rMin);
    pconRmax.push_back(rMax);
    pconZ.push_back(zv);
    pconRmin.push_back(rMax-thickR);
    pconRmax.push_back(rMax);
    pconZ.push_back(0.5*(zEnd-zStart));
    pconRmin.push_back(rMax-thickR);
    pconRmax.push_back(rMax);

    std::string name = childName + dbl_to_string(k);
    DDSolid solid = DDSolidFactory::polycone(DDName(name, idNameSpace),
                                             -0.5*width, width, pconZ, 
                                             pconRmin, pconRmax);

    LogDebug("TECGeom") << "DDTECAxialCableAlgo test: " 
                        << DDName(name, idNameSpace) <<" Polycone made of "
                        << matName << " from " <<-0.5*width/CLHEP::deg <<" to "
                        << 0.5*width/CLHEP::deg << " and with " << pconZ.size()
                        << " sections ";
    for (int ii = 0; ii <(int)(pconZ.size()); ii++) 
      LogDebug("TECGeom") << "\t" << "\tZ[" << ii << "] = " << pconZ[ii] 
                          << "\tRmin[" << ii << "] = "<< pconRmin[ii] 
                          << "\tRmax[" << ii << "] = " << pconRmax[ii];
    DDName mat(DDSplit(matName).first, DDSplit(matName).second); 
    DDMaterial matter(mat);
    DDLogicalPart genlogic(DDName(name, idNameSpace), matter, solid);
    
    double phi = startAngle[k];
    for (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 = childName + dbl_to_string(phideg*10.);
        rotation = DDRotation(DDName(rotstr, idNameSpace));
        if (!rotation) {
          LogDebug("TECGeom") << "DDTECAxialCableAlgo 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.);
        }
      }
        
      DDTranslation tran(0,0,0);
     cpv.position(DDName(name, idNameSpace), mother, i+1, tran, rotation);
      LogDebug("TECGeom") << "DDTECAxialCableAlgo test " 
                          << DDName(name, idNameSpace) << " number " << i+1
                          << " positioned in " << mother << " at " << tran
                          << " with "  << rotation;

      phi  += delta;
    }
  }
}
void DDTECAxialCableAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)

Definition at line 26 of file DDTECAxialCableAlgo.cc.

References childName, delta, dZ, i, idNameSpace, LogDebug, matName, n, DDCurrentNamespace::ns(), dbtoconf::parent, rangeAngle, rMax, rMin, startAngle, thickR, thickZ, width, zEnd, zPos, and zStart.

                                                                       {

  n           = int(nArgs["N"]);
  rangeAngle  = nArgs["RangeAngle"];
  zStart      = nArgs["ZStart"];
  zEnd        = nArgs["ZEnd"];
  rMin        = nArgs["RMin"];
  rMax        = nArgs["RMax"];
  width       = nArgs["Width"];
  thickR      = nArgs["ThickR"];
  thickZ      = nArgs["ThickZ"];
  dZ          = nArgs["DZ"];
  startAngle  = vArgs["StartAngle"];
  zPos        = vArgs["ZPos"];
  
  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("TECGeom") << "DDTECAxialCableAlgo debug: Parameters for creating " 
                      << startAngle.size() << " axial cables and positioning "
                      << n << " copies in Service volume\n"
                      << "                            zStart " << zStart 
                      << " zEnd " << zEnd << " rMin " << rMin << " rMax "
                      << rMax << " Cable width " << width/CLHEP::deg 
                      << " thickness " << thickR << ", " << thickZ << " dZ " 
                      << dZ << "\n                            Range, Delta " 
                      << rangeAngle/CLHEP::deg << ", " << delta/CLHEP::deg;
  for (int i=0; i<(int)(startAngle.size()); i++)
    LogDebug("TECGeom") << "                          Cable " << i 
                        << " from Z " << zPos[i] << " startAngle " 
                        << startAngle[i]/CLHEP::deg;
  idNameSpace = DDCurrentNamespace::ns();
  childName   = sArgs["ChildName"]; 
  matName     = sArgs["Material"]; 

  DDName parentName = parent().name();

  LogDebug("TECGeom") << "DDTECAxialCableAlgo debug: Parent " << parentName
                      << "\tChild " << childName << " NameSpace " 
                      << idNameSpace << "\tMaterial " << matName;
}

Member Data Documentation

std::string DDTECAxialCableAlgo::childName [private]

Definition at line 42 of file DDTECAxialCableAlgo.h.

Referenced by execute(), and initialize().

double DDTECAxialCableAlgo::delta [private]

Definition at line 39 of file DDTECAxialCableAlgo.h.

Referenced by execute(), and initialize().

double DDTECAxialCableAlgo::dZ [private]

Definition at line 36 of file DDTECAxialCableAlgo.h.

Referenced by execute(), and initialize().

std::string DDTECAxialCableAlgo::idNameSpace [private]

Definition at line 41 of file DDTECAxialCableAlgo.h.

Referenced by execute(), and initialize().

std::string DDTECAxialCableAlgo::matName [private]

Definition at line 43 of file DDTECAxialCableAlgo.h.

Referenced by execute(), and initialize().

int DDTECAxialCableAlgo::n [private]

Definition at line 27 of file DDTECAxialCableAlgo.h.

Referenced by execute(), and initialize().

Definition at line 28 of file DDTECAxialCableAlgo.h.

Referenced by initialize().

double DDTECAxialCableAlgo::rMax [private]

Definition at line 32 of file DDTECAxialCableAlgo.h.

Referenced by execute(), and initialize().

double DDTECAxialCableAlgo::rMin [private]

Definition at line 31 of file DDTECAxialCableAlgo.h.

Referenced by execute(), and initialize().

std::vector<double> DDTECAxialCableAlgo::startAngle [private]

Definition at line 37 of file DDTECAxialCableAlgo.h.

Referenced by execute(), and initialize().

double DDTECAxialCableAlgo::thickR [private]

Definition at line 34 of file DDTECAxialCableAlgo.h.

Referenced by execute(), and initialize().

double DDTECAxialCableAlgo::thickZ [private]

Definition at line 35 of file DDTECAxialCableAlgo.h.

Referenced by execute(), and initialize().

double DDTECAxialCableAlgo::width [private]

Definition at line 33 of file DDTECAxialCableAlgo.h.

Referenced by execute(), and initialize().

double DDTECAxialCableAlgo::zEnd [private]

Definition at line 30 of file DDTECAxialCableAlgo.h.

Referenced by execute(), and initialize().

std::vector<double> DDTECAxialCableAlgo::zPos [private]

Definition at line 38 of file DDTECAxialCableAlgo.h.

Referenced by execute(), and initialize().

double DDTECAxialCableAlgo::zStart [private]

Definition at line 29 of file DDTECAxialCableAlgo.h.

Referenced by execute(), and initialize().