CMS 3D CMS Logo

Public Member Functions | Private Attributes

DDTIBRadCableAlgo_MTCC Class Reference

#include <DDTIBRadCableAlgo_MTCC.h>

List of all members.

Public Member Functions

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

Private Attributes

std::vector< std::string > cableMat
double cableT
double cylinderT
double deltaR
std::string idNameSpace
std::vector< double > layers
std::vector< double > layRin
double rMax
double rMin
std::vector< std::string > strucMat
double supportDR
std::string supportMat
double supportT

Detailed Description

Definition at line 10 of file DDTIBRadCableAlgo_MTCC.h.


Constructor & Destructor Documentation

DDTIBRadCableAlgo_MTCC::DDTIBRadCableAlgo_MTCC ( )

Definition at line 21 of file DDTIBRadCableAlgo_MTCC.cc.

References LogDebug.

                                              : layRin(0),cableMat(0),strucMat(0), layers(0) {
  LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC info: Creating an instance";
}
DDTIBRadCableAlgo_MTCC::~DDTIBRadCableAlgo_MTCC ( ) [virtual]

Definition at line 25 of file DDTIBRadCableAlgo_MTCC.cc.

{}

Member Function Documentation

void DDTIBRadCableAlgo_MTCC::execute ( DDCompactView cpv)

Definition at line 79 of file DDTIBRadCableAlgo_MTCC.cc.

References cableMat, cableT, cylinderT, dbl_to_string(), DDSplit(), deltaR, relativeConstraints::empty, first, i, idNameSpace, cuy::ii, j, layers, layRin, LogDebug, mergeVDriftHistosByStation::name, dbtoconf::parent, DDSolidFactory::polycone(), DDCompactView::position(), diffTwoXMLs::r1, diffTwoXMLs::r2, rMax, rMin, edm::second(), AlCaHLTBitMon_QueryRunRegistry::string, strucMat, supportDR, supportMat, supportT, and DDSolidFactory::tubs().

                                                       {
  
  LogDebug("TIBGeom") << "==>> Constructing DDTIBRadCableAlgo_MTCC...";
  DDName diskName = parent().name();

  DDSolid solid;
  std::string  name;
  double  rin, rout;

  // Loop over sub disks
  DDName suppName(DDSplit(supportMat).first, DDSplit(supportMat).second);
  DDMaterial suppMatter(suppName);
  double diskDz = 0.5 * (supportT + cableT*layRin.size());
  double dz     = 0.5*supportT;

  for (unsigned int i=0; i<layRin.size(); i++) {

    // fill only layers in layers list
    bool empty=true;
    for(unsigned int j=0; j<layers.size(); j++) {
      if(i+1==(unsigned int)layers[j]) {
        empty=false;
      }
    }
    
    if(!empty) {
      //Support disks
      name  = "TIBSupportSideDisk" + dbl_to_string(i);
      rin   = layRin[i]+0.5*(deltaR-cylinderT)-supportDR;
      rout  = layRin[i]+0.5*(deltaR+cylinderT)+supportDR;
      solid = DDSolidFactory::tubs(DDName(name, idNameSpace), dz, rin, 
                                   rout, 0, CLHEP::twopi);
      LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC test: " 
                          << DDName(name, idNameSpace) << " Tubs made of "
                          << supportMat << " from 0 to " 
                          << CLHEP::twopi/CLHEP::deg << " with Rin " << rin 
                          << " Rout " << rout << " ZHalf " << dz;
      DDLogicalPart suppLogic(DDName(name, idNameSpace), suppMatter, solid);
      
      DDTranslation r1(0, 0, (dz-diskDz));
      cpv.position(DDName(name,idNameSpace), diskName, i+1, r1, DDRotation());
      LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC test: " 
                          << DDName(name,idNameSpace) << " number " << i+1 
                          << " positioned in " << diskName << " at " << r1 
                          << " with no rotation";
      
      //Open Structure
      name  = "TIBOpenZone" + dbl_to_string(i);
      rout  = rin;
      if (i == 0) rin = rMin;
      else        rin = layRin[i-1]+0.5*(deltaR+cylinderT)+supportDR;
      solid = DDSolidFactory::tubs(DDName(name, idNameSpace), dz, rin, 
                                   rout, 0, CLHEP::twopi);
      LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC test: "
                          << DDName(name, idNameSpace) << " Tubs made of " 
                          << strucMat[i] << " from 0 to "
                          << CLHEP::twopi/CLHEP::deg << " with Rin " << rin 
                          << " Rout " << rout << " ZHalf " << dz;
      DDName strucName(DDSplit(strucMat[i]).first, DDSplit(strucMat[i]).second);
      DDMaterial strucMatter(strucName);
      DDLogicalPart strucLogic(DDName(name, idNameSpace), strucMatter, solid);
      
      DDTranslation r2(0, 0, (dz-diskDz));
      cpv.position(DDName(name,idNameSpace), diskName, i+1, r2, DDRotation());
      LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC test: " 
                          << DDName(name,idNameSpace) << " number " << i+1 
                          << " positioned in " << diskName 
                          << " at " << r2 << " with no rotation";
      
      //Now the radial cable
      name  = "TIBRadCable" + dbl_to_string(i);
      double rv = layRin[i]+0.5*deltaR;
      std::vector<double> pgonZ;
      pgonZ.push_back(-0.5*cableT); 
      pgonZ.push_back(cableT*(rv/rMax-0.5));
      pgonZ.push_back(0.5*cableT);
      std::vector<double> pgonRmin;
      pgonRmin.push_back(rv); 
      pgonRmin.push_back(rv); 
      pgonRmin.push_back(rv); 
      std::vector<double> pgonRmax;
      pgonRmax.push_back(rMax); 
      pgonRmax.push_back(rMax); 
      pgonRmax.push_back(rv); 
      solid = DDSolidFactory::polycone(DDName(name, idNameSpace), 0,
                                       CLHEP::twopi,pgonZ, pgonRmin, pgonRmax);
      LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC test: "
                          << DDName(name, idNameSpace) 
                          << " Polycone made of " << cableMat[i]
                          << " from 0 to " << CLHEP::twopi/CLHEP::deg 
                          << " and with " << pgonZ.size() << " sections";
      for (unsigned int ii = 0; ii <pgonZ.size(); ii++) 
        LogDebug("TIBGeom") << "\t" << "\tZ = " << pgonZ[ii] << "\tRmin = " 
                            << pgonRmin[ii] << "\tRmax = " << pgonRmax[ii];
      DDName cableName(DDSplit(cableMat[i]).first,DDSplit(cableMat[i]).second);
      LogDebug("TIBGeom") << " material cableName " << i << " " << cableName;
      DDMaterial cableMatter(cableName);
      DDLogicalPart cableLogic(DDName(name, idNameSpace), cableMatter, solid);
      
      DDTranslation r3(0, 0, (diskDz-(i+0.5)*cableT));
      cpv.position(DDName(name,idNameSpace), diskName, i+1, r3, DDRotation());
      LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC test: " 
                          << DDName(name,idNameSpace) << " number " << i+1
                          << " positioned in " << diskName << " at "
                          << r3 << " with no rotation";
      
    }
    //
    
    // fill only layers in layers list
    empty=true;
    for(unsigned int j=0; j<layers.size(); j++) {
      if(i+1==(unsigned int)layers[j]) {
        empty=false;
      }
    }
    
    if(!empty) {
      //Now the last open zone
      unsigned int i = layRin.size();
      rin  = layRin[i-1]+0.5*(deltaR+cylinderT)+supportDR;
      rout = rMax;
      name  = "TIBOpenZone" + dbl_to_string(i);
      solid = DDSolidFactory::tubs(DDName(name, idNameSpace), dz, rin, 
                                   rout, 0, CLHEP::twopi);
      LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC test: "
                          << DDName(name, idNameSpace) << " Tubs made of "
                          << strucMat[i] << " from 0 to " 
                          << CLHEP::twopi/CLHEP::deg << " with Rin " << rin 
                          << " Rout " << rout << " ZHalf " << dz;
      DDName strucName(DDSplit(strucMat[i]).first,DDSplit(strucMat[i]).second);
      DDMaterial strucMatter(strucName);
      DDLogicalPart strucLogic(DDName(name, idNameSpace), strucMatter, solid);
      
      DDTranslation r2(0, 0, (dz-diskDz));
      cpv.position(DDName(name,idNameSpace), diskName, i+1, r2, DDRotation());
      LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC test: "
                          << DDName(name,idNameSpace) << " number " << i+1 
                          << " positioned in " << diskName 
                          << " at " << r2 << " with no rotation";
    } 
  }
  LogDebug("TIBGeom") << "<<== End of DDTIBRadCableAlgo_MTCC construction ...";
 
}
void DDTIBRadCableAlgo_MTCC::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)

Definition at line 27 of file DDTIBRadCableAlgo_MTCC.cc.

References cableMat, cableT, cylinderT, deltaR, i, idNameSpace, layers, layRin, LogDebug, DDCurrentNamespace::ns(), dbtoconf::parent, rMax, rMin, strucMat, supportDR, supportMat, and supportT.

                                                                                {

  idNameSpace  = DDCurrentNamespace::ns();
  unsigned int i;
  DDName parentName = parent().name();
  LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC debug: Parent " << parentName 
                      << " NameSpace " << idNameSpace;

  rMin         = nArgs["RMin"];
  rMax         = nArgs["RMax"];
  layRin       = vArgs["RadiusLo"];    
  deltaR       = nArgs["DeltaR"];
  LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC debug: Disk Rmin " << rMin
                      << "\tRMax " << rMax  << "\tSeparation of layers " 
                      << deltaR <<" with " << layRin.size() <<" layers at R =";
  for (i = 0; i < layRin.size(); i++)
    LogDebug("TIBGeom") << " " << i << " : " << layRin[i];
  
  cylinderT    = nArgs["CylinderThick"];
  supportT     = nArgs["SupportThick"];
  supportDR    = nArgs["SupportDR"];
  supportMat   = sArgs["SupportMaterial"];
  LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC debug: SupportCylinder "
                      << "Thickness " << cylinderT << "\tSupportDisk "
                      << "Thickness " << supportT << "\tExtra width along R " 
                      << supportDR << "\tMaterial: " << supportMat;

  cableT       = nArgs["CableThick"];     
  cableMat     = vsArgs["CableMaterial"];
  LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC debug: Cable Thickness "
                      << cableT  << " with materials: ";
  for (i = 0; i < cableMat.size(); i++)
    LogDebug("TIBGeom") << " " << i << " : " << cableMat[i];

  strucMat     = vsArgs["StructureMaterial"];
  LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC debug: " << strucMat.size()
                      << " materials for open structure:";
  for (i=0; i<strucMat.size(); i++)
    LogDebug("TIBGeom") << " " << i << " : " << strucMat[i];
  
  layers       = vArgs["Layers"];
  LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC debug: " << layers.size()
                      << " layers:";
  for (i=0; i<layers.size(); i++)
    LogDebug("TIBGeom") << " " << i << " : " << layers[i];
  
}

Member Data Documentation

std::vector<std::string> DDTIBRadCableAlgo_MTCC::cableMat [private]

Definition at line 37 of file DDTIBRadCableAlgo_MTCC.h.

Referenced by execute(), and initialize().

Definition at line 36 of file DDTIBRadCableAlgo_MTCC.h.

Referenced by execute(), and initialize().

Definition at line 32 of file DDTIBRadCableAlgo_MTCC.h.

Referenced by execute(), and initialize().

Definition at line 31 of file DDTIBRadCableAlgo_MTCC.h.

Referenced by execute(), and initialize().

std::string DDTIBRadCableAlgo_MTCC::idNameSpace [private]

Definition at line 26 of file DDTIBRadCableAlgo_MTCC.h.

Referenced by execute(), and initialize().

std::vector<double> DDTIBRadCableAlgo_MTCC::layers [private]

Definition at line 39 of file DDTIBRadCableAlgo_MTCC.h.

Referenced by execute(), and initialize().

std::vector<double> DDTIBRadCableAlgo_MTCC::layRin [private]

Definition at line 30 of file DDTIBRadCableAlgo_MTCC.h.

Referenced by execute(), and initialize().

double DDTIBRadCableAlgo_MTCC::rMax [private]

Definition at line 29 of file DDTIBRadCableAlgo_MTCC.h.

Referenced by execute(), and initialize().

double DDTIBRadCableAlgo_MTCC::rMin [private]

Definition at line 28 of file DDTIBRadCableAlgo_MTCC.h.

Referenced by execute(), and initialize().

std::vector<std::string> DDTIBRadCableAlgo_MTCC::strucMat [private]

Definition at line 38 of file DDTIBRadCableAlgo_MTCC.h.

Referenced by execute(), and initialize().

Definition at line 34 of file DDTIBRadCableAlgo_MTCC.h.

Referenced by execute(), and initialize().

std::string DDTIBRadCableAlgo_MTCC::supportMat [private]

Definition at line 35 of file DDTIBRadCableAlgo_MTCC.h.

Referenced by execute(), and initialize().

Definition at line 33 of file DDTIBRadCableAlgo_MTCC.h.

Referenced by execute(), and initialize().