#include <DDPixBarLayerUpgradeAlgo.h>
Public Member Functions | |
DDPixBarLayerUpgradeAlgo () | |
void | execute (DDCompactView &cpv) |
void | initialize (const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) |
virtual | ~DDPixBarLayerUpgradeAlgo () |
Private Attributes | |
double | cool1Offset |
double | cool2Offset |
double | coolDist |
double | coolDz |
std::string | coolMat |
double | coolRadius |
double | coolThick |
std::string | genMat |
std::string | idNameSpace |
std::string | ladder |
double | ladderOffset |
double | ladderThick |
double | ladderWidth |
double | layerDz |
int | number |
int | outerFirst |
std::string | tubeMat |
Definition at line 10 of file DDPixBarLayerUpgradeAlgo.h.
DDPixBarLayerUpgradeAlgo::DDPixBarLayerUpgradeAlgo | ( | ) |
Definition at line 21 of file DDPixBarLayerUpgradeAlgo.cc.
References LogDebug.
{ LogDebug("PixelGeom") <<"DDPixBarLayerUpgradeAlgo info: Creating an instance"; }
DDPixBarLayerUpgradeAlgo::~DDPixBarLayerUpgradeAlgo | ( | ) | [virtual] |
Definition at line 25 of file DDPixBarLayerUpgradeAlgo.cc.
{}
void DDPixBarLayerUpgradeAlgo::execute | ( | DDCompactView & | cpv | ) |
Definition at line 68 of file DDPixBarLayerUpgradeAlgo.cc.
References cool1Offset, cool2Offset, coolDist, coolDz, coolMat, coolRadius, coolThick, filterCSVwithJSON::copy, funct::cos(), dbl_to_string(), DDBase< N, C >::ddname(), DDrot(), DDSplit(), first, genMat, i, idNameSpace, ladder, ladderOffset, ladderThick, ladderWidth, layerDz, LogDebug, DDName::name(), mergeVDriftHistosByStation::name, DDBase< N, C >::name(), number, outerFirst, dbtoconf::parent, phi, DDCompactView::position(), makeMuonMisalignmentScenario::rot, edm::second(), funct::sin(), mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, tubeMat, and DDSolidFactory::tubs().
{ DDName mother = parent().name(); std::string idName = DDSplit(mother).first; double dphi = CLHEP::twopi/number; double x2 = coolDist*sin(0.5*dphi); double rtmi = coolDist*cos(0.5*dphi)-(coolRadius+ladderThick); double rmxh = coolDist*cos(0.5*dphi)+(coolRadius+ladderThick+ladderOffset); double rtmx = sqrt(rmxh*rmxh+ladderWidth*ladderWidth/4); DDSolid solid = DDSolidFactory::tubs(DDName(idName, idNameSpace),0.5*layerDz, rtmi, rtmx, 0, CLHEP::twopi); LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " << DDName(idName, idNameSpace) << " Tubs made of " << genMat << " from 0 to " << CLHEP::twopi/CLHEP::deg << " with Rin " << rtmi << " Rout " << rtmx << " ZHalf " << 0.5*layerDz; DDName matname(DDSplit(genMat).first, DDSplit(genMat).second); DDMaterial matter(matname); DDLogicalPart layer(solid.ddname(), matter, solid); double dr = coolRadius+0.5*ladderThick; std::string name = idName + "CoolTube"; solid = DDSolidFactory::tubs(DDName(name,idNameSpace), 0.5*coolDz, 0, coolRadius, 0, CLHEP::twopi); LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " <<solid.name() << " Tubs made of " << tubeMat << " from 0 to " << CLHEP::twopi/CLHEP::deg << " with Rout " << coolRadius << " ZHalf " << 0.5*coolDz; matter = DDMaterial(DDName(DDSplit(tubeMat).first, DDSplit(tubeMat).second)); DDLogicalPart coolTube(solid.ddname(), matter, solid); name = idName + "Coolant"; solid = DDSolidFactory::tubs(DDName(name,idNameSpace), 0.5*coolDz, 0, coolRadius-coolThick, 0, CLHEP::twopi); LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " <<solid.name() << " Tubs made of " << tubeMat << " from 0 to " << CLHEP::twopi/CLHEP::deg << " with Rout " << coolRadius-coolThick << " ZHalf " << 0.5*coolDz; matter = DDMaterial(DDName(DDSplit(coolMat).first, DDSplit(coolMat).second)); DDLogicalPart cool(solid.ddname(), matter, solid); cpv.position (cool, coolTube, 1, DDTranslation(0.0, 0.0, 0.0), DDRotation()); LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " << cool.name() << " number 1 positioned in " << coolTube.name() << " at (0,0,0) with no rotation"; DDName ladderFull(DDSplit(ladder).first, DDSplit(ladder).second); int copy=1, iup=(-1)*outerFirst; int copyoffset=number+2; for (int i=1; i<number+1; i++) { double phi = i*dphi+90*CLHEP::deg-0.5*dphi; //to start with the interface ladder double phix, phiy, rrr, rrroffset; std::string rots; DDTranslation tran; DDRotation rot; iup =-iup; if ((i==1)||(i==number/2+1)){ dr=coolRadius+0.5*ladderThick+ladderOffset; //interface ladder offset }else{ dr=coolRadius+0.5*ladderThick; } rrr = coolDist*cos(0.5*dphi)+iup*dr; tran = DDTranslation(rrr*cos(phi), rrr*sin(phi), 0); rots = idName + dbl_to_string(copy); if (iup > 0) phix = phi-90*CLHEP::deg; else phix = phi+90*CLHEP::deg; phiy = phix+90.*CLHEP::deg; LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: Creating a new " << "rotation: " << rots << "\t90., " << phix/CLHEP::deg << ", 90.," << phiy/CLHEP::deg << ", 0, 0"; rot = DDrot(DDName(rots,idNameSpace), 90*CLHEP::deg, phix, 90*CLHEP::deg, phiy, 0.,0.); cpv.position (ladderFull, layer, copy, tran, rot); LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " << ladderFull << " number " << copy << " positioned in " << layer.name() << " at " << tran << " with " << rot; copy++; rrr = coolDist*cos(0.5*dphi); tran = DDTranslation(rrr*cos(phi)-x2*sin(phi), rrr*sin(phi)+x2*cos(phi), 0); rots = idName + dbl_to_string(i+100); phix = phi+0.5*dphi; if (iup > 0) phix += 180*CLHEP::deg; phiy = phix+90.*CLHEP::deg; LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: Creating a new " << "rotation: " << rots << "\t90., " << phix/CLHEP::deg << ", 90.," << phiy/CLHEP::deg << ", 0, 0"; rot = DDrot(DDName(rots,idNameSpace), 90*CLHEP::deg, phix, 90*CLHEP::deg, phiy, 0.,0.); cpv.position (coolTube, layer, i+1, tran, rot); if ((i==1)||(i==number/2+1)){ rrroffset = coolDist*cos(0.5*dphi)+iup*ladderOffset; tran = DDTranslation(rrroffset*cos(phi)-cool1Offset*sin(phi), rrroffset*sin(phi)+cool1Offset*cos(phi), 0); cpv.position (coolTube, layer, copyoffset, tran, DDRotation()); copyoffset++; tran = DDTranslation(rrroffset*cos(phi)-cool2Offset*sin(phi), rrroffset*sin(phi)+cool2Offset*cos(phi), 0); cpv.position (coolTube, layer, copyoffset, tran, DDRotation()); copyoffset++; } LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " << coolTube.name() << " number " << i+1 << " positioned in " << layer.name() << " at " << tran << " with "<< rot; } }
void DDPixBarLayerUpgradeAlgo::initialize | ( | const DDNumericArguments & | nArgs, |
const DDVectorArguments & | vArgs, | ||
const DDMapArguments & | mArgs, | ||
const DDStringArguments & | sArgs, | ||
const DDStringVectorArguments & | vsArgs | ||
) |
Definition at line 27 of file DDPixBarLayerUpgradeAlgo.cc.
References cool1Offset, cool2Offset, coolDist, coolDz, coolMat, coolRadius, coolThick, genMat, idNameSpace, ladder, ladderOffset, ladderThick, ladderWidth, layerDz, LogDebug, DDCurrentNamespace::ns(), number, outerFirst, dbtoconf::parent, and tubeMat.
{ idNameSpace = DDCurrentNamespace::ns(); DDName parentName = parent().name(); genMat = sArgs["GeneralMaterial"]; number = int(nArgs["Ladders"]); layerDz = nArgs["LayerDz"]; coolDz = nArgs["CoolDz"]; coolThick = nArgs["CoolThick"]; coolRadius= nArgs["CoolRadius"]; coolDist = nArgs["CoolDist"]; cool1Offset = nArgs["Cool1Offset"]; cool2Offset = nArgs["Cool2Offset"]; coolMat = sArgs["CoolMaterial"]; tubeMat = sArgs["CoolTubeMaterial"]; LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo debug: Parent " << parentName << " NameSpace " << idNameSpace << "\n" << "\tLadders " << number << "\tGeneral Material " << genMat << "\tLength " << layerDz << "\tSpecification of Cooling Pieces:\n" << "\tLength " << coolDz << " Thickness of Shell " << coolThick << " Radial distance " << coolDist << " Materials " << coolMat << ", " << tubeMat; ladder = sArgs["LadderName"]; ladderWidth = nArgs["LadderWidth"]; ladderThick = nArgs["LadderThick"]; ladderOffset = nArgs["LadderOffset"]; outerFirst = int(nArgs["OuterFirst"]); LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo debug: Full Ladder " << ladder << " width/thickness " << ladderWidth << ", " << ladderThick; }
double DDPixBarLayerUpgradeAlgo::cool1Offset [private] |
Definition at line 34 of file DDPixBarLayerUpgradeAlgo.h.
Referenced by execute(), and initialize().
double DDPixBarLayerUpgradeAlgo::cool2Offset [private] |
Definition at line 35 of file DDPixBarLayerUpgradeAlgo.h.
Referenced by execute(), and initialize().
double DDPixBarLayerUpgradeAlgo::coolDist [private] |
Definition at line 33 of file DDPixBarLayerUpgradeAlgo.h.
Referenced by execute(), and initialize().
double DDPixBarLayerUpgradeAlgo::coolDz [private] |
Definition at line 30 of file DDPixBarLayerUpgradeAlgo.h.
Referenced by execute(), and initialize().
std::string DDPixBarLayerUpgradeAlgo::coolMat [private] |
Definition at line 36 of file DDPixBarLayerUpgradeAlgo.h.
Referenced by execute(), and initialize().
double DDPixBarLayerUpgradeAlgo::coolRadius [private] |
Definition at line 32 of file DDPixBarLayerUpgradeAlgo.h.
Referenced by execute(), and initialize().
double DDPixBarLayerUpgradeAlgo::coolThick [private] |
Definition at line 31 of file DDPixBarLayerUpgradeAlgo.h.
Referenced by execute(), and initialize().
std::string DDPixBarLayerUpgradeAlgo::genMat [private] |
Definition at line 27 of file DDPixBarLayerUpgradeAlgo.h.
Referenced by execute(), and initialize().
std::string DDPixBarLayerUpgradeAlgo::idNameSpace [private] |
Definition at line 26 of file DDPixBarLayerUpgradeAlgo.h.
Referenced by execute(), and initialize().
std::string DDPixBarLayerUpgradeAlgo::ladder [private] |
Definition at line 38 of file DDPixBarLayerUpgradeAlgo.h.
Referenced by execute(), and initialize().
double DDPixBarLayerUpgradeAlgo::ladderOffset [private] |
Definition at line 41 of file DDPixBarLayerUpgradeAlgo.h.
Referenced by execute(), and initialize().
double DDPixBarLayerUpgradeAlgo::ladderThick [private] |
Definition at line 40 of file DDPixBarLayerUpgradeAlgo.h.
Referenced by execute(), and initialize().
double DDPixBarLayerUpgradeAlgo::ladderWidth [private] |
Definition at line 39 of file DDPixBarLayerUpgradeAlgo.h.
Referenced by execute(), and initialize().
double DDPixBarLayerUpgradeAlgo::layerDz [private] |
Definition at line 29 of file DDPixBarLayerUpgradeAlgo.h.
Referenced by execute(), and initialize().
int DDPixBarLayerUpgradeAlgo::number [private] |
Definition at line 28 of file DDPixBarLayerUpgradeAlgo.h.
Referenced by execute(), and initialize().
int DDPixBarLayerUpgradeAlgo::outerFirst [private] |
Definition at line 42 of file DDPixBarLayerUpgradeAlgo.h.
Referenced by execute(), and initialize().
std::string DDPixBarLayerUpgradeAlgo::tubeMat [private] |
Definition at line 37 of file DDPixBarLayerUpgradeAlgo.h.
Referenced by execute(), and initialize().